Bug #316311 - Prefer -i18n option of doman to filename language suffix
authorZac Medico <zmedico@gentoo.org>
Tue, 20 Apr 2010 08:02:25 +0000 (01:02 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 20 Apr 2010 08:02:25 +0000 (01:02 -0700)
(EAPI 4). Thanks to Ulrich Müller <ulm@g.o> for this patch from bug #303919.

bin/ebuild-helpers/doman

index 85d5e2b4f3b80e63b79698ba3824f7261e6be39e..e428b7292e1826ac45e2eeb121284181f9ab0694 100755 (executable)
@@ -30,13 +30,15 @@ for x in "$@" ; do
                suffix=${realname##*.}
        fi
 
-       if ! hasq "${EAPI:-0}" 0 1 && \
-               [[ $x =~ (.*)\.([a-z][a-z](_[A-Z][A-Z])?)\.(.*) ]] ; then
+       if hasq "${EAPI:-0}" 2 3 || [[ -z ${i18n} ]] \
+               && ! hasq "${EAPI:-0}" 0 1 \
+               && [[ $x =~ (.*)\.([a-z][a-z](_[A-Z][A-Z])?)\.(.*) ]]
+       then
                name=${BASH_REMATCH[1]##*/}.${BASH_REMATCH[4]}
                mandir=${BASH_REMATCH[2]}/man${suffix:0:1}
        else
                name=${x##*/}
-               mandir=${i18n}man${suffix:0:1}
+               mandir=${i18n#/}man${suffix:0:1}
        fi