Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/makerepropkg.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/makerepropkg.in')
-rw-r--r--src/makerepropkg.in19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/makerepropkg.in b/src/makerepropkg.in
index c58a923..398d4af 100644
--- a/src/makerepropkg.in
+++ b/src/makerepropkg.in
@@ -6,8 +6,12 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
-m4_include(lib/common.sh)
-m4_include(lib/archroot.sh)
+_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
+# shellcheck source=src/lib/common.sh
+source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
+# shellcheck source=src/lib/archroot.sh
+source "${_DEVTOOLS_LIBRARY_DIR}"/lib/archroot.sh
+
source /usr/share/makepkg/util/config.sh
source /usr/share/makepkg/util/message.sh
@@ -93,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
}
@@ -119,6 +125,9 @@ OPTIONS
__EOF__
}
+# save all args for check_root
+orig_args=("$@")
+
while getopts 'dM:c:l:h' arg; do
case "$arg" in
d) diffoscope=1 ;;
@@ -131,7 +140,7 @@ while getopts 'dM:c:l:h' arg; do
done
shift $((OPTIND - 1))
-check_root
+check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
[[ -f PKGBUILD ]] || { error "No PKGBUILD in current directory."; exit 1; }
@@ -224,7 +233,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