[debhelper-devel] [debhelper] 02/03: dh_install*: sort file lists passed to 'cp --parents -p' for reproducibility
Niels Thykier
nthykier at moszumanska.debian.org
Fri Nov 6 21:06:55 UTC 2015
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit 9cedfeafe98e5c4c09e6ba96ecce2e889c1f432a
Author: Niko Tyni <ntyni at debian.org>
Date: Mon Oct 12 15:05:06 2015 +0300
dh_install*: sort file lists passed to 'cp --parents -p' for reproducibility
The order in which the files are copied can affect directory
timestamps when copying subdirectory hierarchies.
Signed-off-by: Niels Thykier <niels at thykier.net>
---
dh_install | 6 ++++--
dh_installdocs | 4 +++-
dh_installexamples | 3 ++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dh_install b/dh_install
index 9c8d23c..769d9d4 100755
--- a/dh_install
+++ b/dh_install
@@ -214,11 +214,13 @@ foreach my $package (getpackages()) {
my $pwd=`pwd`;
chomp $pwd;
complex_doit("cd '$dir' && " .
- "find '$basename' $exclude \\( -type f -or -type l \\) -print0 | xargs -0 -I {} cp --reflink=auto --parents -dp {} $pwd/$tmp/$dest/");
+ "find '$basename' $exclude \\( -type f -or -type l \\) -print0 | LC_ALL=C sort -z | " .
+ "xargs -0 -I {} cp --reflink=auto --parents -dp {} $pwd/$tmp/$dest/");
# cp is annoying so I need a separate pass
# just for empty directories
complex_doit("cd '$dir' && " .
- "find '$basename' $exclude \\( -type d -and -empty \\) -print0 | xargs -0 -I {} cp --reflink=auto --parents -a {} $pwd/$tmp/$dest/");
+ "find '$basename' $exclude \\( -type d -and -empty \\) -print0 | LC_ALL=C sort -z | " .
+ "xargs -0 -I {} cp --reflink=auto --parents -a {} $pwd/$tmp/$dest/");
}
else {
doit("cp", '--reflink=auto', "-a", $src, "$tmp/$dest/");
diff --git a/dh_installdocs b/dh_installdocs
index 45b5338..7eccab8 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -232,7 +232,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
my $pwd=`pwd`;
chomp $pwd;
my $docdir = "$pwd/$tmp/usr/share/doc/$package";
- complex_doit("cd '$dir' && find '$basename' \\( -type f -or -type l \\)$exclude -print0 | xargs -0 -I {} cp --reflink=auto --parents -dp {} $docdir");
+ complex_doit("cd '$dir' && " .
+ "find '$basename' \\( -type f -or -type l \\)$exclude -print0 | LC_ALL=C sort -z | " .
+ "xargs -0 -I {} cp --reflink=auto --parents -dp {} $docdir");
}
else {
doit("cp", '--reflink=auto', "-a", $doc,
diff --git a/dh_installexamples b/dh_installexamples
index 9ec6914..7b28776 100755
--- a/dh_installexamples
+++ b/dh_installexamples
@@ -98,7 +98,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
chomp $pwd;
my $exclude2 = '-type f'.$exclude;
complex_doit("cd '$dir' && " .
- "find '$basename' -type f$exclude -print0 | xargs -0 -I {} cp --reflink=auto --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples");
+ "find '$basename' -type f$exclude -print0 | LC_ALL=C sort -z | " .
+ "xargs -0 -I {} cp --reflink=auto --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples");
}
else {
doit("cp", '--reflink=auto', "-a", $example,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git
More information about the debhelper-devel
mailing list