quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] [PATCH 2/2] refresh: Always preserve modification time


From: Jean Delvare
Subject: [Quilt-dev] [PATCH 2/2] refresh: Always preserve modification time
Date: Wed, 18 Feb 2015 14:27:57 +0100

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




reply via email to

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