> Instead of using the -t option, I would suggest to use the -r option. You
> can thus avoid the first changd and use this in the second part:
>
> touch -r "$QUILT_PC/$patch/.timestamp" $touched_files
>
> But I also have some doubt about the way you handle the list of files:
> - it might fail with too many files modified in a single patch
> - it might fail with files containing spaces
Thanks for the review -- second try.
Bye, Mt.
Description: ensure that all mtime of modified files are equal when pushing
This is intended to avoid time skew in build systems in some cases.
.
See the discussion
http://lists.debian.org/debian-policy/2008/02/msg00030.html for more
context information.
Bug-Debian: http://bugs.debian.org/466360
Upstream-status: to be submitted
Index: quilt.git/quilt/push.in
===================================================================
--- quilt.git.orig/quilt/push.in 2012-12-28 15:37:40.000000000 +0100
+++ quilt.git/quilt/push.in 2012-12-28 15:38:41.811462394 +0100
@@ -30,7 +30,8 @@
specified number of patches. When a patch name is specified, apply
all patches up to and including the specified patch. Patch names may
include the patches/ prefix, which means that filename completion can
-be used.
+be used. The mtime of all touched files will be exactly the same to
+prevent time skews.
-a Apply all patches in the series file.
@@ -208,18 +209,24 @@
touch $QUILT_PC/$patch~refresh
fi
- if [ -e "$QUILT_PC/$patch" ]
+ if ! [ -e "$QUILT_PC/$patch" ]
then
- touch $QUILT_PC/$patch/.timestamp
- else
mkdir "$QUILT_PC/$patch"
fi
+ touch "$QUILT_PC/$patch/.timestamp"
+
+ files_in_patch "$patch" |
+ grep -v '^$' |
+ while read file
+ do
+ touch -r "$QUILT_PC/$patch/.timestamp" "$file"
+ done
if ! [ -e $patch_file ]
then
printf $"Patch %s does not exist; applied empty
patch\n" \
"$(print_patch $patch)"
- elif [ -z "$(shopt -s nullglob ; echo "$QUILT_PC/$patch/"*)" ]
+ elif [ "$(shopt -s nullglob ; echo "$QUILT_PC/$patch/"*)" ==
"$QUILT_PC/$patch/.timestamp" ]
then
printf $"Patch %s appears to be empty; applied\n" \
"$(print_patch $patch)"