File setup-support-reverse-patch.patch of Package quilt

From: Jean Delvare <jdelvare@suse.de>
Subject: Handle reverted patches in spec files
References: bnc#615065

Let inspect (and thus quilt setup) handle reversed patches
in spec files.
---
 quilt/scripts/inspect.in |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

--- quilt-0.48.orig/quilt/scripts/inspect.in
+++ quilt-0.48/quilt/scripts/inspect.in
@@ -185,6 +185,18 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
 		fi
 	}
 
+	# Extract the -R option from the command line
+	reverse_option() {
+		while [ $# -ne 0 -a "$1" != -R ]
+		do
+			shift
+		done
+		if [ "$1" = -R ]
+		then
+			echo $1
+		fi
+	}
+
 	patch_input_file() {
 		while [ $# -gt 0 ]; do
 			case "$1" in
@@ -244,7 +256,7 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
 		patch)
 			echo -n p >&4
 			echo "${0##*/} ${dir:-.} $unpackfile" \
-			     $(strip_option "$@") >&3
+			     $(strip_option "$@") $(reverse_option "$@") >&3
 			;;
 		tar)
 			echo -n t >&4
openSUSE Build Service is sponsored by