quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] import improvement, take two


From: Holger Eitzenberger
Subject: [Quilt-dev] import improvement, take two
Date: Thu, 21 Dec 2006 17:35:58 +0100

 usage()
 {
-       printf $"Usage: quilt import [-p num] [-P patch] [-f] [-d {o|a|n}] 
patchfile ...\n"
+       printf $"Usage: quilt import [-p num] [-P patch|dir] [-f] [-d {o|a|n}] 
patchfile ...\n"
        if [ x$1 = x-h ]
        then
                printf $"
@@ -29,9 +29,10 @@ current top patch, and must be pushed af
 -p num
        Number of directory levels to strip when applying (default=1)
 
--P patch
-       Patch filename to use inside quilt. This option can only be
-       used when importing a single patch.
+-P patch|dir
+    Patch filename to use inside quilt. This option can only be used when
+    importing a single patch.  If you specify a directory the patch will
+    be added below this directory.  The original name will then be used.
 
 -f     Overwite/update existing patches.
 
@@ -128,10 +129,15 @@ do
         esac
 done
 
-if [ $# -gt 1 -a -n "$opt_patch" ]
-then
-       printf $"Option \`-P' can only be used when importing a single patch\n" 
>&2
-       exit 1
+if [ -n "$opt_patch" ]; then
+       if [ $# -gt 1 ]; then
+               printf $"Option \`-P' can only be used when importing a single 
patch\n" >&2
+               exit 1
+       fi
+
+       if [ -d "${QUILT_PATCHES:+$QUILT_PATCHES/}$opt_patch" ]; then
+               opt_patch="$opt_patch/${1##*/}"
+       fi
 fi
 
 [ -n "$opt_strip" ] && patch_args="-p$opt_strip"




reply via email to

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