From e0307c7925168f58c3ec5077ea9915db81d4f62a Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Fri, 30 Dec 2022 16:49:58 +0100 Subject: conf: move makepkg and pacman config into separate conf.d dirs We have used the datadir like a kitchen sink, lets clean up a bit by having a better and well structured layout. Put makepkg and pacman configs in separate directories: makepkg.conf.d and pacman.conf.d. --- src/archbuild.in | 12 ++++++------ src/makerepropkg.in | 6 ++++-- src/offload-build.in | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/archbuild.in b/src/archbuild.in index 3367011..a7e4231 100644 --- a/src/archbuild.in +++ b/src/archbuild.in @@ -46,13 +46,13 @@ 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() { diff --git a/src/makerepropkg.in b/src/makerepropkg.in index e0a5b85..f310c69 100644 --- a/src/makerepropkg.in +++ b/src/makerepropkg.in @@ -97,7 +97,9 @@ get_makepkg_conf() { return 1 fi msg2 "using makepkg.conf from ${fname}" - bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}" + if ! bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg.conf.d/${arch}.conf" > "${makepkg_conf}"; then + bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}" + fi return 0 } @@ -228,7 +230,7 @@ elif [[ "${BUILDTOOL}" = devtools ]] && get_makepkg_conf "${BUILDTOOL}-${BUILDTO # fallback to current makepkg.conf else warning "Unknown buildtool (${BUILDTOOL}-${BUILDTOOLVER}), using fallback" - makepkg_conf=@pkgdatadir@/makepkg-${CARCH}.conf + makepkg_conf=@pkgdatadir@/makepkg.conf.d/${CARCH}.conf fi printf '%s\n' "${allpkgfiles[@]}" | mkarchroot -M "${makepkg_conf}" -U "${archroot_args[@]}" "${namespace}/root" - || exit 1 diff --git a/src/offload-build.in b/src/offload-build.in index 9e9d71e..027bad3 100644 --- a/src/offload-build.in +++ b/src/offload-build.in @@ -102,9 +102,9 @@ mapfile -t files < <( printf "\t%s\n" "$temp"/* } >&2 && makepkg_user_config="${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" && - makepkg_config="/usr/share/devtools/makepkg-'"${arch}"'.conf" && - if [[ -f /usr/share/devtools/makepkg-'"${repo}"'-'"${arch}"'.conf ]]; then - makepkg_config="/usr/share/devtools/makepkg-'"${repo}"'-'"${arch}"'.conf" + makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${arch}"'.conf" && + if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then + makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf" fi && makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist && printf "%s\n" "${temp}/PKGBUILD" -- cgit v1.2.3-70-g09d2