abuild: update cachedir logic for rootbld
Closes [#10111] [#10111]: https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10111
This commit is contained in:
parent
7276042237
commit
855992822d
10
abuild.in
10
abuild.in
|
@ -2511,19 +2511,15 @@ rootbld() {
|
||||||
|
|
||||||
[ $CBUILD = $CHOST ] || die "rootbld: set CBUILD=$CHOST to build for $CHOST"
|
[ $CBUILD = $CHOST ] || die "rootbld: set CBUILD=$CHOST to build for $CHOST"
|
||||||
|
|
||||||
|
local cachedir=/etc/apk/cache
|
||||||
if ! [ $CBUILD_ARCH = "$($APK --print-arch)" ]; then
|
if ! [ $CBUILD_ARCH = "$($APK --print-arch)" ]; then
|
||||||
# cross-building, so check for binfmt registration
|
# cross-building, so check for binfmt registration
|
||||||
local qarch="$(rootbld_qemu_arch)"
|
local qarch="$(rootbld_qemu_arch)"
|
||||||
if ! [ -f "/proc/sys/fs/binfmt_misc/qemu-$qarch" ]; then
|
if ! [ -f "/proc/sys/fs/binfmt_misc/qemu-$qarch" ]; then
|
||||||
warning "rootbld: binfmt registration missing for $qarch binaries"
|
warning "rootbld: binfmt registration missing for $qarch binaries"
|
||||||
fi
|
fi
|
||||||
# TODO: it's not safe to mix a cache dir between architectures,
|
# Old versions of apk have cache conflicts
|
||||||
# so we have to use something other than /etc/apk/cache
|
$APK info -eq 'cmd:apk>=2.14.1' || cachedir=""
|
||||||
# to get a cache when cross-qemu-building.
|
|
||||||
#local cachedir=""
|
|
||||||
else
|
|
||||||
# not cross-building in qemu, so use host cache
|
|
||||||
local cachedir="/etc/apk/cache"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
logcmd "chroot building building $repo/$pkgname-$pkgver-r$pkgrel"
|
logcmd "chroot building building $repo/$pkgname-$pkgver-r$pkgrel"
|
||||||
|
|
Loading…
Reference in New Issue