summaryrefslogtreecommitdiff
path: root/archbuild.in
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2019-05-20 14:10:35 -0400
committerErich Eckner <git@eckner.net>2019-06-16 14:26:44 +0200
commitb2303fbececd4aa117f385dca376934364117b16 (patch)
treecdd6ed1ac524fea45222404ed515dd91d58ac8b7 /archbuild.in
parent5e80e8edb5a0186fd9e026d7ba100dbe977b744b (diff)
downloaddevtools32-b2303fbececd4aa117f385dca376934364117b16.tar.xz
archbuild: prefer repo/arch-specific configs if they exist
When mixing and matching different repos and architectures not present in mainline archlinux, it is sometimes desirable to set up differing presets with more granularity than devtools currently allows. One example of this is when building for architectures that are only supported by another project -- in order to coexist on a mainline archlinux host, a different mirrorlist needs to be used.
Diffstat (limited to 'archbuild.in')
-rw-r--r--archbuild.in17
1 files changed, 13 insertions, 4 deletions
diff --git a/archbuild.in b/archbuild.in
index 163a108..4ddc097 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -20,6 +20,15 @@ fi
chroots='/var/lib/archbuild'
clean_first=false
+pacman_config=@pkgdatadir@/pacman-${repo}.conf
+if [[ -f ${pacman_config%.conf}-${arch}.conf ]]; then
+ pacman_config=${pacman_config%.conf}-${arch}.conf
+fi
+makepkg_config=@pkgdatadir@/makepkg-${arch}.conf
+if [[ -f ${makepkg_config%-${arch}.conf}-${repo}-${arch}.conf ]]; then
+ makepkg_config=${makepkg_config%-${arch}.conf}-${repo}-${arch}.conf
+fi
+
usage() {
echo "Usage: $cmd [options] -- [makechrootpkg args]"
echo ' -h This help'
@@ -61,15 +70,15 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
rm -rf --one-file-system "${chroots}/${repo}-${arch}"
mkdir -p "${chroots}/${repo}-${arch}"
setarch "${arch}" mkarchroot \
- -C "@pkgdatadir@/pacman-${repo}.conf" \
- -M "@pkgdatadir@/makepkg-${arch}.conf" \
+ -C "${pacman_config}" \
+ -M "${makepkg_config}" \
"${chroots}/${repo}-${arch}/root" \
"${base_packages[@]}" || abort
else
lock 9 "${chroots}/${repo}-${arch}/root.lock" "Locking clean chroot"
arch-nspawn \
- -C "@pkgdatadir@/pacman-${repo}.conf" \
- -M "@pkgdatadir@/makepkg-${arch}.conf" \
+ -C "${pacman_config}" \
+ -M "${makepkg_config}" \
"${chroots}/${repo}-${arch}/root" \
pacman -Syu --noconfirm || abort
fi