In the general case, when doing a backup copy of a patch on refresh,
the modification time of the file is preserved. We should do the same
when the patch is a symbolic link.
---
 quilt/refresh.in  |    2 +-
 test/symlink.test |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

--- a/quilt/refresh.in
+++ b/quilt/refresh.in
@@ -326,7 +326,7 @@ then
 elif ( [ -z "$QUILT_BACKUP" -o ! -e "$patch_file" ] || \
        if [ -L "$patch_file" ] ; \
        then \
-          cp "$patch_file" "$patch_file~"; \
+          cp -p "$patch_file" "$patch_file~"; \
        else \
           mv "$patch_file" "$patch_file~"; \
        fi ) && \
--- a/test/symlink.test
+++ b/test/symlink.test
@@ -28,6 +28,7 @@
 
 # Test the refresh --backup
        $ echo "foo changed 3" > foo
+       $ touch -r patches/test.diff test.timeref
        $ quilt refresh --backup --no-index -p ab
        > Refreshed patch patches/test.diff
 
@@ -52,6 +53,8 @@
        > -foo
        > +foo changed 2
 
+       $ [ patches/test.diff~ -nt test.timeref ] && echo "mtimes differ"
+
 # Test the refresh when target is read-only
        $ chmod -w test.diff
        $ echo "foo changed 4" > foo

-- 
Jean Delvare
SUSE L3 Support


_______________________________________________
Quilt-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to