diff options
author | CyberLeo <cyberleo@cyberleo.net> | 2020-03-30 07:59:12 -0500 |
---|---|---|
committer | CyberLeo <cyberleo@cyberleo.net> | 2020-03-30 08:00:17 -0500 |
commit | 3fb12f36c8136c7abd998322d900d6e01214e4dc (patch) | |
tree | 7ab5201eac117a0842e3a9ce35eabc9870d5b688 | |
parent | bd4a68aef064d0f375f17b4f0988688da30b884d (diff) | |
download | image-3fb12f36c8136c7abd998322d900d6e01214e4dc.tar.gz image-3fb12f36c8136c7abd998322d900d6e01214e4dc.tar.bz2 image-3fb12f36c8136c7abd998322d900d6e01214e4dc.tar.xz image-3fb12f36c8136c7abd998322d900d6e01214e4dc.zip |
Avoid system cache if specified arch differs from host arch
-rwxr-xr-x | adelie-build-cd | 5 | ||||
-rw-r--r-- | adelie-build-cd.8 | 3 | ||||
-rwxr-xr-x | adelie-build-txz | 5 | ||||
-rw-r--r-- | adelie-build-txz.8 | 3 |
4 files changed, 10 insertions, 6 deletions
diff --git a/adelie-build-cd b/adelie-build-cd index acd6530..f7d97a0 100755 --- a/adelie-build-cd +++ b/adelie-build-cd @@ -74,8 +74,6 @@ usage() { printf 'Valid phases: clean install initrd iso all\n' } -[ -d /etc/apk/cache ] && def_cache=/etc/apk/cache - while [ -n "$1" ]; do case $1 in -a | --arch) @@ -119,6 +117,9 @@ while [ -n "$1" ]; do shift done +[ -d /etc/apk/cache ] && def_cache=/etc/apk/cache +[ -z "${MY_ARCH}" -o "${MY_ARCH}" = "${def_arch}" ] || unset def_cache + set -a readonly ARCH=${MY_ARCH:-$def_arch} readonly KIND=${MY_KIND:-live} diff --git a/adelie-build-cd.8 b/adelie-build-cd.8 index 5da2b73..76f3184 100644 --- a/adelie-build-cd.8 +++ b/adelie-build-cd.8 @@ -58,7 +58,8 @@ Specifies the version of Adélie Linux to use for the created ISO. Specifies the location of the cache directory to use, to speed up .Xr apk 8 runs. Defaults to the system cache in -.Pa /etc/apk/cache . +.Pa /etc/apk/cache +for the same architecture, or none. This directory must exist, or it is ignored. .It Fl -no-cache Do not use any cache directory for this .Xr apk 8 diff --git a/adelie-build-txz b/adelie-build-txz index b419de1..4387af2 100755 --- a/adelie-build-txz +++ b/adelie-build-txz @@ -57,8 +57,6 @@ usage() { printf 'Default VERSION: %s\n' $def_ver } -[ -d /etc/apk/cache ] && def_cache=/etc/apk/cache - while [ -n "$1" ]; do case $1 in -a | --arch) @@ -91,6 +89,9 @@ while [ -n "$1" ]; do shift done +[ -d /etc/apk/cache ] && def_cache=/etc/apk/cache +[ -z "${MY_ARCH}" -o "${MY_ARCH}" = "${def_arch}" ] || unset def_cache + set -a readonly ARCH=${MY_ARCH:-$def_arch} readonly LDARCH=${LDARCH:-$ARCH} diff --git a/adelie-build-txz.8 b/adelie-build-txz.8 index 268cfca..6dfa9d5 100644 --- a/adelie-build-txz.8 +++ b/adelie-build-txz.8 @@ -35,7 +35,8 @@ Specifies the version of Adélie Linux to use for the created rootfs tarball. Specifies the location of the cache directory to use, to speed up .Xr apk 8 runs. Defaults to the system cache in -.Pa /etc/apk/cache . +.Pa /etc/apk/cache +for the same architecture, or none. This directory must exist, or it is ignored. .It Fl -no-cache Do not use any cache directory for this .Xr apk 8 |