quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH] Handle reverted patches in spec files


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] Handle reverted patches in spec files
Date: Sun, 20 Jun 2010 21:09:44 +0200
User-agent: KMail/1.12.4 (Linux/2.6.32.12-0.7-pae; KDE/4.3.5; i686; ; )

Let inspect (and thus quilt setup) handle reversed patches
in spec files.
---
See https://bugzilla.novell.com/show_bug.cgi?id=615065

 quilt/scripts/inspect.in |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

--- a/quilt/scripts/inspect.in
+++ b/quilt/scripts/inspect.in
@@ -173,16 +173,19 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
                return 1
        }
 
-       # Extract a command line option with argument from the command line
+       # Extract a command line option with or without argument
        cmdline_option() {
-               local letter=$1
+               local letter=$1 no_arg=$2
                shift
 
                while [ $# -ne 0 ]
                do
                        if [ "${1:0:2}" = -$letter ]
                        then
-                               [ "$1" = -$letter ] && set -- "$1$2"
+                               if [ -z "$no_arg" ]
+                               then
+                                       [ "$1" = -$letter ] && set -- "$1$2"
+                               fi
                                echo $1
                                break
                        fi
@@ -196,6 +199,12 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
                [ "$1" != -p1 ] && echo $1
        }
 
+       # Extract the -R option from the command line
+       reverse_option() {
+               set -- $(cmdline_option R no_arg "$@")
+               echo $1
+       }
+
        patch_opt_d() {
                local subdir=$(cmdline_option d "$@")
                [ -z "$subdir" ] || echo "${subdir:2}"
@@ -275,7 +284,7 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
                        dir=${dir/$RPM_BUILD_DIR}
                        dir=${dir##/}
                        echo "${0##*/} ${dir:-.} $unpackfile" \
-                            $(strip_option "$@") >&3
+                            $(strip_option "$@") $(reverse_option "$@") >&3
                        ;;
                tar)
                        echo -n t >&4

-- 
Jean Delvare
Suse L3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]