summaryrefslogtreecommitdiff
path: root/dh_install
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2015-01-07 19:29:23 +0100
committerNiels Thykier <niels@thykier.net>2015-01-07 19:29:45 +0100
commit454d5cb69b7aa923a0aa3a86c5d798f418901e24 (patch)
treeaea278693f0cf987da6c71cc0fbe47831ab94a5c /dh_install
parent16ec72ff6879009208eef8bfded08ed9be587515 (diff)
downloaddebhelper-454d5cb69b7aa923a0aa3a86c5d798f418901e24.tar.gz
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@thykier.net>
Diffstat (limited to 'dh_install')
-rwxr-xr-xdh_install8
1 files changed, 5 insertions, 3 deletions
diff --git a/dh_install b/dh_install
index 5715e04f..ebc42070 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) {