From 255c7156244d990ff63ff73fed0e99ddcc5d9458 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 12 Mar 2018 17:17:32 +0100 Subject: [PATCH] Fix aportgen without initializing buildenv After initializing the build environment, the cache_distfiles folder currently is writable by everyone (which is not ideal, fix following soon). The aportgen code for `busybox-static-*` and `musl-*` copies the foreign arch `.apk` file to the distfiles, but it executes this action as regular user and not as root. This only works as long as build initialization ran before (which may not be the case on Travis and expecting this to run before is a bug in general). With this commit, the copy action gets executed as root, so it works in any case. I'm commiting this directly (without a PR), because it is a super simple fix and it unblocks our continuous integration. Local testing: $ pmbootstrap -y zap $ sudo rm -r ~/.local/var/pmbootstrap/cache_distfiles $ pmbootstrap aportgen musl-armhf --- pmb/aportgen/busybox_static.py | 2 +- pmb/aportgen/musl.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pmb/aportgen/busybox_static.py b/pmb/aportgen/busybox_static.py index a2a5ec95..0cef481a 100644 --- a/pmb/aportgen/busybox_static.py +++ b/pmb/aportgen/busybox_static.py @@ -49,7 +49,7 @@ def generate(args, pkgname): path_target = (args.work + "/cache_distfiles/busybox-static-" + version + "-" + arch + ".apk") if not os.path.exists(path_target): - pmb.helpers.run.user(args, ["cp", path, path_target]) + pmb.helpers.run.root(args, ["cp", path, path_target]) # Hash the distfile hashes = pmb.chroot.user(args, ["sha512sum", diff --git a/pmb/aportgen/musl.py b/pmb/aportgen/musl.py index 6b507553..a824f585 100644 --- a/pmb/aportgen/musl.py +++ b/pmb/aportgen/musl.py @@ -54,7 +54,7 @@ def generate(args, pkgname): path_target = (args.work + "/cache_distfiles/" + subpkgname + "-" + version + "-" + arch + ".apk") if not os.path.exists(path_target): - pmb.helpers.run.user(args, ["cp", path, path_target]) + pmb.helpers.run.root(args, ["cp", path, path_target]) # Hash the distfiles hashes = pmb.chroot.user(args, ["sha512sum",