From e1a51770b26f3b36f24dc5668253eda23a8c8bcf Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Wed, 18 May 2022 02:24:58 +0200 Subject: [PATCH] make: split out config files into conf directory --- Makefile | 44 +++++++++---------- checkpkg.in | 2 +- commitpkg.in | 2 +- .../makepkg/x86_64.conf | 0 .../makepkg/x86_64_v3.conf | 0 .../pacman/extra-x86_64_v3.conf | 0 pacman-extra.conf => config/pacman/extra.conf | 0 .../pacman/gnome-unstable.conf | 0 .../pacman/kde-unstable.conf | 0 .../pacman/multilib-staging.conf | 0 .../pacman/multilib-testing.conf | 0 .../pacman/multilib.conf | 0 .../pacman/staging-x86_64_v3.conf | 0 .../pacman/staging.conf | 0 .../pacman/testing-x86_64_v3.conf | 0 .../pacman/testing.conf | 0 .../setarch-aliases.d}/x86_64_v3 | 0 diffpkg.in | 2 +- rebuildpkgs.in | 2 +- 19 files changed, 26 insertions(+), 26 deletions(-) rename makepkg-x86_64.conf => config/makepkg/x86_64.conf (100%) rename makepkg-x86_64_v3.conf => config/makepkg/x86_64_v3.conf (100%) rename pacman-extra-x86_64_v3.conf => config/pacman/extra-x86_64_v3.conf (100%) rename pacman-extra.conf => config/pacman/extra.conf (100%) rename pacman-gnome-unstable.conf => config/pacman/gnome-unstable.conf (100%) rename pacman-kde-unstable.conf => config/pacman/kde-unstable.conf (100%) rename pacman-multilib-staging.conf => config/pacman/multilib-staging.conf (100%) rename pacman-multilib-testing.conf => config/pacman/multilib-testing.conf (100%) rename pacman-multilib.conf => config/pacman/multilib.conf (100%) rename pacman-staging-x86_64_v3.conf => config/pacman/staging-x86_64_v3.conf (100%) rename pacman-staging.conf => config/pacman/staging.conf (100%) rename pacman-testing-x86_64_v3.conf => config/pacman/testing-x86_64_v3.conf (100%) rename pacman-testing.conf => config/pacman/testing.conf (100%) rename {setarch-aliases.d => config/setarch-aliases.d}/x86_64_v3 (100%) diff --git a/Makefile b/Makefile index 128c298..0213482 100644 --- a/Makefile +++ b/Makefile @@ -26,23 +26,9 @@ BINPROGS = \ sogrep BINPROGS := $(addprefix $(BUILDDIR)/bin/,$(BINPROGS)) -CONFIGFILES = \ - makepkg-x86_64.conf \ - makepkg-x86_64_v3.conf \ - pacman-extra.conf \ - pacman-extra-x86_64_v3.conf \ - pacman-testing.conf \ - pacman-testing-x86_64_v3.conf \ - pacman-staging.conf \ - pacman-staging-x86_64_v3.conf \ - pacman-multilib.conf \ - pacman-multilib-testing.conf \ - pacman-multilib-staging.conf \ - pacman-kde-unstable.conf \ - pacman-gnome-unstable.conf - -SETARCH_ALIASES = \ - x86_64_v3 +MAKEPKG_CONFIGS=$(wildcard config/makepkg/*) +PACMAN_CONFIGS=$(wildcard config/pacman/*) +SETARCH_ALIASES = $(wildcard config/setarch-aliases.d/*) COMMITPKG_LINKS = \ extrapkg \ @@ -102,6 +88,18 @@ binprogs: $(BINPROGS) completion: $(COMPLETIONS) man: $(MANS) + +ifneq ($(wildcard pacman-*.conf),) + $(error Legacy pacman config file found: $(wildcard pacman-*.conf) - please migrate to config/pacman/*) +endif +ifneq ($(wildcard makepkg-*.conf),) + $(error Legacy makepkg config files found: $(wildcard makepkg-*.conf) - please migrate to config/makepkg/*) +endif +ifneq ($(wildcard setarch-aliases.d/*),) + $(error Legacy setarch aliase found: $(wildcard setarch-aliases.d/*) - please migrate to config/setarch-aliases.d/*) +endif + + edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g" define buildInScript @@ -128,8 +126,9 @@ install: all install -dm0755 $(DESTDIR)$(PREFIX)/bin install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin - install -m0644 ${CONFIGFILES} $(DESTDIR)$(PREFIX)/share/devtools - for a in ${SETARCH_ALIASES}; do install -m0644 setarch-aliases.d/$$a $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d; done + 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 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 for l in ${CROSSREPOMOVE_LINKS}; do ln -sf crossrepomove $(DESTDIR)$(PREFIX)/bin/$$l; done @@ -144,8 +143,9 @@ install: all uninstall: for f in $(notdir $(BINPROGS)); do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done - for f in ${CONFIGFILES}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/$$f; done - for f in ${SETARCH_ALIASES}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d/$$f; done + for conf in ${MAKEPKG_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done + for conf in ${PACMAN_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/pacman-$${conf##*/}; done + for f in $(notdir $(SETARCH_ALIASES)); do rm -f $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d/$$f; done for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${CROSSREPOMOVE_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done @@ -170,7 +170,7 @@ dist: upload: scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/ -check: $(BINPROGS) $(BUILDDIR)/contrib/completion/bash/devtools makepkg-x86_64.conf PKGBUILD.proto +check: $(BINPROGS) $(BUILDDIR)/contrib/completion/bash/devtools config/makepkg/x86_64.conf PKGBUILD.proto shellcheck $^ .PHONY: all completion man clean install uninstall dist upload check tag diff --git a/checkpkg.in b/checkpkg.in index aa862c5..059f752 100644 --- a/checkpkg.in +++ b/checkpkg.in @@ -63,7 +63,7 @@ done # Source makepkg.conf; fail if it is not found if [[ -r "${MAKEPKG_CONF}" ]]; then - # shellcheck source=makepkg-x86_64.conf + # shellcheck source=config/makepkg/x86_64.conf source "${MAKEPKG_CONF}" else die "${MAKEPKG_CONF} not found!" diff --git a/commitpkg.in b/commitpkg.in index e0da32d..31adcd6 100644 --- a/commitpkg.in +++ b/commitpkg.in @@ -6,7 +6,7 @@ m4_include(lib/common.sh) # Source makepkg.conf; fail if it is not found if [[ -r '/etc/makepkg.conf' ]]; then - # shellcheck source=makepkg-x86_64.conf + # shellcheck source=config/makepkg/x86_64.conf source '/etc/makepkg.conf' else die '/etc/makepkg.conf not found!' diff --git a/makepkg-x86_64.conf b/config/makepkg/x86_64.conf similarity index 100% rename from makepkg-x86_64.conf rename to config/makepkg/x86_64.conf diff --git a/makepkg-x86_64_v3.conf b/config/makepkg/x86_64_v3.conf similarity index 100% rename from makepkg-x86_64_v3.conf rename to config/makepkg/x86_64_v3.conf diff --git a/pacman-extra-x86_64_v3.conf b/config/pacman/extra-x86_64_v3.conf similarity index 100% rename from pacman-extra-x86_64_v3.conf rename to config/pacman/extra-x86_64_v3.conf diff --git a/pacman-extra.conf b/config/pacman/extra.conf similarity index 100% rename from pacman-extra.conf rename to config/pacman/extra.conf diff --git a/pacman-gnome-unstable.conf b/config/pacman/gnome-unstable.conf similarity index 100% rename from pacman-gnome-unstable.conf rename to config/pacman/gnome-unstable.conf diff --git a/pacman-kde-unstable.conf b/config/pacman/kde-unstable.conf similarity index 100% rename from pacman-kde-unstable.conf rename to config/pacman/kde-unstable.conf diff --git a/pacman-multilib-staging.conf b/config/pacman/multilib-staging.conf similarity index 100% rename from pacman-multilib-staging.conf rename to config/pacman/multilib-staging.conf diff --git a/pacman-multilib-testing.conf b/config/pacman/multilib-testing.conf similarity index 100% rename from pacman-multilib-testing.conf rename to config/pacman/multilib-testing.conf diff --git a/pacman-multilib.conf b/config/pacman/multilib.conf similarity index 100% rename from pacman-multilib.conf rename to config/pacman/multilib.conf diff --git a/pacman-staging-x86_64_v3.conf b/config/pacman/staging-x86_64_v3.conf similarity index 100% rename from pacman-staging-x86_64_v3.conf rename to config/pacman/staging-x86_64_v3.conf diff --git a/pacman-staging.conf b/config/pacman/staging.conf similarity index 100% rename from pacman-staging.conf rename to config/pacman/staging.conf diff --git a/pacman-testing-x86_64_v3.conf b/config/pacman/testing-x86_64_v3.conf similarity index 100% rename from pacman-testing-x86_64_v3.conf rename to config/pacman/testing-x86_64_v3.conf diff --git a/pacman-testing.conf b/config/pacman/testing.conf similarity index 100% rename from pacman-testing.conf rename to config/pacman/testing.conf diff --git a/setarch-aliases.d/x86_64_v3 b/config/setarch-aliases.d/x86_64_v3 similarity index 100% rename from setarch-aliases.d/x86_64_v3 rename to config/setarch-aliases.d/x86_64_v3 diff --git a/diffpkg.in b/diffpkg.in index 840567a..963f2c6 100644 --- a/diffpkg.in +++ b/diffpkg.in @@ -92,7 +92,7 @@ fi # Source makepkg.conf; fail if it is not found if [[ -r "${MAKEPKG_CONF}" ]]; then - # shellcheck source=makepkg-x86_64.conf + # shellcheck source=config/makepkg/x86_64.conf source "${MAKEPKG_CONF}" else die "${MAKEPKG_CONF} not found!" diff --git a/rebuildpkgs.in b/rebuildpkgs.in index 5091dc2..164bf08 100644 --- a/rebuildpkgs.in +++ b/rebuildpkgs.in @@ -22,7 +22,7 @@ fi # Source makepkg.conf; fail if it is not found if [[ -r '/etc/makepkg.conf' ]]; then - # shellcheck source=makepkg-x86_64.conf + # shellcheck source=config/makepkg/x86_64.conf source '/etc/makepkg.conf' else die '/etc/makepkg.conf not found!'