Compare commits

..

2 Commits

Author SHA1 Message Date
Evangelos Foutras
113807dcfe Merge branch 'arch-nspawn-read-CacheDir-from-host' into 'master'
arch-nspawn: read CacheDir option from host's conf

See merge request archlinux/devtools!95
2025-07-26 10:04:23 +03:00
Evangelos Foutras
d0847a2a1c arch-nspawn: read CacheDir option from host's conf
This went unnoticed on build.archlinux.org until we tried switching away
from its local /srv/ftp/ mirror. With a remote mirror, the chroots would
ignore all the cached packages under /srv/ftp/pool/{packages,community}.

With the local file:// mirror gone, arch-nspawn wouldn't mount the cache
directories from the host into the chroot. The fix is to read the option
from the host's pacman.conf, instead of the one given to arch-nspawn and
the one existing inside the working directory.
2022-03-20 10:44:45 +02:00
2 changed files with 8 additions and 8 deletions

View File

@@ -69,7 +69,7 @@ nspawn_args=(
)
if (( ${#cache_dirs[@]} == 0 )); then
mapfile -t cache_dirs < <(pacman-conf --config "${pac_conf:-$working_dir/etc/pacman.conf}" CacheDir)
mapfile -t cache_dirs < <(pacman-conf CacheDir)
fi
# shellcheck disable=2016

View File

@@ -94,19 +94,19 @@ pkgctl_license_check() {
pushd "${path}" >/dev/null
if [[ ! -f PKGBUILD ]]; then
msg_error "${BOLD}${path}:${ALL_OFF} no PKGBUILD found"
msg_error "${BOLD}${pkgbase}:${ALL_OFF} no PKGBUILD found"
return 1
fi
if [[ ! -f .SRCINFO ]]; then
msg_error "${BOLD}${path}:${ALL_OFF} no .SRCINFO found"
return 1
fi
# reset common PKGBUILD variables
unset pkgbase
if ! pkgbase=$(grep --max-count=1 --extended-regexp "pkgbase = (.+)" .SRCINFO | awk '{print $3}'); then
msg_error "${BOLD}${path}:${ALL_OFF} pkgbase not found in .SRCINFO"
# shellcheck source=contrib/makepkg/PKGBUILD.proto
if ! . ./PKGBUILD; then
msg_error "${BOLD}${pkgbase}:${ALL_OFF} failed to source PKGBUILD"
return 1
fi
pkgbase=${pkgbase:-$pkgname}
if [[ ! -e LICENSE ]]; then
msg_error "${BOLD}${pkgbase}:${ALL_OFF} is missing the LICENSE file"