From 699d0e5c2bd5bcd52a1833a802281ca66d7ae111 Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 19 Jul 2002 00:58:01 +0000 Subject: r538: * Make dh_installchangelogs install debian/NEWS files as well, as NEWS.Debian. Make dh_compress always compress them. The idea is to make these files be in a machine parsable form, like the debian changelog, but only put newsworthy info into them. Automated tools can then display new news on upgrade. It is hoped that if this catches on it will reduce the abuse of debconf notes. See discussion on debian-devel for details. --- dh_install | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'dh_install') diff --git a/dh_install b/dh_install index 69f2436..8458840 100755 --- a/dh_install +++ b/dh_install @@ -7,11 +7,12 @@ dh_install - install files into package build directories =cut use strict; +use File::Find; use Debian::Debhelper::Dh_Lib; =head1 SYNOPSIS -B [B<-X>I] [S>] [S>] +B [B<-X>I] [B<--sutodest>] [B<--list-missing>] [S>] [S>] =head1 DESCRIPTION @@ -65,6 +66,19 @@ Note that if you list only a filename on a line by itself in a debian/package.install file, with no explicit destination, then dh_install will automatically guess the destination even if this flag is not set. +=item B<--list-missing> + +This option makes dh_install keep track of the files it installs, and then at +the end, compare that list with the files in debian/tmp. If any of the files +(and symlinks) in debian/tmp were not installed to somewhere, it will +warn on stderr about that. + +This may be useful if you have a large package and want to make sure that +you don't miss installing newly added files in new upstream releases. + +Note that files that are excluded from being moved via the -X option are not +warned about. + =item B<--sourcedir=dir> Makes all source files relative to "dir". If this is specified, it is akin @@ -88,7 +102,7 @@ The files will be installed into the first package dh_install acts on. init(); -my $ret=0; +my @installed; foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); @@ -134,6 +148,15 @@ foreach my $package (@{$dh{DOPACKAGES}}) { doit("install","-d","$tmp/$dest"); } + # Keep track of what's installed. + if ($dh{LIST_MISSING}) { + # Kill any extra slashes. Makes the + # @installed stuff more robust. + $src=~y:/:/:s; + $src=~s:/+$::; + push @installed, "\Q$src\E\/.*|\Q$src\E"; + } + if (-d $src && $exclude) { my ($dir_basename) = basename($src); # Pity there's no cp --exclude .. @@ -148,6 +171,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } } +if ($dh{LIST_MISSING}) { + my @missing; + my $installed=join("|", @installed); + $installed=qr{^$installed$}; + find(sub { + -f || -l || return; + $_="$File::Find::dir/$_"; + push @missing, $_ unless /$installed/; + }, './debian/tmp'); + if (@missing) { + warning "$_ not installed" foreach @missing; + } +} + =head1 SEE ALSO L -- cgit v1.2.1