]> git.donarmstrong.com Git - debhelper.git/commitdiff
r538: * Make dh_installchangelogs install debian/NEWS files as well, as
authorjoey <joey>
Fri, 19 Jul 2002 00:58:01 +0000 (00:58 +0000)
committerjoey <joey>
Fri, 19 Jul 2002 00:58:01 +0000 (00:58 +0000)
     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.

Debian/Debhelper/Dh_Getopt.pm
debian/changelog
dh_compress
dh_install
dh_installchangelogs
dh_shlibdeps

index 37d6f4755009a99746a80432460e357c130f2166..79674144a95a04021ff63fa309a54a8bce4a63cb 100644 (file)
@@ -143,6 +143,8 @@ sub parseopts {
                "h|help" => \&showhelp,
 
                "mainpackage=s" => \$options{MAINPACKAGE},
+
+               "list-missing" => \$options{LIST_MISSING},
                
                "<>" => \&NonOption,
        );
index ae50371a1934ab78bccc39a6521c1dc30da53b38..593d2c492f7a2ef0c221b3cea948a197df651022 100644 (file)
@@ -1,3 +1,24 @@
+debhelper (4.0.19) unstable; urgency=low
+
+  * 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.
+
+ -- Joey Hess <joeyh@debian.org>  Sun, 14 Jul 2002 23:09:24 -0400
+
+debhelper (4.0.18) unstable; urgency=low
+
+  * Removed a seemingly useless -dDepends in dh_shlibdeps's call to
+    dpkg-shalibdeps; this allows for stuff like dh_shlibdeps -- -dRecommends
+    Closes: #152117
+  * Added a --list-missing parameter to dh_install, which calc may find
+    useful.
+
+ -- Joey Hess <joeyh@debian.org>  Sun,  7 Jul 2002 22:44:01 -0400
+
 debhelper (4.0.17) unstable; urgency=low
 
   * In dh_install, don't limit to -type f when doing the find due to -X.
index 5e8bb379ce45f8a6fd69c0650067f9062555afc4..5c04e0c3ffef9108006e6d124539509c9fbf7617 100755 (executable)
@@ -95,7 +95,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                # ".tgz", "-gz", "-z", "_z"
                push @files, split(/\n/,`
                        find usr/info usr/share/info usr/man usr/share/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true;
-                       find usr/doc usr/share/doc -type f \\( -size +4k -or -name "changelog*" \\) \\
+                       find usr/doc usr/share/doc -type f \\( -size +4k -or -name "changelog*" -or -name "NEWS*" \\) \\
                                \\( -name changelog.html -or ! -iname "*.htm*" \\) \\
                                ! -iname "*.gif" ! -iname "*.png" ! -iname "*.jpg" \\
                                ! -iname "*.jpeg" ! -iname "*.gz" ! -iname "*.taz" \\
index 69f24365b475b788abac89f477ac92b5eaf2e091..845884076cf6c4edaa9db72e046027615581d3e0 100755 (executable)
@@ -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<dh_install> [B<-X>I<item>] [S<I<debhelper options>>] [S<I<file [...] dest>>]
+B<dh_install> [B<-X>I<item>] [B<--sutodest>] [B<--list-missing>] [S<I<debhelper options>>] [S<I<file [...] dest>>]
 
 =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<debhelper(1)>
index dc9b5a0595dd4392ca89a5bdfa20eefc16cef535..2588d57f476a6a8bde51d3ee5c5d188fa13b740e 100755 (executable)
@@ -25,6 +25,12 @@ into usr/share/doc/package/changelog.Debian in the package build directory. (If
 files named debian/package.changelog exist, they will be used in preference
 to debian/changelog.)
 
+Parallelling the debian changelog handling, this program also takes care of
+debian NEWS files. If there is a debian/NEWS file, it is installed as
+usr/share/doc/package/NEWS for native packages, and as
+usr/share/doc/package/NEWS.Debian for non-native packages. debian/package.NEWS
+files can also be used.
+
 If an upstream changelog file is specified as an option, and the package is
 not a native debian package, then this upstream changelog will be installed
 as usr/share/doc/package/changelog in the package build directory. If the
@@ -67,17 +73,23 @@ if (isnative($dh{MAINPACKAGE}) && defined $upstream) {
 }
 
 my $changelog_name="changelog.Debian";
+my $news_name="NEWS.Debian";
 if (isnative($dh{MAINPACKAGE})) {
        $changelog_name='changelog';
+       $news_name='NEWS';
 }
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
        my $changelog=pkgfile($package,"changelog");
+       my $news=pkgfile($package,"NEWS");
 
        if (!$changelog) {
                $changelog="debian/changelog";
        }
+       if (!$news) {
+               $news="debian/NEWS";
+       }
 
        if (! -e $changelog) {
                error("could not find changelog $changelog");
@@ -93,6 +105,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        }
        doit("install","-o",0,"-g",0,"-p","-m644",$changelog,
                "$tmp/usr/share/doc/$package/$changelog_name");
+       if (-e $news) {
+               doit("install","-o",0,"-g",0,"-p","-m644",$news,
+                       "$tmp/usr/share/doc/$package/$news_name");
+       }
 
        if ($upstream) {
                my $link_to;
index b3648e514d1d97fdccc713f92cbb3189ab277cf7..5001d75fa35b5869ed372287262858d99abfdb20 100755 (executable)
@@ -89,7 +89,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                $find_options="! \\( $dh{EXCLUDE_FIND} \\)";
        }
        foreach my $file (split(/\n/,`find $tmp -type f \\( -perm +111 -or -name "*.so*" \\) $find_options`)) {
-               # TODO: this is slow, optimize. Ie, file can run once on multiple files..
+               # TODO this is slow, optimize. Ie, file can run once on
+               # multiple files..
                $ff=`file "$file"`;
                if ($ff=~m/ELF/ && $ff!~/statically linked/) {
                        push @filelist,$file;
@@ -97,7 +98,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        }
 
        if (@filelist) {
-               doit("dpkg-shlibdeps","-Tdebian/${ext}substvars",@{$dh{U_PARAMS}},'-dDepends',@filelist);
+               doit("dpkg-shlibdeps","-Tdebian/${ext}substvars",
+                       @{$dh{U_PARAMS}},@filelist);
        }
 }