summaryrefslogtreecommitdiff
path: root/dh_installdocs
diff options
context:
space:
mode:
authorDon Armstrong <don@donarmstrong.com>2012-09-14 10:43:51 -0700
committerJoey Hess <joey@kitenet.net>2012-09-17 13:33:58 -0400
commit2baf12c9e1c8c0b0cea3dc45aff3e75ea15f372a (patch)
tree0161d02fc95a30d73ec9a679f80de8f2f1f28b69 /dh_installdocs
parentcdb8852a4b1ef3e83f5f9fdc60285c015a38c0e1 (diff)
Bug#525821: [PATCH] support having the same document id in different packages in the same source
This is a multi-part message in MIME format. --------------1.7.10.4 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit
Diffstat (limited to 'dh_installdocs')
-rwxr-xr-xdh_installdocs35
1 files changed, 30 insertions, 5 deletions
diff --git a/dh_installdocs b/dh_installdocs
index 104b796..bb09ee3 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -54,12 +54,17 @@ and F<TODO> files will be installed as F<TODO.Debian> in non-native packages.
Installed as doc-base control files. Note that the doc-id will be
determined from the B<Document:> entry in the doc-base control file in
-question.
+question. In the event that multiple doc-base files in a single source
+package share the same doc-id, they will be installed to
+usr/share/doc-base/package instead of usr/share/doc-base/doc-id.
=item debian/I<package>.doc-base.*
-If your package needs to register more than one document, you need multiple
-doc-base files, and can name them like this.
+If your package needs to register more than one document, you need
+multiple doc-base files, and can name them like this. In the event
+that multiple doc-base files of this style in a single source package
+share the same doc-id, they will be installed to
+usr/share/doc-base/package-* instead of usr/share/doc-base/doc-id.
=back
@@ -298,9 +303,29 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
doit("install","-g",0,"-o",0,"-d","$tmp/usr/share/doc-base/");
}
}
+ # check for duplicate document ids
+ my %used_doc_ids;
+ for my $fn (keys %doc_ids) {
+ $used_doc_ids{$doc_ids{$fn}}++;
+ }
foreach my $fn (keys %doc_ids) {
- doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn",
- "$tmp/usr/share/doc-base/$doc_ids{$fn}");
+ # if this document ID is duplicated, we will install
+ # to usr/share/doc-base/packagename instead of
+ # usr/share/doc-base/doc_id. To allow for multiple
+ # conflicting doc-bases in a single package, we will
+ # install to usr/share/doc-base/packagename-extrabits
+ # if the doc-base file is
+ # packagename.doc-base.extrabits
+ if ($used_doc_ids{$doc_ids{$fn}}>1) {
+ my $fn_no_docbase = $fn;
+ $fn_no_docbase =~ s/\.doc-base(?:\.(.*))?/
+ if (defined $1 and length $1) {"-$1"} else {''}/xe;
+ doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn",
+ "$tmp/usr/share/doc-base/$fn_no_docbase");
+ } else {
+ doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn",
+ "$tmp/usr/share/doc-base/$doc_ids{$fn}");
+ }
}
}