summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-27 23:08:22 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-27 23:08:22 +0000
commit716e10013af503e82f72987a8b59f0114140a62c (patch)
treec67852b9966170d8df7490269675dd19dc870976
parent8328ae796d1b5eb6714dfd6c0820e63b3b7f156b (diff)
downloadportage-716e10013af503e82f72987a8b59f0114140a62c.tar.gz
portage-716e10013af503e82f72987a8b59f0114140a62c.tar.bz2
portage-716e10013af503e82f72987a8b59f0114140a62c.zip
Bug #222439 - Add doman support for foo.lang.N filenames. Behavior is
as follows: foo.1 -> man/man1/foo.1 foo.lang.1 -> man/lang/man1/foo.1 Thanks to Yuri Vasilevski for the initial patch. I've modified it to use bash's =~ operator and corresponding $BASH_REMATCH array. svn path=/main/trunk/; revision=10459
-rwxr-xr-xbin/doman11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/doman b/bin/doman
index c021f0a44..9af326666 100755
--- a/bin/doman
+++ b/bin/doman
@@ -31,7 +31,14 @@ for x in "$@" ; do
suffix=${realname##*.}
fi
- mandir=${i18n}man${suffix:0:1}
+ if [[ $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}
+ fi
+
if echo ${mandir} | egrep -q 'man[0-9n](|f|p|pm)$' -; then
if [[ -s ${x} ]] ; then
@@ -39,7 +46,7 @@ for x in "$@" ; do
install -d "${D}/usr/share/man/${mandir}"
fi
- install -m0644 "${x}" "${D}/usr/share/man/${mandir}"
+ install -m0644 "${x}" "${D}/usr/share/man/${mandir}/${name}"
((ret+=$?))
elif [[ ! -e ${x} ]] ; then
vecho "doman: ${x} does not exist" 1>&2