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
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<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).
+
+=back
+
=head1 OPTIONS
=over 4
my @installed;
my $srcdir = '.';
-$srcdir = $dh{SOURCEDIR}."/" if defined $dh{SOURCEDIR};
+$srcdir = $dh{SOURCEDIR} if defined $dh{SOURCEDIR};
+
+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}};
-foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmp=tmpdir($package);
my $file=pkgfile($package,"install");
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";
}
}
}
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.
$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;
}
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);
}
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;