Hi,

it obviously wasn't a good idea to inline the patch into
the mail body since the mail address obfuscation caused
some unfortunate changes.

I'll try it as attachement this time.

Bye,

-Andreas-


Index: quilt/scripts/patchfns.in
===================================================================
--- quilt/scripts/patchfns.in.orig      2009-01-31 03:28:06.000000000 +0100
+++ quilt/scripts/patchfns.in   2010-01-21 10:11:52.000000000 +0100
@@ -37,13 +37,6 @@ then
        source "$QUILTRC"
 fi
 
-# Add default arguments for this command
-if [ -n "$QUILT_COMMAND" ]; then
-       args="QUILT_$(echo $QUILT_COMMAND | tr a-z A-Z)_ARGS"
-       eval set -- ${!args} \"\...@\"
-       unset args
-fi
-
 # ========================================================
 
 #declare -a exit_handlers
@@ -969,6 +962,34 @@ quilt_command()
        QUILT_COMMAND="" bash $BASH_OPTS -c "${SUBDIR:+cd $SUBDIR;} . 
$QUILT_DIR/$command" "quilt $command" "$@"
 }
 
+expand_conditional_opts()
+{
+    local dir=$1
+    local optstring=$2
+    local outopts=""
+
+    IFS='|' read -ra allopts <<< "$optstring"
+
+    for o in "${allop...@]}"; do
+       # Strip leading and trailing blanks
+       o=$(echo $o)
+       # If there is no : in the string the options are unconditional
+       if [[ $o != *:* ]]; then
+           outopts+=" "
+           outopts+=$o
+           continue
+       fi
+       local dirpat=${o%%:[^:]*}
+       local opts=${o##[^:]*:}
+
+       if [[ $dir == $dirpat ]]; then
+           outopts+=" "
+           outopts+=$opts
+       fi
+    done
+    echo ${outopts}
+}
+
 #
 # If the working directory does not contain a $QUILT_PATCHES directory,
 # quilt searches for its base directory up the directory tree. If no
@@ -1005,6 +1026,20 @@ then
     unset basedir down
 fi
 
+SRCDIR=$(basename $PWD)
+
+QUILT_DIFF_ARGS=$(expand_conditional_opts "${SRCDIR}" "${QUILT_DIFF_ARGS}")
+QUILT_REFRESH_ARGS=$(expand_conditional_opts "${SRCDIR}" 
"${QUILT_REFRESH_ARGS}")
+
+unset SRCDIR
+
+# Add default arguments for this command
+if [ -n "$QUILT_COMMAND" ]; then
+    args="QUILT_$(echo $QUILT_COMMAND | tr a-z A-Z)_ARGS"
+    eval set -- ${!args} \"\...@\"
+    unset args
+fi
+
 : ${QUILT_SERIES:=series}
 
 if [ "${QUILT_SERIES:0:1}" = / ]
_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to