[Reproducible-commits] [debhelper] 26/61: Pass --reflink=auto to cp

Mattia Rizzolo mattia at mapreri.org
Sat Apr 4 18:37:30 UTC 2015


This is an automated email from the git hooks/post-receive script.

mapreri-guest pushed a commit to branch pu/reproducible_builds
in repository debhelper.

commit 454d5cb69b7aa923a0aa3a86c5d798f418901e24
Author: Niels Thykier <niels at thykier.net>
Date:   Wed Jan 7 19:29:23 2015 +0100

    Pass --reflink=auto to cp
    
    This gives faster copying on BTRFS with fallback to regular copy on
    all other filesystems.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog   | 3 +++
 dh_install         | 8 +++++---
 dh_installdocs     | 5 +++--
 dh_installexamples | 5 +++--
 dh_installinfo     | 2 +-
 5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 584197a..f703fc2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -51,6 +51,9 @@ debhelper (9.20150101.1) UNRELEASED; urgency=medium
     when it is stripping static libaries.  This avoids some
     unnecessary non-determinism in builds.  Based on patch by
     Andrew Ayer.
+  * dh_install, dh_installdocs, dh_installexamples and dh_installinfo:
+    Pass --reflink=auto to cp.  On supported filesystems, this provides
+    faster copying.
 
   [ Bernhard R. Link ]
   * Dh_lib: apply patch from Guillem Jover to support case-insensitive
diff --git a/dh_install b/dh_install
index 5715e04..ebc4207 100755
--- a/dh_install
+++ b/dh_install
@@ -203,13 +203,15 @@ foreach my $package (getpackages()) {
 				my $dir = ($basename eq '.') ? $src : "$src/..";
 				my $pwd=`pwd`;
 				chomp $pwd;
-				complex_doit("cd '$dir' && find '$basename' $exclude \\( -type f -or -type l \\) -print0 | xargs -0 -I {} cp --parents -dp {} $pwd/$tmp/$dest/");
+				complex_doit("cd '$dir' && " .
+							 "find '$basename' $exclude \\( -type f -or -type l \\) -print0 | 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 --parents -a {} $pwd/$tmp/$dest/");
+				complex_doit("cd '$dir' && " .
+							 "find '$basename' $exclude \\( -type d -and -empty \\) -print0 | xargs -0 -I {} cp --reflink=auto --parents -a {} $pwd/$tmp/$dest/");
 			}
 			else {
-				doit("cp", "-a", $src, "$tmp/$dest/");
+				doit("cp", '--reflink=auto', "-a", $src, "$tmp/$dest/");
 			}
 
 			if ($tmpdest) {
diff --git a/dh_installdocs b/dh_installdocs
index 59cf688..50ac48c 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -228,10 +228,11 @@ 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 --parents -dp {} $docdir");
+				complex_doit("cd '$dir' && find '$basename' \\( -type f -or -type l \\)$exclude -print0 | xargs -0 -I {} cp --reflink=auto --parents -dp {} $docdir");
 			}
 			else {
-				doit("cp", "-a", $doc, "$tmp/usr/share/doc/$package");
+				doit("cp", '--reflink=auto', "-a", $doc,
+					 "$tmp/usr/share/doc/$package");
 			}
 		}
 		doit("chown","-R","0:0","$tmp/usr/share/doc");
diff --git a/dh_installexamples b/dh_installexamples
index 9bfcb18..e7a37e4 100755
--- a/dh_installexamples
+++ b/dh_installexamples
@@ -96,10 +96,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 				my $pwd=`pwd`;
 				chomp $pwd;
 				my $exclude2 = '-type f'.$exclude;
-				complex_doit("cd '$dir' && find '$basename' -type f$exclude -exec cp --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples \\;");
+				complex_doit("cd '$dir' && find '$basename' -type f$exclude -exec cp --reflink=auto --parents -dp {} $pwd/$tmp/usr/share/doc/$package/examples \\;");
 			}
 			else {
-				doit("cp", "-a", $example, "$tmp/usr/share/doc/$package/examples");
+				doit("cp", '--reflink=auto', "-a", $example,
+					 "$tmp/usr/share/doc/$package/examples");
 			}
 		}
 	}
diff --git a/dh_installinfo b/dh_installinfo
index 14deeb3..5be93ed 100755
--- a/dh_installinfo
+++ b/dh_installinfo
@@ -68,7 +68,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		if ( ! -d "$tmp/usr/share/info") {
 			doit("install","-d","$tmp/usr/share/info");
 		}
-		doit("cp", at info,"$tmp/usr/share/info");
+		doit("cp", '--reflink=auto', @info, "$tmp/usr/share/info");
 		doit("chmod","-R", "go=rX","$tmp/usr/share/info/");
 		doit("chmod","-R", "u+rw","$tmp/usr/share/info/");
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debhelper.git



More information about the Reproducible-commits mailing list