Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/arch-nspawn.in
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2023-05-29 16:05:59 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2023-05-29 16:05:59 +0200
commitbe8ac63f28a402acbf7e21972ac5d3b45bed1f79 (patch)
tree6eb83c09f6549ae41988a25243a2b424a4f99a4e /src/arch-nspawn.in
parentbfc22eea7e4c6877fe8b9d89fa574cb0729466db (diff)
parenta07df0beeaeea1bf5665512bacc7a013eece4602 (diff)
merged with devtools 1.0.1 upstream (git repo migration)
Diffstat (limited to 'src/arch-nspawn.in')
-rw-r--r--src/arch-nspawn.in15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/arch-nspawn.in b/src/arch-nspawn.in
index ae50043..11af616 100644
--- a/src/arch-nspawn.in
+++ b/src/arch-nspawn.in
@@ -2,8 +2,12 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
-m4_include(lib/common.sh)
-m4_include(lib/archroot.sh)
+_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
+# shellcheck source=src/lib/common.sh
+source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
+# shellcheck source=src/lib/archroot.sh
+source "${_DEVTOOLS_LIBRARY_DIR}"/lib/archroot.sh
+
# umask might have been changed in /etc/profile
# ensure that sane default is set again
@@ -28,6 +32,9 @@ usage() {
exit 1
}
+# save all args for check_root
+orig_args=("$@")
+
while getopts 'hC:M:c:f:s' arg; do
case "$arg" in
C) pac_conf="$OPTARG" ;;
@@ -42,7 +49,7 @@ done
shift $((OPTIND - 1))
(( $# < 1 )) && die 'You must specify a directory.'
-check_root
+check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
working_dir=$(readlink -f "$1")
shift 1
@@ -54,7 +61,7 @@ if (( ${#cache_dirs[@]} == 0 )); then
fi
# shellcheck disable=2016
-host_mirrors=($(pacman-conf --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#;t;s#(.*/)[^/]+/extra(/?)$#\1$arch/$repo\2#'))
+host_mirrors=($(pacman-conf --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
for host_mirror in "${host_mirrors[@]}"; do
if [[ $host_mirror == *file://* ]]; then