]> git.donarmstrong.com Git - debhelper.git/commitdiff
r245: Initial Import
authorjoey <joey>
Tue, 17 Aug 1999 05:18:50 +0000 (05:18 +0000)
committerjoey <joey>
Tue, 17 Aug 1999 05:18:50 +0000 (05:18 +0000)
debian/changelog
dh_installdocs

index 3a2666cfc682ee56e948a9c74e8d2f0f61574949..ad08e488dffa83daa586dac003a7811113eee176 100644 (file)
@@ -1,3 +1,12 @@
+debhelper (2.0.21) unstable; urgency=low
+
+  * Wow. It turns out dh_installdocs has been doing it wrong and doc-base
+    files have the doc-id inside them. Applied and modified a patch from
+    Peter Moulder <reiter@netspace.net.au> to make it use those id's instead
+    of coming up with it's own. (Closes: #42650)
+
+ -- Joey Hess <joeyh@master.debian.org>  Sun,  8 Aug 1999 10:24:10 -0700
+
 debhelper (2.0.20) unstable; urgency=low
 
   * dh_perl: Patch from Raphael Hertzog <rhertzog@hrnet.fr> to allow
index b82b21c246e2f67b894ab389e302b4080c5524a5..101110da6e2b88dc66d00b46114a752c2571d317 100755 (executable)
@@ -62,51 +62,45 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
                        doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright");
        }
        
-       # Handle doc-base files. There are two filename formats, the usual plus
-       # an extended format (debian/package.doc-base.<doc-id>). Have to
-       # come up with good document-id's too.
+       # Handle doc-base files. There are two filename formats, the usual
+       # plus an extended format (debian/package.*).
        my %doc_ids;
        
        opendir(DEB,"debian/") || error("can't read debian directory: $!");
-       foreach (grep {/^\Q$PACKAGE\E\.doc-base\..*$/} readdir(DEB)) {
-               $id=$_;
-               $id=~s/\.doc-base\./-/;
-               $doc_ids{$id}="debian/$_";
-       }
-       closedir(DEB);
-       
-       # These next lines handle the format debian/doc-base.<doc-id>, 
-       # which is in for completeness.
+       # If this is the main package, we need to handle unprefixed filenames.
+       # For all packages, we must support both the usual filename format plus
+       # that format with a period an something appended.
+       my $regexp="\Q$PACKAGE\E\.";
        if ($PACKAGE eq $dh{MAINPACKAGE}) {
-               opendir(DEB,"debian/") || error("can't read debian directory: $!");
-               foreach (grep {/^doc-base\..*$/} readdir(DEB)) {
-                       $id=$_;
-                       $id=~s/doc-base\./$PACKAGE-/;
-                       $doc_ids{$id}="debian/$_";
-               }
-               closedir(DEB);
+               $regexp="(|$regexp)";
        }
-       
-       # And this handles the normal format of course.
-       $file=pkgfile($PACKAGE,"doc-base");
-       if ($file ne '') {
-               $doc_ids{$PACKAGE}=$file;
+       foreach my $fn (grep {/^${regexp}doc-base(\..*)?$/} readdir(DEB)) {
+               # Parse the file to get the doc id.
+               open (IN, "debian/$fn") || die "Cannot read debian/$fn.";
+               while (<IN>) {
+                       if (/^Document:\s+(.*)/) {
+                               $doc_ids{$fn}=$1;
+                               last;
+                       }
+               }
+               close IN;
        }
+       closedir(DEB);
        
        if (%doc_ids) {
                if (! -d "$TMP/usr/share/doc-base/") {
                        doit("install","-d","$TMP/usr/share/doc-base/");
                }
        }
-       foreach $doc_id (keys %doc_ids) {
-               doit("install","-m644","-p",$doc_ids{$doc_id},
-                    "$TMP/usr/share/doc-base/$doc_id");
+       foreach my $fn (keys %doc_ids) {
+               doit("install","-m644","-p","debian/$fn",
+                    "$TMP/usr/share/doc-base/$doc_ids{$fn}");
                if (! $dh{NOSCRIPTS}) {
                        autoscript($PACKAGE,"postinst","postinst-doc-base",
-                               "s/#DOC-ID#/$doc_id/",
+                               "s/#DOC-ID#/$doc_ids{$fn}/",
                        );
                        autoscript($PACKAGE,"prerm","prerm-doc-base",
-                               "s/#DOC-ID#/$doc_id/",
+                               "s/#DOC-ID#/$doc_ids{$fn}/",
                        );
                }
        }