diff options
Diffstat (limited to 'Tools/mkrelease.py')
-rwxr-xr-x | Tools/mkrelease.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Tools/mkrelease.py b/Tools/mkrelease.py index 014cef227..28dca265b 100755 --- a/Tools/mkrelease.py +++ b/Tools/mkrelease.py @@ -2,6 +2,7 @@ import sys import os +from utils import * def failed(message): if message == "": @@ -27,15 +28,17 @@ skip_checks = args.skip_checks username = args.username print("Looking for rsync") -os.system("which rsync") and failed("rsync not installed/found. Please install.") +run_command("which", "rsync") and failed("rsync not installed/found. Please install.") print("Making source tarball") force = "--force-tag" if force_tag else "" skip = "--skip-checks" if skip_checks else "" -os.system("python ./mkdist.py {} {} --branch {} {}".format(force, skip, branch, version)) and failed("") +toolsdir = os.path.dirname(os.path.abspath(__file__)) +cmd = "python {}/mkdist.py {} {} --branch {} {}".format(toolsdir, force, skip, branch, version).split() +run_command(*cmd) and failed("") print("Build Windows package") -os.system("./mkwindows.sh " + version) and failed("") +run_command("{}/mkwindows.sh".format(toolsdir), version) and failed("") if username: print("Uploading to SourceForge") @@ -45,11 +48,11 @@ if username: # If a file with 'readme' in the name exists in the same folder as the zip/tarball, it gets automatically displayed as the release notes by SF full_readme_file = "readme-" + version + ".txt" - os.system("rm -f " + full_readme_file) - os.system("cat swig-" + version + "/README " + "swig-" + version + "/CHANGES.current " + "swig-" + version + "/RELEASENOTES " + "> " + full_readme_file) + run_command("rm", "-f", full_readme_file) + run_command("cat", "swig-" + version + "/README", "swig-" + version + "/CHANGES.current", "swig-" + version + "/RELEASENOTES", ">", full_readme_file) - os.system("rsync --archive --verbose -P --times -e ssh " + "swig-" + version + ".tar.gz " + full_readme_file + " " + swig_dir_sf) and failed("") - os.system("rsync --archive --verbose -P --times -e ssh " + "swigwin-" + version + ".zip " + full_readme_file + " " + swigwin_dir_sf) and failed("") + run_command("rsync", "--archive", "--verbose", "-P", "--times", "-e", "ssh", "swig-" + version + ".tar.gz", full_readme_file, swig_dir_sf) and failed("") + run_command("rsync", "--archive", "--verbose", "-P", "--times", "-e", "ssh", "swigwin-" + version + ".zip", full_readme_file, swigwin_dir_sf) and failed("") print("Finished") |