Commit 3cac5ffa9e41a4fdbc94b2339f742d47263ea2cd
Merge branch 'finialize-release-script' into integration
Showing
1 changed file
with
26 additions
and
26 deletions
dev/release.py
| ... | ... | @@ -417,27 +417,28 @@ def set_package_version(version): |
| 417 | 417 | # ============= # |
| 418 | 418 | # Build tarball # |
| 419 | 419 | # ============= # |
| 420 | -def build_tarball(branch, folder): | |
| 420 | +def build_tarball(): | |
| 421 | 421 | """ |
| 422 | 422 | Build tarball using 'make dist' |
| 423 | - | |
| 424 | - Parameters | |
| 425 | - ---------- | |
| 426 | - branch : str | |
| 427 | - Git branch | |
| 428 | - folder : str | |
| 429 | - Folder name | |
| 430 | 423 | """ |
| 431 | 424 | # Set base path |
| 432 | 425 | base_path = os.getcwd() |
| 433 | 426 | |
| 434 | 427 | # Enable/disable logging |
| 435 | 428 | if confirm("Log actions in logfile?"): |
| 436 | - verbosity = ' >> %s/%s.log 2>&1' % (base_path, folder) | |
| 437 | - os.system('rm -rf %s.log >/dev/null 2>&1' % folder) | |
| 429 | + verbosity = ' >> %s/make_dist.log 2>&1' % (base_path) | |
| 430 | + os.system('rm -rf make_dist.log >/dev/null 2>&1') | |
| 438 | 431 | else: |
| 439 | 432 | verbosity = ' >/dev/null 2>&1' |
| 440 | 433 | |
| 434 | + # Configure package | |
| 435 | + print("Configure package") | |
| 436 | + rc = os.system('./configure%s' % verbosity) | |
| 437 | + if rc == 0: | |
| 438 | + print("Package configuration successful") | |
| 439 | + else: | |
| 440 | + print("*** Failure in package configuration") | |
| 441 | + | |
| 441 | 442 | # Check package |
| 442 | 443 | print("Create tarball") |
| 443 | 444 | rc = os.system('make dist%s' % verbosity) |
| ... | ... | @@ -453,7 +454,7 @@ def build_tarball(branch, folder): |
| 453 | 454 | # ============= # |
| 454 | 455 | # Check tarball # |
| 455 | 456 | # ============= # |
| 456 | -def check_tarball(filename): | |
| 457 | +def check_tarball(): | |
| 457 | 458 | """ |
| 458 | 459 | Check tarball using 'make distcheck' |
| 459 | 460 | |
| ... | ... | @@ -465,17 +466,21 @@ def check_tarball(filename): |
| 465 | 466 | # Set base path |
| 466 | 467 | base_path = os.getcwd() |
| 467 | 468 | |
| 468 | - # Set base folder | |
| 469 | - folder = filename.rstrip('.tar.gz') | |
| 470 | - | |
| 471 | 469 | # Enable/disable logging |
| 472 | 470 | if confirm("Log check in logfile?"): |
| 473 | - name = filename.rstrip('.tar.gz') | |
| 474 | - verbosity = ' >> %s/%s.check 2>&1' % (base_path, folder) | |
| 475 | - os.system('rm -rf %s.check >/dev/null 2>&1' % folder) | |
| 471 | + verbosity = ' >> %s/make_distcheck.log 2>&1' % (base_path) | |
| 472 | + os.system('rm -rf make_distcheck.log >/dev/null 2>&1') | |
| 476 | 473 | else: |
| 477 | 474 | verbosity = ' >/dev/null 2>&1' |
| 478 | 475 | |
| 476 | + # Configure package | |
| 477 | + print("Configure package") | |
| 478 | + rc = os.system('./configure%s' % verbosity) | |
| 479 | + if rc == 0: | |
| 480 | + print("Package configuration successful") | |
| 481 | + else: | |
| 482 | + print("*** Failure in package configuration") | |
| 483 | + | |
| 479 | 484 | # Check tarball |
| 480 | 485 | print("Check tarball") |
| 481 | 486 | rc = os.system('make distcheck%s' % verbosity) |
| ... | ... | @@ -580,14 +585,12 @@ def release_menu(branch='release'): |
| 580 | 585 | # Step 6: Build tarball |
| 581 | 586 | print("") |
| 582 | 587 | if confirm("Step 6: Build tarball?"): |
| 583 | - folder = "gammalib-%s" % get_current_version() | |
| 584 | - build_tarball(branch, folder) | |
| 588 | + build_tarball() | |
| 585 | 589 | |
| 586 | 590 | # Step 7: Check tarball |
| 587 | 591 | print("") |
| 588 | 592 | if confirm("Step 7: Check tarball?"): |
| 589 | - filename = "gammalib-%s.tar.gz" % get_current_version() | |
| 590 | - check_tarball(filename) | |
| 593 | + check_tarball() | |
| 591 | 594 | |
| 592 | 595 | # Print separator |
| 593 | 596 | print("") |
| ... | ... | @@ -709,13 +712,10 @@ if __name__ == '__main__': |
| 709 | 712 | commit('') |
| 710 | 713 | print('') |
| 711 | 714 | elif choice == '5': |
| 712 | - branch = commands.getoutput('git rev-parse --abbrev-ref HEAD') | |
| 713 | - folder = "gammalib-%s" % get_current_version() | |
| 714 | - build_tarball(branch, folder) | |
| 715 | + build_tarball() | |
| 715 | 716 | print('') |
| 716 | 717 | elif choice == '6': |
| 717 | - filename = "gammalib-%s.tar.gz" % get_current_version() | |
| 718 | - check_tarball(filename) | |
| 718 | + check_tarball() | |
| 719 | 719 | print('') |
| 720 | 720 | elif choice == 'q': |
| 721 | 721 | break | ... | ... |