Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/archbuild.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/archbuild.in
parentbfc22eea7e4c6877fe8b9d89fa574cb0729466db (diff)
parenta07df0beeaeea1bf5665512bacc7a013eece4602 (diff)
merged with devtools 1.0.1 upstream (git repo migration)
Diffstat (limited to 'src/archbuild.in')
-rw-r--r--src/archbuild.in38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/archbuild.in b/src/archbuild.in
index a5eb9a0..d023e0d 100644
--- a/src/archbuild.in
+++ b/src/archbuild.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
+
base_packages=(base-devel)
makechrootpkg_args=(-c -n -C)
@@ -23,16 +27,32 @@ if [[ -f "@pkgdatadir@/setarch-aliases.d/${arch}" ]]; then
else
set_arch="${arch}"
fi
+
+# Architecture-specific Mount
+arch_mounts=()
+if [[ -f "@pkgdatadir@/mount.d/${arch}" ]]; then
+ mapfile -t arch_mounts < "@pkgdatadir@/mount.d/${arch}"
+fi
+for arch_mount in "${arch_mounts[@]}"; do
+ if [[ $arch_mount = rw* ]]; then
+ arch_mount=${arch_mount#rw }
+ in_array "$arch_mount" "${makechrootpkg_args[@]}" || makechrootpkg_args+=("-d" "$arch_mount")
+ elif [[ $arch_mount = ro* ]]; then
+ arch_mount=${arch_mount#ro }
+ in_array "$arch_mount" "${makechrootpkg_args[@]}" || makechrootpkg_args+=("-D" "$arch_mount")
+ fi
+done
+
chroots='/var/lib/archbuild'
clean_first=false
-pacman_config="@pkgdatadir@/pacman-${repo}.conf"
-if [[ -f @pkgdatadir@/pacman-${repo}-${arch}.conf ]]; then
- pacman_config="@pkgdatadir@/pacman-${repo}-${arch}.conf"
+pacman_config="@pkgdatadir@/pacman.conf.d/${repo}.conf"
+if [[ -f @pkgdatadir@/pacman.conf.d/${repo}-${arch}.conf ]]; then
+ pacman_config="@pkgdatadir@/pacman.conf.d/${repo}-${arch}.conf"
fi
-makepkg_config="@pkgdatadir@/makepkg-${arch}.conf"
-if [[ -f @pkgdatadir@/makepkg-${repo}-${arch}.conf ]]; then
- makepkg_config="@pkgdatadir@/makepkg-${repo}-${arch}.conf"
+makepkg_config="@pkgdatadir@/makepkg.conf.d/${arch}.conf"
+if [[ -f @pkgdatadir@/makepkg.conf.d/${repo}-${arch}.conf ]]; then
+ makepkg_config="@pkgdatadir@/makepkg.conf.d/${repo}-${arch}.conf"
fi
usage() {
@@ -54,7 +74,7 @@ while getopts 'hcr:' arg; do
esac
done
-check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME,PKGEXT
+check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME "${BASH_SOURCE[0]}" "$@"
if [ "${arch}" = "x86_64" ]; then
cache_dir=''