diff options
author | joey <joey> | 1999-08-17 05:18:50 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 05:18:50 +0000 |
commit | 63e45075003b1d9fcff097b5644a81131c346653 (patch) | |
tree | 2bc3fb5b0b1733dd7d305aa48fef2c4040dab8ef | |
parent | 661c532ccc17f2b1d5f01be9a851dc30448cda2f (diff) | |
download | debhelper-63e45075003b1d9fcff097b5644a81131c346653.tar.gz |
r245: Initial Import
-rw-r--r-- | debian/changelog | 9 | ||||
-rwxr-xr-x | dh_installdocs | 52 |
2 files changed, 32 insertions, 29 deletions
diff --git a/debian/changelog b/debian/changelog index 3a2666cf..ad08e488 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 diff --git a/dh_installdocs b/dh_installdocs index b82b21c2..101110da 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -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}/", ); } } |