summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri Merejkowsky2015-11-21 02:02:12 +0100
committerDimitri Merejkowsky2015-11-21 02:04:44 +0100
commitd859a5798df5b95ae85ded90b6b6913a44338b67 (patch)
tree14c674185800cfab35d679c8b4755b7ad2ca4352
parent2ea5ea5b8ec4dccc6f271e66f595bd84d0b26404 (diff)
downloadaur-d859a5798df5b95ae85ded90b6b6913a44338b67.tar.gz
make-release: use stuff from dev-tools instead of re-implementing them
* use updpkgsums to update the checksums * use extra-x86_64-build to build in a clean chroot
-rw-r--r--make-release.py40
1 files changed, 5 insertions, 35 deletions
diff --git a/make-release.py b/make-release.py
index 07d55007b9a..39c7a1f93e7 100644
--- a/make-release.py
+++ b/make-release.py
@@ -29,40 +29,14 @@ def set_version(version):
with open(pkgbuild, "w") as fp:
fp.writelines(new_lines)
-
-def get_checksum_line():
- cmd = ["makepkg", "--geninteg"]
- output = subprocess.check_output(cmd, cwd=THIS_DIR)
- return output.decode("utf-8")
-
-def set_checksum(checksum_line):
- pkgbuild = os.path.join(THIS_DIR, "PKGBUILD")
- with open(pkgbuild, "r") as fp:
- lines = fp.readlines()
- new_lines = list()
- for line in lines:
- if line.startswith("md5sums"):
- new_lines.append(checksum_line)
- else:
- new_lines.append(line)
-
- with open(pkgbuild, "w") as fp:
- fp.writelines(new_lines)
+def set_checksums():
+ cmd = ["/usr/bin/updpkgsums"]
+ subprocess.check_call(cmd, cwd=THIS_DIR)
def run_makepkg():
- cmd = ["makepkg"]
+ cmd = ["/usr/bin/extra-x86_64-build"]
subprocess.check_call(cmd, cwd=THIS_DIR)
-def run_namcap():
- cmd = ["namcap", "PKGBUILD"]
- subprocess.check_call(cmd, cwd=THIS_DIR)
- contents = os.listdir(THIS_DIR)
- pkgs = [x for x in contents if "pkg.tar.xz" in x]
- if len(pkgs) != 1:
- sys.exit("Expecting one pkg, got %s" % pkgs)
- pkg = pkgs[0]
- cmd = ["namcap", pkg]
- subprocess.check_call(cmd, cwd=THIS_DIR)
def update_srcinfo():
cmd = ["mksrcinfo"]
@@ -85,12 +59,8 @@ def push():
def make_release(version):
clean()
set_version(version)
- new_checksum_line = get_checksum_line()
- set_checksum(new_checksum_line)
+ set_checksums()
run_makepkg()
- print("running namcap ...")
- run_namcap()
- print("namcap OK")
update_srcinfo()
commit_all(version)
push()