]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_installman
r1869: * dh_installman: correct mistake that broke translated man page installation
[debhelper.git] / dh_installman
index df0ad44e5f6f6d636601de6fff93948e40189e52..6544eae46b68b79401e53babc57fecfb17724028 100755 (executable)
@@ -143,13 +143,15 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        
                my $destdir="$tmp/usr/share/man/man$realsection/";
                my $langcode;
-               if (! exists $dh{LANGUAGE}) {
+               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)/;
-                       # Strip the language code from the instname.
-                       $instname=~s/\.$langcode$//;
+                       if (defined $langcode && $langcode ne '') {
+                               # Strip the language code from the instname.
+                               $instname=~s/\.$langcode$//;
+                       }
                }
                elsif ($dh{LANGUAGE} ne 'C') {
                        $langcode=$dh{LANGUAGE};