X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_install;h=c35c8924a67035af1e95991bd2ca86164838b292;hb=00048048303e84604ef52f66070b7b670877ce2a;hp=eb4850257404c24dac90c8688d08bf53d02164ab;hpb=d92a7906608dcf6c697e912f73376c7f6b030fa8;p=debhelper.git diff --git a/dh_install b/dh_install index eb48502..c35c892 100755 --- a/dh_install +++ b/dh_install @@ -24,15 +24,6 @@ those particular tasks. dh_install, then, is useful for installing everything else, for which no particular intelligence is needed. It is a replacement for the old dh_movefiles command. -Files named debian/package.install list the files to install into each -package and the directory they should be installed to. The format is a set -of lines, where each line lists a file or files to install, and at the end -of the line tells the directory it should be installed in. The name of the -files (or directories) to install should be given relative to the current -directory, while the installation directory is given relative to the -package build directory. You may use wildcards in the names of the files to -install (in v3 mode and above). - This program may be used in one of two ways. If you just have a file or two that the upstream Makefile does not install for you, you can run dh_install on them to move them into place. On the other hand, maybe you have a large @@ -44,6 +35,22 @@ From debhelper compatibility level 7 on, dh_install will fall back to looking in debian/tmp for files, if it doesn't find them in the current directory (or whereever you've told it to look using --sourcedir). +=head1 FILES + +=over 4 + +=item debian/I.install + +List the files to install into each package and the directory they should be +installed to. The format is a set of lines, where each line lists a file or +files to install, and at the end of the line tells the directory it should be +installed in. The name of the files (or directories) to install should be given +relative to the current directory, while the installation directory is given +relative to the package build directory. You may use wildcards in the names of +the files to install (in v3 mode and above). + +=back + =head1 OPTIONS =over 4 @@ -119,7 +126,12 @@ my @installed; my $srcdir = '.'; $srcdir = $dh{SOURCEDIR} if defined $dh{SOURCEDIR}; -foreach my $package (@{$dh{DOPACKAGES}}) { +foreach my $package (getpackages()) { + # Look at the install files for all packages to handle + # list-missing/fail-missing, but skip really installing for + # packages that are not being acted on. + my $skip_install=! grep { $_ eq $package } @{$dh{DOPACKAGES}}; + my $tmp=tmpdir($package); my $file=pkgfile($package,"install"); @@ -159,13 +171,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } if (! compat(4)) { # check added in v5 - # glob now, relative to srcdir - if (! @filelist) { + if (! @filelist && ! $skip_install) { error("$package missing files (@$set), aborting"); } } + foreach my $src (@filelist) { next if excludefile($src); + + push @installed, $src; + next if $skip_install; if (! defined $dest) { # Guess at destination directory. @@ -180,16 +195,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) { if (! -e "$tmp/$dest") { doit("install","-d","$tmp/$dest"); } - - # Keep track of what's installed. - if ($dh{LIST_MISSING} || $dh{FAIL_MISSING}) { - # Kill any extra slashes. Makes the - # @installed stuff more robust. - $src=~y:/:/:s; - $src=~s:/+$::; - $src=~s:^(\./)*::; - push @installed, "\Q$src\E\/.*|\Q$src\E"; - } if (-d $src && $exclude) { my $basename = basename($src); @@ -219,7 +224,13 @@ if ($dh{LIST_MISSING} || $dh{FAIL_MISSING}) { } my @missing; - my $installed=join("|", @installed); + my $installed=join("|", map { + # Kill any extra slashes, for robustness. + y:/:/:s; + s:/+$::; + s:^(\./)*::; + "\Q$_\E\/.*|\Q$_\E"; + } @installed); $installed=qr{^($installed)$}; find(sub { -f || -l || return;