From 7e30b95a60b9197618c6223388d2c49bee13c2c6 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:09:33 +0000 Subject: [PATCH] r170: Initial Import --- Dh_Getopt.pm | 1 + Dh_Lib.pm | 2 +- autoscripts/postinst-doc-base | 2 +- autoscripts/prerm-doc-base | 2 +- debian/changelog | 10 ++++++++ dh_compress | 2 +- dh_installdocs | 47 ++++++++++++++++++++++++++++++----- dh_installdocs.1 | 6 +++++ doc/README | 2 +- doc/TODO | 16 ++++-------- 10 files changed, 68 insertions(+), 22 deletions(-) diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index e0b3896..5f43496 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -84,6 +84,7 @@ sub parseopts { "d" => \$options{D_FLAG}, "remove-d" => \$options{D_FLAG}, + "dirs-only" => \$options{D_FLAG}, "r" => \$options{R_FLAG}, "no-restart-on-upgrade" => \$options{R_FLAG}, diff --git a/Dh_Lib.pm b/Dh_Lib.pm index fb02a5d..f20cd5d 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -261,7 +261,7 @@ sub filearray { my $file=shift; my @ret; open (DH_FARRAY_IN,"<$file") || error("cannot read $file: $1"); while () { - push @ret,split(/\s/,$_); + push @ret,split(' ',$_); } close DH_FARRAY_IN; diff --git a/autoscripts/postinst-doc-base b/autoscripts/postinst-doc-base index a53ed7b..c3653be 100644 --- a/autoscripts/postinst-doc-base +++ b/autoscripts/postinst-doc-base @@ -1,3 +1,3 @@ if command -v install-docs >/dev/null 2>&1; then - install-docs -i /usr/share/doc-base/#PACKAGE# + install-docs -i /usr/share/doc-base/#DOC-ID# fi diff --git a/autoscripts/prerm-doc-base b/autoscripts/prerm-doc-base index 339361a..9678003 100644 --- a/autoscripts/prerm-doc-base +++ b/autoscripts/prerm-doc-base @@ -1,3 +1,3 @@ if command -v install-docs >/dev/null 2>&1; then - install-docs -r #PACKAGE# + install-docs -r #DOC-ID# fi diff --git a/debian/changelog b/debian/changelog index 9e0179c..cf51a7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.34) unstable; urgency=low + + * dh_clean: added -d flag (also --dirs-only) that will make it clean only + tmp dirs. (closes: #30807) + * dh_installdocs: to support packages that need multiple doc-base files, + will now look for debian/.doc-base.. + * dh_compress: removed warning message (harmless). + + -- Joey Hess Sat, 6 Feb 1999 17:48:33 -0800 + debhelper (1.2.33) unstable; urgency=low * dh_compress: verbose_print() cd's. diff --git a/dh_compress b/dh_compress index 673f910..caffc11 100755 --- a/dh_compress +++ b/dh_compress @@ -59,7 +59,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # we can preserve the hard link across the compression and save # space in the end. my @f=(); - my %hardlinks={}; + my %hardlinks; foreach (@files) { ($dev, $inode, undef, $nlink)=stat($_); if ($nlink > 1) { diff --git a/dh_installdocs b/dh_installdocs index 1d05181..bc8fb8f 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -62,17 +62,52 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install","-m","644","-p",$copyright,"$TMP/usr/doc/$PACKAGE/copyright"); } - # Handle doc-base files. + # Handle doc-base files. There are two filename formats, the usual plus + # an extended format (debian/package.doc-base.). Have to + # come up with good document-id's too. + my %doc_ids; + + opendir(DEB,"debian/") || error("can't read debian directory: $!"); + foreach (grep {/^$PACKAGE\.doc-base\..*$/} readdir(DEB)) { + $id=$_; + $id=~s/\.doc-base\./-/; + $doc_ids{$id}="debian/$_"; + } + closedir(DEB); + + # These next lines handle the format debian/doc-base., + # which is in for completeness. + 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); + } + + # And this handles the normal format of course. $file=pkgfile($PACKAGE,"doc-base"); - if ($file) { + if ($file ne '') { + $doc_ids{$PACKAGE}=$file; + } + + if (%doc_ids) { if (! -d "$TMP/usr/share/doc-base/") { doit("install","-d","$TMP/usr/share/doc-base/"); } - doit("install","-p","-m644",$file, - "$TMP/usr/share/doc-base/$PACKAGE"); + } + foreach $doc_id (keys %doc_ids) { + doit("install","-m644","-p",$doc_ids{$doc_id}, + "$TMP/usr/share/doc-base/$doc_id"); if (! $dh{NOSCRIPTS}) { - autoscript($PACKAGE,"postinst","postinst-doc-base"); - autoscript($PACKAGE,"prerm","prerm-doc-base") + autoscript($PACKAGE,"postinst","postinst-doc-base", + "s/#DOC-ID#/$doc_id/", + ); + autoscript($PACKAGE,"prerm","prerm-doc-base", + "s/#DOC-ID#/$doc_id/", + ); } } } diff --git a/dh_installdocs.1 b/dh_installdocs.1 index abdef78..50f07e1 100644 --- a/dh_installdocs.1 +++ b/dh_installdocs.1 @@ -38,6 +38,12 @@ interface with the doc-base package. See .BR dh_installdeb (1) for an explanation of how this works. Note that the package name will be used as the doc-base document id. +.PP +If your package needs to register more +than one document, you need multiple files. To accomplish this, you can use +files named debian/package.doc-base.docid. The "docid" on the end is a +string that is combined with the package name to generate a unique doc-base +document id. .SH OPTIONS .TP .B debhelper options diff --git a/doc/README b/doc/README index b283af2..30f2a2c 100644 --- a/doc/README +++ b/doc/README @@ -12,7 +12,7 @@ Starting a new package: ---------------------- You can just use the example rules files and do the rest of the new package -set up by hand, or you could try the new dh-make package, which contains a +set up by hand, or you could try the dh-make package, which contains a "dh_make" command that is similar to debmake, and tries to automate the process. diff --git a/doc/TODO b/doc/TODO index 27b5055..b926737 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,12 +1,6 @@ This is the TODO for debhelper. As more and more people use debhelper, this list grows - I welcome patches to fix items on it! -Bugs: - -* all commands should print a warning message if non-cumulative parameters - are given more than once (ie, two -u's to dh_gencontrol). (#22588) - (Bug currently under dispute, I think this is bogus). - Wishlist items: * Make dh_* "use strict". @@ -54,8 +48,8 @@ Wishlist items: Deprecated: -* remove dh_installdebfiles, dh_du. - - need to wait a reasonable length of time. I'm currently planning - on doing this after slink is released or one year after they were - deprecated, whichever comes first. Be sure to grep whole debian - archive for all of them before removing them, though! +* remove dh_installdebfiles, dh_du. + - need to wait a reasonable length of + time. I'm currently planning on doing this after slink is released or + one year after they were deprecated, whichever comes first. Be sure to + grep whole debian archive for all of them before removing them, though! -- 2.39.5