]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_install
Allow dh addons to pass options to debhelper commands
[debhelper.git] / dh_install
index 86a868bf66c80e2dc4095dfb14726d6e7d1c2220..292837b4a0594165ac208ea198f6d1cf8a16e32c 100755 (executable)
@@ -117,7 +117,7 @@ init(options => {
 my @installed;
 
 my $srcdir = '.';
-$srcdir = $dh{SOURCEDIR}."/" if defined $dh{SOURCEDIR};
+$srcdir = $dh{SOURCEDIR} if defined $dh{SOURCEDIR};
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
@@ -151,7 +151,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        my @found = glob "$srcdir/$glob";
                        if (! compat(6)) {
                                # Fall back to looking in debian/tmp.
-                               if (! @found || ! -e $found[0]) {
+                               if (! @found || ! (-e $found[0] || -l $found[0])) {
                                        @found = glob "debian/tmp/$glob";
                                }
                        }
@@ -159,7 +159,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                }
 
                if (! compat(4)) { # check added in v5
-                       # glob now, relative to srcdir
                        if (! @filelist) {
                                error("$package missing files (@$set), aborting");
                        }
@@ -170,12 +169,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        if (! defined $dest) {
                                # Guess at destination directory.
                                $dest=$src;
-                               my $strip=$srcdir;
-                               if ($strip eq '.') {
-                                       $strip = "debian/tmp";
-                               }
-                               $dest=~s/^(.*\/)?\Q$strip\E//;
-                               $dest=dirname($dest);
+                               $dest=~s/^(.*\/)?\Q$srcdir\E\///;
+                               $dest=~s/^(.*\/)?debian\/tmp\///;
+                               $dest=dirname("/".$dest);
                                $tmpdest=1;
                        }