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:
authorToolybird <toolybird@tuta.io>2023-05-24 16:31:57 +1000
committerLevente Polyak <anthraxx@archlinux.org>2023-05-26 01:06:14 +0200
commit71cb9e97bb584bcb7142abde715237fb8d0fa69e (patch)
treefe4cad81e4ad96f356b5ae8c50a57562dd73e9b3 /src/makerepropkg.in
parent1b808b8e322effe8ca31a9c6d5be29e8a44e16e6 (diff)
fix(archroot): preserve original args for check_root before discarding
arch-nspawn, mkarchroot, makerepropkg all call "shift" after getopts processing. Save the original args and pass on to check_root to prevent options being discarded. Fixes 41d4624879d01b1269d6af9c1440592a15ad7784 Fixes #149 Signed-off-by: Toolybird <toolybird@tuta.io> Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'src/makerepropkg.in')
-rw-r--r--src/makerepropkg.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/makerepropkg.in b/src/makerepropkg.in
index 61ee9db..398d4af 100644
--- a/src/makerepropkg.in
+++ b/src/makerepropkg.in
@@ -125,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 ;;
@@ -137,7 +140,7 @@ while getopts 'dM:c:l:h' arg; do
done
shift $((OPTIND - 1))
-check_root "" "${BASH_SOURCE[0]}" "$@"
+check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
[[ -f PKGBUILD ]] || { error "No PKGBUILD in current directory."; exit 1; }