From 8852a1b6d14ba9d6ab23f7cf8be32830040029a1 Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Thu, 25 Mar 2021 06:58:11 +0000 Subject: Update mkrelease.py --- Tools/mkrelease.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Tools') 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") -- cgit v1.2.1