summaryrefslogtreecommitdiff
path: root/dh_installman
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-06-29 08:28:06 +0000
committerNiels Thykier <niels@thykier.net>2017-06-29 11:38:14 +0000
commiteea3821116074328fb10d587cbb6f1284bc03b23 (patch)
tree902b0b7aebec5e904f853d3edfe7c1ea9b9e3371 /dh_installman
parentc88842e1ce7a7d12baa127150c098522fce189a8 (diff)
downloaddebhelper-eea3821116074328fb10d587cbb6f1284bc03b23.tar.gz
dh_installman: Fix bug in the c11 language handling
It overrode explicitly defined languages (--language) but not the "faulty" detection it was supposed to replace. Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh_installman')
-rwxr-xr-xdh_installman16
1 files changed, 10 insertions, 6 deletions
diff --git a/dh_installman b/dh_installman
index 37ffe047..b931b0e3 100755
--- a/dh_installman
+++ b/dh_installman
@@ -210,12 +210,16 @@ on_items_in_parallel(\@all_packages, sub {
my $destdir = "$tmp/usr/share/man/man$realsection/";
my $langcode;
if (!defined $dh{LANGUAGE} || !exists $dh{LANGUAGE}) {
- # Translated man pages are typically specified by adding the
- # language code to the filename, so detect that and
- # redirect to appropriate directory, stripping the code.
- ($langcode) = $basename =~ m/\.([a-z][a-z](?:_[A-Z][A-Z])?)\.(?:[1-9]|man)/;
- } elsif (not compat(10) and $page =~ m{/man/(?:([a-z][a-z](?:_[A-Z][A-Z])?)(?:\.[^/]+)?)?/man[1-9]/}) {
- $langcode = $1;
+ if (not compat(10) and $page =~ m{/man/(?:([a-z][a-z](?:_[A-Z][A-Z])?)(?:\.[^/]+)?)?/man[1-9]/}) {
+ # If it looks like it was installed in a proper man dir, assume the language
+ # from that is correct.
+ $langcode = $1;
+ } else {
+ # Translated man pages are typically specified by adding the
+ # language code to the filename, so detect that and
+ # redirect to appropriate directory, stripping the code.
+ ($langcode) = $basename =~ m/\.([a-z][a-z](?:_[A-Z][A-Z])?)\.(?:[1-9]|man)/;
+ }
} elsif ($dh{LANGUAGE} ne 'C') {
$langcode = $dh{LANGUAGE};
}