summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2006-02-06 01:44:50 +0000
committerAndreas Gruenbacher <agruen@suse.de>2006-02-06 01:44:50 +0000
commitf481c3c11dfaea24ba1c429f73ad60b3657d4c80 (patch)
treecc05f2ca251070714e23fcaa63a757af00104f7e /test
parent88e349a35db92b49081ab16509d5935bc21721c6 (diff)
downloadquilt-f481c3c11dfaea24ba1c429f73ad60b3657d4c80.tar.gz
- bin/patch-wrapper.in: A wrapper to GNU patch that recognizes the
most common options and mimics GNU patch's behavior and output, and creates the quilt metadata as if quilt push was used to apply the patch. When options are used that this wrapper does not recognize, GNU patch is used directly, and no quilt metadata will get created. - lib/backup-files.c: Don't fail if a directory specified with -B does not exist.
Diffstat (limited to 'test')
-rw-r--r--test/patch-wrapper.test74
1 files changed, 74 insertions, 0 deletions
diff --git a/test/patch-wrapper.test b/test/patch-wrapper.test
new file mode 100644
index 0000000..32c80bb
--- /dev/null
+++ b/test/patch-wrapper.test
@@ -0,0 +1,74 @@
+$ rm -rf d
+$ mkdir -p d/somewhere
+$ cd d
+
+$ cat > foo.orig
+< 1
+<
+< 3
+<
+< 5
+$ sed -e 's/3/3a/' foo.orig > foo
+$ diff -u foo.orig foo > foo.diff
+$ mv foo.orig foo
+
+$ patch-wrapper -s -p0 < foo.diff
+$ quilt pop -q
+> Removing patch patches/foo.diff
+> No patches applied
+$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
+
+$ patch-wrapper --backup -B xxx/ -s -p0 < foo.diff
+$ find xxx -type f
+> xxx/foo
+$ quilt pop -q
+> Removing patch patches/foo.diff
+> No patches applied
+$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
+
+$ patch-wrapper -s -p0 -i foo.diff
+$ quilt pop -q
+> Removing patch patches/foo.diff
+> No patches applied
+$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
+
+$ patch-wrapper -p0 < foo.diff
+> patching file foo
+$ quilt pop -q
+> Removing patch patches/foo.diff
+> No patches applied
+$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
+
+$ mv foo.diff somewhere/
+$ patch-wrapper -p0 < somewhere/foo.diff
+> patching file foo
+$ quilt pop -q
+> Removing patch patches/somewhere/foo.diff
+> No patches applied
+$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
+
+$ patch-wrapper -p0 -i somewhere/foo.diff
+> patching file foo
+$ quilt pop -q
+> Removing patch patches/somewhere/foo.diff
+> No patches applied
+$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
+
+$ sed -e 's/5/5b/' foo > foo.new
+$ mv foo.new foo
+$ patch-wrapper -p0 < somewhere/foo.diff
+> patching file foo
+> Hunk #1 succeeded at 1 with fuzz 1.
+$ cat foo.orig
+> 1
+>
+> 3
+>
+> 5b
+$ quilt pop -q
+> Removing patch patches/somewhere/foo.diff
+> No patches applied
+$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
+
+$ cd ..
+$ rm -rf d