diff options
Diffstat (limited to 'adelie-build-txz')
-rwxr-xr-x | adelie-build-txz | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/adelie-build-txz b/adelie-build-txz index 15d81bf..b419de1 100755 --- a/adelie-build-txz +++ b/adelie-build-txz @@ -57,6 +57,7 @@ usage() { printf 'Default VERSION: %s\n' $def_ver } +[ -d /etc/apk/cache ] && def_cache=/etc/apk/cache while [ -n "$1" ]; do case $1 in @@ -75,6 +76,13 @@ while [ -n "$1" ]; do shift readonly MY_VER=$1 ;; + -c | --cache) + shift + readonly MY_CACHE=$1 + ;; + --no-cache) + unset def_cache + ;; *) usage >&2 exit 127 @@ -90,6 +98,7 @@ readonly PHASE=${MY_PHASE:-all} readonly VERSION=${MY_VER:-$def_ver} readonly APKVER=${MY_APKVER:-$VERSION} readonly URL=${MY_URL:-https://distfiles.adelielinux.org/adelie/$VERSION/} +readonly CACHE=${MY_CACHE:-$def_cache} set +a ensure_commands @@ -132,6 +141,7 @@ install_pkgs() { mknod rootfs-$ARCH/dev/urandom c 1 9 mkdir -p rootfs-$ARCH/usr/sbin apk --arch $ARCH \ + ${CACHE:+--cache-dir "${CACHE}"} \ -X "$URL/system/$EXTRA_MIRROR" \ -X "$URL/user/$EXTRA_MIRROR" \ -U --root rootfs-$ARCH --initdb add $PACKAGES $ARCH_PKGS |