patchinstall.sh: Simplify code to enable/disable patchsets.

This commit is contained in:
Sebastian Lackner 2015-05-06 22:37:54 +02:00
parent 552d300345
commit 41f0cda558
2 changed files with 22 additions and 36 deletions

View File

@ -80,7 +80,6 @@ enable_patchlist=1
enable_autoconf=1
patchlist="/dev/null"
backend="patch"
enable=1
# Find location of patches
patchdir="$(dirname "$(readlink -f "$0")")"
@ -98,16 +97,6 @@ if test "$#" -eq 0; then
fi
while test "$#" -gt 0; do
if patch_enable "$1" "$enable"; then
shift
enable=1
continue
fi
if test "$enable" -ne 1; then
abort "Wrong use of -W commandline argument, expected patchname."
fi
case "$1" in
DESTDIR=*)
DESTDIR="${{1#*=}}"
@ -150,20 +139,24 @@ while test "$#" -gt 0; do
;;
-W)
enable=2
# Disable patchset
if ! patch_enable "$2" 2; then
abort "Wrong usage of -W commandline argument, expected patchname."
fi
shift
shift
;;
*)
abort "Unknown commandline argument $1"
exit 1
# Enable patchset
if ! patch_enable "$1" 1; then
abort "Unknown commandline argument $1."
fi
shift
;;
esac
done
if test "$enable" -ne 1; then
abort "Missing argument for -W, expected patchname."
fi
# Determine DESTDIR if not explicitly specified
if test -z "$DESTDIR" -a -f ./tools/make_requests; then
DESTDIR="$(pwd)"

View File

@ -878,7 +878,6 @@ enable_patchlist=1
enable_autoconf=1
patchlist="/dev/null"
backend="patch"
enable=1
# Find location of patches
patchdir="$(dirname "$(readlink -f "$0")")"
@ -896,16 +895,6 @@ if test "$#" -eq 0; then
fi
while test "$#" -gt 0; do
if patch_enable "$1" "$enable"; then
shift
enable=1
continue
fi
if test "$enable" -ne 1; then
abort "Wrong use of -W commandline argument, expected patchname."
fi
case "$1" in
DESTDIR=*)
DESTDIR="${1#*=}"
@ -948,20 +937,24 @@ while test "$#" -gt 0; do
;;
-W)
enable=2
# Disable patchset
if ! patch_enable "$2" 2; then
abort "Wrong usage of -W commandline argument, expected patchname."
fi
shift
shift
;;
*)
abort "Unknown commandline argument $1"
exit 1
# Enable patchset
if ! patch_enable "$1" 1; then
abort "Unknown commandline argument $1."
fi
shift
;;
esac
done
if test "$enable" -ne 1; then
abort "Missing argument for -W, expected patchname."
fi
# Determine DESTDIR if not explicitly specified
if test -z "$DESTDIR" -a -f ./tools/make_requests; then
DESTDIR="$(pwd)"