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,27 +417,28 @@ def set_package_version(version): | ||
| 417 | # ============= # | 417 | # ============= # |
| 418 | # Build tarball # | 418 | # Build tarball # |
| 419 | # ============= # | 419 | # ============= # |
| 420 | -def build_tarball(branch, folder): | 420 | +def build_tarball(): |
| 421 | """ | 421 | """ |
| 422 | Build tarball using 'make dist' | 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 | # Set base path | 424 | # Set base path |
| 432 | base_path = os.getcwd() | 425 | base_path = os.getcwd() |
| 433 | 426 | ||
| 434 | # Enable/disable logging | 427 | # Enable/disable logging |
| 435 | if confirm("Log actions in logfile?"): | 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 | else: | 431 | else: |
| 439 | verbosity = ' >/dev/null 2>&1' | 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 | # Check package | 442 | # Check package |
| 442 | print("Create tarball") | 443 | print("Create tarball") |
| 443 | rc = os.system('make dist%s' % verbosity) | 444 | rc = os.system('make dist%s' % verbosity) |
| @@ -453,7 +454,7 @@ def build_tarball(branch, folder): | @@ -453,7 +454,7 @@ def build_tarball(branch, folder): | ||
| 453 | # ============= # | 454 | # ============= # |
| 454 | # Check tarball # | 455 | # Check tarball # |
| 455 | # ============= # | 456 | # ============= # |
| 456 | -def check_tarball(filename): | 457 | +def check_tarball(): |
| 457 | """ | 458 | """ |
| 458 | Check tarball using 'make distcheck' | 459 | Check tarball using 'make distcheck' |
| 459 | 460 | ||
| @@ -465,17 +466,21 @@ def check_tarball(filename): | @@ -465,17 +466,21 @@ def check_tarball(filename): | ||
| 465 | # Set base path | 466 | # Set base path |
| 466 | base_path = os.getcwd() | 467 | base_path = os.getcwd() |
| 467 | 468 | ||
| 468 | - # Set base folder | ||
| 469 | - folder = filename.rstrip('.tar.gz') | ||
| 470 | - | ||
| 471 | # Enable/disable logging | 469 | # Enable/disable logging |
| 472 | if confirm("Log check in logfile?"): | 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 | else: | 473 | else: |
| 477 | verbosity = ' >/dev/null 2>&1' | 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 | # Check tarball | 484 | # Check tarball |
| 480 | print("Check tarball") | 485 | print("Check tarball") |
| 481 | rc = os.system('make distcheck%s' % verbosity) | 486 | rc = os.system('make distcheck%s' % verbosity) |
| @@ -580,14 +585,12 @@ def release_menu(branch='release'): | @@ -580,14 +585,12 @@ def release_menu(branch='release'): | ||
| 580 | # Step 6: Build tarball | 585 | # Step 6: Build tarball |
| 581 | print("") | 586 | print("") |
| 582 | if confirm("Step 6: Build tarball?"): | 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 | # Step 7: Check tarball | 590 | # Step 7: Check tarball |
| 587 | print("") | 591 | print("") |
| 588 | if confirm("Step 7: Check tarball?"): | 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 | # Print separator | 595 | # Print separator |
| 593 | print("") | 596 | print("") |
| @@ -709,13 +712,10 @@ if __name__ == '__main__': | @@ -709,13 +712,10 @@ if __name__ == '__main__': | ||
| 709 | commit('') | 712 | commit('') |
| 710 | print('') | 713 | print('') |
| 711 | elif choice == '5': | 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 | print('') | 716 | print('') |
| 716 | elif choice == '6': | 717 | elif choice == '6': |
| 717 | - filename = "gammalib-%s.tar.gz" % get_current_version() | ||
| 718 | - check_tarball(filename) | 718 | + check_tarball() |
| 719 | print('') | 719 | print('') |
| 720 | elif choice == 'q': | 720 | elif choice == 'q': |
| 721 | break | 721 | break |