makechrootpkg: Look harder for -R argument

We shouldn't be in the business of reparsing makepkg's arguments, but
since we have to treat the case of repackaging separately, do a better
job of trying to find signs of it happening. This change lets you pass
the longopt, --repackage, or multiple shortopts such as -RA, and still
get the intended effect.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
This commit is contained in:
Dave Reisner 2013-10-20 16:17:43 -04:00 committed by Pierre Schmitz
parent e3cf64ad2f
commit 9974309cee
1 changed files with 7 additions and 5 deletions

View File

@ -104,11 +104,13 @@ fi
makepkg_args="$makepkg_args ${*:$OPTIND}" makepkg_args="$makepkg_args ${*:$OPTIND}"
# See if -R was passed to makepkg # See if -R was passed to makepkg
for arg in ${*:$OPTIND}; do for arg in "${@:OPTIND}"; do
if [[ $arg = -R ]]; then case ${arg%%=*} in
repack=true -*R*|--repackage)
break repack=true
fi break 2
;;
esac
done done
if [[ -n $SUDO_USER ]]; then if [[ -n $SUDO_USER ]]; then