Verified Commit 3fb12f36 authored by CyberLeo's avatar CyberLeo
Browse files

Avoid system cache if specified arch differs from host arch

parent bd4a68ae
......@@ -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}
......
......@@ -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
......
......@@ -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}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment