index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz@archlinux.org> | 2018-06-10 17:20:48 -0400 |
---|---|---|
committer | Levente Polyak <anthraxx@archlinux.org> | 2019-08-09 19:39:45 +0200 |
commit | 58374246c4e32d14354345aef516d49207881ce2 (patch) | |
tree | 0037f29930b5490404a0e3a165e3f3936d03fc45 /arch-nspawn.in | |
parent | f522ce2277100a147baa2656753231b14cf1f71d (diff) |
-rw-r--r-- | arch-nspawn.in | 11 |
diff --git a/arch-nspawn.in b/arch-nspawn.in index e68e2e7..3d03c91 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -35,7 +35,7 @@ while getopts 'hC:M:c:f:s' arg; do case "$arg" in C) pac_conf="$OPTARG" ;; M) makepkg_conf="$OPTARG" ;; - c) cache_dir="$OPTARG" ;; + c) cache_dirs+=("$OPTARG") ;; f) files+=("$OPTARG") ;; s) nosetarch=1 ;; h|?) usage ;; @@ -52,13 +52,12 @@ shift 1 [[ -z $working_dir ]] && die 'Please specify a working directory.' -if [[ -z $cache_dir ]]; then - cache_dirs=($(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g')) -else - cache_dirs=("$cache_dir") +pacconf_cmd=$(command -v pacman-conf || command -v pacconf) + +if (( ${#cache_dirs[@]} == 0 )); then + mapfile -t cache_dirs < <($pacconf_cmd CacheDir) fi -pacconf_cmd=$(command -v pacman-conf || command -v pacconf) # shellcheck disable=2016 host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')) # shellcheck disable=2016 |