diff options
author | Jamie Slome <jamie@418sec.com> | 2021-03-25 06:58:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-25 06:58:11 +0000 |
commit | 8852a1b6d14ba9d6ab23f7cf8be32830040029a1 (patch) | |
tree | 9ceeb35ff25aa82cf1e93e0c3636e1c46f9fe5fd /Tools/mkrelease.py | |
parent | a05fc7931069e39b0194aaefcaa96014cb11f4d6 (diff) | |
download | swig-8852a1b6d14ba9d6ab23f7cf8be32830040029a1.tar.gz |
Update mkrelease.py
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") |