]> git.donarmstrong.com Git - debhelper.git/commitdiff
dh_installchangelogs: Also look for changelog files in doc(s) subdirectories. Closes...
authorJoey Hess <joey@kitenet.net>
Fri, 28 May 2010 05:27:31 +0000 (01:27 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 28 May 2010 05:27:31 +0000 (01:27 -0400)
debian/changelog
dh_installchangelogs

index 6892bae36580d262173018352419ce3fa765d115..5df9e2c98d84fa40d91023a696f2d47c7cd1e0a4 100644 (file)
@@ -24,6 +24,8 @@ debhelper (7.9.1) UNRELEASED; urgency=low
     commands. (See #570039)
   * dh_installchangelogs: Support packages placing their changelog in a
     file with a name like HISTORY. Closes: #582749
+  * dh_installchangelogs: Also look for changelog files in doc(s)
+    subdirectories. Closes: #521258
 
  -- Joey Hess <joeyh@debian.org>  Mon, 17 May 2010 20:01:19 -0400
 
index 87ac11bdd0ac893c37182616dc5118d379952f41..a6dcc682325da3823fe2f0c6806af776ad4c0bba 100755 (executable)
@@ -19,8 +19,8 @@ dh_installchangelogs is a debhelper program that is responsible for
 installing changelogs into package build directories.
 
 An upstream changelog file may be specified as an option. If none is
-specified, a few common filenames are tried. (In compatibility level 7 and
-above.)
+specified, it looks for files with names that seem likely to be changelogs.
+(In compatibility level 7 and above.)
 
 If there is an upstream changelog file, it will be be installed as
 usr/share/doc/package/changelog in the package build directory. If the
@@ -84,14 +84,16 @@ my $upstream=shift;
 my $changelog_name="changelog.Debian";
 if (! defined $upstream) {
        if (! isnative($dh{MAINPACKAGE}) && !compat(6)) {
-               my @files=sort glob("*");
-               foreach my $name (qw{changelog changes changelog.txt changes.txt history history.txt}) {
-                       my @matches=grep {
-                               lc $_ eq $name && -s $_ && ! excludefile($_)
-                       } @files;
-                       if (@matches) {
-                               $upstream=shift @matches;
-                               last;
+               foreach my $dir (qw{. doc docs}) {
+                       my @files=sort glob("$dir/*");
+                       foreach my $name (qw{changelog changes changelog.txt changes.txt history history.txt}) {
+                               my @matches=grep {
+                                       lc basename($_) eq $name && -s $_ && ! excludefile($_)
+                               } @files;
+                               if (@matches) {
+                                       $upstream=shift @matches;
+                                       last;
+                               }
                        }
                }
        }