summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-04-01 10:54:20 +0200
committerErich Eckner <git@eckner.net>2022-12-08 12:57:22 +0100
commitae1423122657562d2ef1f28394684d8fae113539 (patch)
treee34f9d59f7a0436837b38e6217d2890a3c253cd5
parent4b5a47587c1d2d701ed99f59e0987fb306be7dbd (diff)
downloaddevtools-ae1423122657562d2ef1f28394684d8fae113539.tar.xz
generate separate config file for i686 and x86_64
-rw-r--r--Makefile17
-rw-r--r--src/arch-nspawn.in4
2 files changed, 19 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9b4e6ba..0229c5c 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,14 @@ PACMAN_CONFIGS=$(wildcard config/pacman/*)
SETARCH_ALIASES = $(wildcard config/setarch-aliases.d/*)
MANS = $(addprefix $(BUILDDIR)/,$(patsubst %.asciidoc,%,$(wildcard doc/man/*.asciidoc)))
+GENERATED_CONFIGS = \
+ pacman-extra-i686.conf \
+ pacman-testing-i686.conf \
+ pacman-staging-i686.conf \
+ pacman-kde-unstable-i686.conf \
+ pacman-gnome-unstable-i686.conf
+GENERATED_CONFIGS := $(addprefix $(BUILDDIR)/config/,$(GENERATED_CONFIGS))
+
COMMITPKG_LINKS = \
extrapkg \
testingpkg \
@@ -48,9 +56,10 @@ BASHCOMPLETION_LINKS = \
communityco
-all: binprogs completion man
+all: binprogs configfiles completion man
binprogs: $(BINPROGS)
completion: $(COMPLETIONS)
+configfiles: $(GENERATED_CONFIGS)
man: $(MANS)
@@ -71,6 +80,11 @@ endif
edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g"
GEN_MSG = @echo "GEN $(patsubst $(BUILDDIR)/%,%,$@)"
+$(BUILDDIR)/config/pacman-%-i686.conf: config/pacman/%.conf
+ @echo "GEN $(notdir $@)"
+ @mkdir -p $(dir $@)
+ @sed 's,/mirrorlist$$,\032,' "$<" > "$@"
+
define buildInScript
$(1)/%: $(2)%.in $(LIBUTILS)
$$(GEN_MSG)
@@ -98,6 +112,7 @@ install: all
install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
for conf in ${MAKEPKG_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done
for conf in ${PACMAN_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/pacman-$${conf##*/}; done
+ for conf in ${GENERATED_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/$${conf##*/}; done
for a in ${SETARCH_ALIASES}; do install -m0644 $$a -t $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d; done
for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done
for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done
diff --git a/src/arch-nspawn.in b/src/arch-nspawn.in
index 9086684..5707eda 100644
--- a/src/arch-nspawn.in
+++ b/src/arch-nspawn.in
@@ -87,7 +87,9 @@ copy_hostconf () {
unshare --fork --pid gpg --homedir "$working_dir"/etc/pacman.d/gnupg/ --no-permission-warning --quiet --batch --import --import-options import-local-sigs "$(pacman-conf GpgDir)"/pubring.gpg >/dev/null 2>&1
pacman-key --gpgdir "$working_dir"/etc/pacman.d/gnupg/ --import-trustdb "$(pacman-conf GpgDir)" >/dev/null 2>&1
- printf 'Server = %s\n' "${host_mirrors[@]}" >"$working_dir/etc/pacman.d/mirrorlist"
+ printf 'Server = %s\n' "${host_mirrors[@]}" | \
+ tee "$working_dir/etc/pacman.d/mirrorlist" > \
+ "$working_dir/etc/pacman.d/mirrorlist32"
[[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf"
[[ -n $makepkg_conf ]] && cp "$makepkg_conf" "$working_dir/etc/makepkg.conf"