summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt.changes5
-rw-r--r--quilt/scripts/patchfns.in10
-rw-r--r--test/colon-in-patch-name.test47
3 files changed, 60 insertions, 2 deletions
diff --git a/quilt.changes b/quilt.changes
index cb5f351..978d1fd 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Wed Dec 5 14:42:33 CET 2012 - bpoirier@suse.de
+
+- Fix handling of patch files with ':' in their name.
+
+-------------------------------------------------------------------
Mon Dec 3 10:29:57 CET 2012 - jdelvare@suse.de
- push: Always let the user force pushing a patch.
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index d0c426e..597ba8a 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -88,6 +88,12 @@ quote_re()
echo "$1" | sed -e 's:\([][?{(|)}^$/.+*\\]\):\\\1:g'
}
+# Quote a string for use in a globing pattern.
+quote_glob()
+{
+ echo "$1" | sed -e 's:\([][*?\\]\):\\\1:g'
+}
+
patch_file_name()
{
echo "$QUILT_PATCHES/$1"
@@ -650,8 +656,8 @@ files_in_patch()
if [ -d "$path" ]
then
find "$path" -type f \
- -a ! -path "$path/.timestamp" |
- sed -e "s:$path/::"
+ -a ! -path "$(quote_glob "$path")/.timestamp" |
+ sed -e "s/$(quote_bre "$path")\///"
fi
}
diff --git a/test/colon-in-patch-name.test b/test/colon-in-patch-name.test
new file mode 100644
index 0000000..840bd5e
--- /dev/null
+++ b/test/colon-in-patch-name.test
@@ -0,0 +1,47 @@
+$ mkdir patches
+
+$ quilt new "patch_with:strange[name]"
+> Patch patches/patch_with:strange[name] is now on top
+
+$ echo foo > foo
+$ quilt add foo
+> File foo added to patch patches/patch_with:strange[name]
+
+$ quilt files
+> foo
+
+$ echo bar > foo
+$ quilt diff -p ab -P "patch_with:strange[name]"
+> Index: b/foo
+> ===================================================================
+> --- a/foo
+> +++ b/foo
+> @@ -1 +1 @@
+> -foo
+> +bar
+
+$ quilt refresh -p ab
+> Refreshed patch patches/patch_with:strange[name]
+
+$ quilt applied
+> patches/patch_with:strange[name]
+
+$ quilt pop -q
+> Removing patch patches/patch_with:strange[name]
+> No patches applied
+
+$ quilt next
+> patches/patch_with:strange[name]
+
+$ quilt push -q "patch_with:strange[name]"
+> Applying patch patches/patch_with:strange[name]
+> Now at patch patches/patch_with:strange[name]
+
+$ quilt rename "another:strange(name)"
+> Patch patches/patch_with:strange[name] renamed to patches/another:strange(name)
+
+$ quilt series
+> patches/another:strange(name)
+
+$ quilt remove foo
+> File foo removed from patch patches/another:strange(name)