summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2015-02-18 13:05:10 +0100
committerJean Delvare <jdelvare@suse.de>2015-02-18 13:05:10 +0100
commit8fe2ce95f77a39ecf7e0fc567534bf2349259e22 (patch)
tree9fd42d15d297e92d46f693ae1141aa3c3548e5bb /test
parent86a58469ae2d2d60d84cb6fb487d2c946158ef67 (diff)
downloadquilt-8fe2ce95f77a39ecf7e0fc567534bf2349259e22.tar.gz
refresh: Do not remove symlinks
Change the core behavior of quilt to not remove symlinks to the patch files. Historical notes: This is an 6 year old patch that is still actively used for the Yocto Project and others. http://lists.nongnu.org/archive/html/quilt-dev/2008-01/msg00004.html Revised again here: http://comments.gmane.org/gmane.comp.handhelds.openembedded/34224 [Edited by Jean Delvare: removed a compatibility option, we'll introduce it only if users ask for it. Also cleaned up the test case a bit.] Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'test')
-rw-r--r--test/symlink.test53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/symlink.test b/test/symlink.test
new file mode 100644
index 0000000..9e5e797
--- /dev/null
+++ b/test/symlink.test
@@ -0,0 +1,53 @@
+ $ mkdir patches
+
+# quilt should not remove symlinks to patch files
+ $ echo foo > foo
+ $ quilt new test.diff
+ > Patch patches/test.diff is now on top
+
+ $ quilt add foo
+ > File foo added to patch patches/test.diff
+
+ $ echo "foo changed" > foo
+ $ quilt refresh
+ > Refreshed patch patches/test.diff
+
+# Setup a symlink
+ $ mv patches/test.diff .
+ $ ln -s ../test.diff patches/test.diff
+ $ readlink patches/test.diff
+ > ../test.diff
+
+# Test the refresh
+ $ echo "foo changed 2" > foo
+ $ quilt refresh --no-index -p ab
+ > Refreshed patch patches/test.diff
+
+ $ readlink patches/test.diff
+ > ../test.diff
+
+# Test the refresh --backup
+ $ echo "foo changed 3" > foo
+ $ quilt refresh --backup --no-index -p ab
+ > Refreshed patch patches/test.diff
+
+ $ readlink patches/test.diff
+ > ../test.diff
+
+ $ cat patches/test.diff
+ > --- a/foo
+ > +++ b/foo
+ > @@ -1 +1 @@
+ > -foo
+ > +foo changed 3
+
+ $ readlink patches/test.diff~
+ $ echo %{?}
+ > 1
+
+ $ cat patches/test.diff~
+ > --- a/foo
+ > +++ b/foo
+ > @@ -1 +1 @@
+ > -foo
+ > +foo changed 2