summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-07-20 20:33:43 +0000
committerNiels Thykier <niels@thykier.net>2017-07-22 18:55:45 +0000
commit1a629d47954baaabc53929b0d661391e1f3498a2 (patch)
tree7b57b38b37a00f4ebfe8bd4ce17c259f45933597
parent2edbf91edc01ffb067111eda44b56fb60cbbb359 (diff)
downloaddebhelper-1a629d47954baaabc53929b0d661391e1f3498a2.tar.gz
dh_install: Make autodest work with default_sourcedir != d/tmp
Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-xdh_install11
1 files changed, 6 insertions, 5 deletions
diff --git a/dh_install b/dh_install
index 656b9217..269e1236 100755
--- a/dh_install
+++ b/dh_install
@@ -158,8 +158,9 @@ if ($dh{EXCLUDE_FIND}) {
foreach my $package (getpackages()) {
my (@installed, %dest2sources);
+ my $default_source_dir = default_sourcedir($package);
my @search_dirs = ($srcdir);
- push(@search_dirs, default_sourcedir($package)) if not compat(6);
+ push(@search_dirs, $default_source_dir) if not compat(6);
# Look at the install files for all packages to handle
# list-missing/fail-missing, but skip really installing for
@@ -233,7 +234,7 @@ foreach my $package (getpackages()) {
if (not $exclude) {
my @unoptimized;
for my $src (@filelist) {
- my $d = $dest // compute_dest($src);
+ my $d = $dest // compute_dest($default_source_dir, $src);
my $basename = basename($src);
if (exists($dest2sources{$d}{$basename})) {
# If there is a clash, silently undo the optimizations.
@@ -267,7 +268,7 @@ foreach my $package (getpackages()) {
$target_dest = $dest;
if (! defined $target_dest) {
# Guess at destination directory.
- $target_dest = compute_dest($src);
+ $target_dest = compute_dest($default_source_dir, $src);
}
}
@@ -320,10 +321,10 @@ if ($dh{LIST_MISSING} || $dh{FAIL_MISSING}) {
}
sub compute_dest {
- my ($dest) = @_;
+ my ($source_dir, $dest) = @_;
$dest =~ s/^(.*\/)?\Q$srcdir\E\///;
- $dest =~ s/^(.*\/)?debian\/tmp\///;
+ $dest =~ s/^(.*\/)?\Q$source_dir\E\///;
$dest = dirname("/".$dest);
return $dest;