From a1298cb114755464313e84caf618c020b9a0d438 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Thu, 15 Jun 2017 22:40:19 +0200 Subject: [PATCH] Challenge/buildinfo: slightly improve output Use "arch" instead of "carch", print "OK!" when a file has been verified (which is much easier to recognize than "File has the same content"). --- pmb/build/buildinfo.py | 12 ++++++------ pmb/build/challenge.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pmb/build/buildinfo.py b/pmb/build/buildinfo.py index 1ea5853c..745ddaec 100644 --- a/pmb/build/buildinfo.py +++ b/pmb/build/buildinfo.py @@ -57,16 +57,16 @@ def get_depends_recursively(args, pkgnames, arch=None): return ret -def generate(args, apk_path, carch, suffix, apkbuild): +def generate(args, apk_path, arch, suffix, apkbuild): """ :param apk_path: Path to the .apk file, relative to the packages cache. - :param carch: Architecture, that the package has been built for. + :param arch: Architecture, that the package has been built for. :apkbuild: Return from pmb.parse.apkbuild(). """ ret = {"pkgname": apkbuild["pkgname"], "pkgver": apkbuild["pkgver"], "pkgrel": apkbuild["pkgrel"], - "carch": carch, + "arch": arch, "versions": []} # Add makedepends versions @@ -80,7 +80,7 @@ def generate(args, apk_path, carch, suffix, apkbuild): return ret -def write(args, apk_path, carch, suffix, apkbuild): +def write(args, apk_path, arch, suffix, apkbuild): """ Write a .buildinfo.json file for a package, right after building it. It stores all information required to rebuild the package, very similar @@ -88,13 +88,13 @@ def write(args, apk_path, carch, suffix, apkbuild): Python): https://wiki.debian.org/ReproducibleBuilds/BuildinfoFiles :param apk_path: Path to the .apk file, relative to the packages cache. - :param carch: Architecture, that the package has been built for. + :param arch: Architecture, that the package has been built for. :apkbuild: Return from pmb.parse.apkbuild(). """ # Write to temp if os.path.exists(args.work + "/chroot_native/tmp/buildinfo"): pmb.chroot.root(args, ["rm", "/tmp/buildinfo"]) - buildinfo = generate(args, apk_path, carch, suffix, apkbuild) + buildinfo = generate(args, apk_path, arch, suffix, apkbuild) with open(args.work + "/chroot_native/tmp/buildinfo", "w") as handle: handle.write(json.dumps(buildinfo, indent=4, sort_keys=True) + "\n") diff --git a/pmb/build/challenge.py b/pmb/build/challenge.py index 370a7f39..be649ea6 100644 --- a/pmb/build/challenge.py +++ b/pmb/build/challenge.py @@ -46,7 +46,7 @@ def diff_files(tar_a, tar_b, member_a, member_b, name): for temp_file in temp_files: os.remove(temp_file) if equal: - logging.debug("=> File has the same content") + logging.debug("=> OK!") else: raise RuntimeError("File '" + name + "' is different!") @@ -159,7 +159,7 @@ def challenge(args, apk_path): " buildinfo: " + package_buildinfo + ")!") # Build the package repo_before = pmb.helpers.repo.files(args) - pmb.build.package(args, buildinfo["pkgname"], buildinfo["carch"], + pmb.build.package(args, buildinfo["pkgname"], buildinfo["arch"], force=True) repo_diff = pmb.helpers.repo.diff(args, repo_before)