summaryrefslogtreecommitdiffstats
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-10-19 22:06:31 +0200
committerDave Reisner <dreisner@archlinux.org>2014-10-19 22:48:03 +0200
commitbf7dc83bab4f002a29866fd30b1574b6fbca36aa (patch)
treeaad5aee7fe5d0840df6109eb86c42555cd9e4933 /makechrootpkg.in
parentcae954ddb5d35877eaaea588b84f932863714568 (diff)
downloaddevtools-bf7dc83bab4f002a29866fd30b1574b6fbca36aa.tar.gz
devtools-bf7dc83bab4f002a29866fd30b1574b6fbca36aa.tar.xz
save and reuse original argv when auto-elevating
Fixes FS#42277.
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in6
1 files changed, 4 insertions, 2 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index a340116..8957974 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -66,6 +66,8 @@ usage() {
exit 1
}
+orig_argv=("$@")
+
while getopts 'hcur:I:l:nTD:d:' arg; do
case "$arg" in
h) usage ;;
@@ -81,10 +83,10 @@ while getopts 'hcur:I:l:nTD:d:' arg; do
esac
done
-check_root "$0" "$@"
-
[[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]] && die 'This must be run in a directory containing a PKGBUILD.'
+check_root "$0" "${orig_argv[@]}"
+
# Canonicalize chrootdir, getting rid of trailing /
chrootdir=$(readlink -e "$passeddir")
[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir"