From 05c837c9210db607477e7b27b340bc6cf2b1ee0a Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sat, 17 Jun 2017 01:58:40 +0200 Subject: [PATCH] pmbootstrap challenge: Put buildinfo.json in changed files list. ...and some smaller fixes: * make the diff output easier to read * verify, that only .apk, .buildinfo.json and the APKINDEX have changed inside the local repository folder. Because the file names of these changes will be used to release files from staging to release. --- pmb/build/challenge.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pmb/build/challenge.py b/pmb/build/challenge.py index be649ea6..b01000c6 100644 --- a/pmb/build/challenge.py +++ b/pmb/build/challenge.py @@ -98,7 +98,7 @@ def diff(args, apk_a, apk_b): logging.debug("Compare: " + name) if name == ".PKGINFO": logging.debug( - "=> Skipping, this is expected to be different") + "=> Skipping: expected to be different") continue # Get members @@ -109,7 +109,7 @@ def diff(args, apk_a, apk_b): "Entry '" + name + "' has a different type!") if member_a.isdir(): - logging.debug("=> Skipping, this is directory") + logging.debug("=> Skipping: directory") elif member_a.isfile(): diff_files(tar_a, tar_b, member_a, member_b, name) elif member_a.issym() or member_a.islnk(): @@ -160,22 +160,26 @@ def challenge(args, apk_path): # Build the package repo_before = pmb.helpers.repo.files(args) pmb.build.package(args, buildinfo["pkgname"], buildinfo["arch"], - force=True) + force=True, buildinfo=True) repo_diff = pmb.helpers.repo.diff(args, repo_before) # Diff the apk contents staging_path = os.path.abspath(os.path.dirname(apk_path) + "/../") for file in repo_diff: + file_staging = staging_path + "/" + file + file_work = args.work + "/packages/" + file + if file.endswith(".apk"): logging.info("Verify " + file) - diff( - args, - staging_path + - "/" + - file, - args.work + - "/packages/" + - file) + diff(args, file_staging, file_work) + elif (file.endswith("/APKINDEX.tar.gz") or + file.endswith(".apk.buildinfo.json")): + # We only verify the apk file (see above). The APKINDEX can + # be verified separately. + continue + else: + raise RuntimeError("Unknown file type changed in the" + " package repository folder: " + file) # Output the changed files from the repository if args.output_repo_changes: