Skip to content

Commit

Permalink
Drop pacutils:pacconf fallback
Browse files Browse the repository at this point in the history
As of pacman:5.2 `pacman-conf` obsoletes `pacconf`
  • Loading branch information
bartus committed Mar 5, 2021
1 parent 90ba07d commit ee3c4f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions arch-nspawn.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ shift 1

[[ -z $working_dir ]] && die 'Please specify a working directory.'

pacconf_cmd=$(command -v pacman-conf || command -v pacconf)

if (( ${#cache_dirs[@]} == 0 )); then
mapfile -t cache_dirs < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" CacheDir)
mapfile -t cache_dirs < <(pacman-conf --config "${pac_conf:-$working_dir/etc/pacman.conf}" CacheDir)
fi

# shellcheck disable=2016
Expand All @@ -76,15 +74,15 @@ for host_mirror in "${host_mirrors[@]}"; do
done

while read -r line; do
mapfile -t lines < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" \
mapfile -t lines < <(pacman-conf --config "${pac_conf:-$working_dir/etc/pacman.conf}" \
--repo $line Server | sed -r 's#(.*/)[^/]+/os/.+#\1#')
for line in "${lines[@]}"; do
if [[ $line = file://* ]]; then
line=${line#file://}
in_array "$line" "${cache_dirs[@]}" || cache_dirs+=("$line")
fi
done
done < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo-list)
done < <(pacman-conf --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo-list)

mount_args+=("--bind=${cache_dirs[0]//:/\\:}")

Expand Down
3 changes: 1 addition & 2 deletions mkarchroot.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ shift 1

[[ -z $working_dir ]] && die 'Please specify a working directory.'

pacconf_cmd=$(command -v pacman-conf || command -v pacconf)

if (( ${#cache_dirs[@]} == 0 )); then
mapfile -t cache_dirs < <($pacconf_cmd CacheDir)
mapfile -t cache_dirs < <(pacman-conf CacheDir)
fi

umask 0022
Expand Down

0 comments on commit ee3c4f9

Please sign in to comment.