summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-04-01 10:54:20 +0200
committerErich Eckner <git@eckner.net>2019-12-27 21:36:58 +0100
commit8f551c24bbb5941f1eccc5a9bfd74da7edf757ad (patch)
treed0065ad46cf0a7ee83762a037e89ee49bf03d248
parent7f675d8093da80c776ed50db7adb396bf3f4d7c7 (diff)
downloaddevtools32-8f551c24bbb5941f1eccc5a9bfd74da7edf757ad.tar.xz
generate separate config file for i686 and x86_64
-rw-r--r--.gitignore1
-rw-r--r--Makefile18
-rw-r--r--arch-nspawn.in4
3 files changed, 19 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 7844219..bc9e6ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,4 @@ crossrepomove
arch-nspawn
sogrep
doc/*.1
+pacman-*-i686.conf
diff --git a/Makefile b/Makefile
index fd69a8e..431fa04 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,13 @@ BINPROGS = \
$(IN_PROGS) \
offload-build \
+GENERATED_CONFIGFILES = \
+ pacman-extra-i686.conf \
+ pacman-testing-i686.conf \
+ pacman-staging-i686.conf \
+ pacman-kde-unstable-i686.conf \
+ pacman-gnome-unstable-i686.conf
+
CONFIGFILES = \
makepkg-x86_64.conf \
pacman-extra.conf \
@@ -33,7 +40,8 @@ CONFIGFILES = \
pacman-multilib-testing.conf \
pacman-multilib-staging.conf \
pacman-kde-unstable.conf \
- pacman-gnome-unstable.conf
+ pacman-gnome-unstable.conf \
+ $(GENERATED_CONFIGFILES)
COMMITPKG_LINKS = \
extrapkg \
@@ -78,11 +86,15 @@ MANS = \
doc/find-libprovides.1
-all: $(BINPROGS) bash_completion zsh_completion man
+all: $(GENERATED_CONFIGFILES) $(BINPROGS) bash_completion zsh_completion man
man: $(MANS)
edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g"
+pacman-%-i686.conf: pacman-%.conf
+ @echo "GEN $@"
+ @sed 's,/mirrorlist$$,\032,' "$<" > "$@"
+
%: %.in Makefile lib/common.sh
@echo "GEN $@"
@$(RM) "$@"
@@ -97,7 +109,7 @@ doc/%: doc/%.asciidoc
a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage -D doc $<
clean:
- rm -f $(IN_PROGS) bash_completion zsh_completion $(MANS)
+ rm -f $(GENERATED_CONFIGFILES) $(IN_PROGS) bash_completion zsh_completion $(MANS)
install:
install -dm0755 $(DESTDIR)$(PREFIX)/bin
diff --git a/arch-nspawn.in b/arch-nspawn.in
index c227f45..04d9a8d 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -95,7 +95,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"