public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10459 - main/trunk/bin
@ 2008-05-27 23:08 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-05-27 23:08 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-05-27 23:08:22 +0000 (Tue, 27 May 2008)
New Revision: 10459

Modified:
   main/trunk/bin/doman
Log:
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.


Modified: main/trunk/bin/doman
===================================================================
--- main/trunk/bin/doman	2008-05-27 15:41:48 UTC (rev 10458)
+++ main/trunk/bin/doman	2008-05-27 23:08:22 UTC (rev 10459)
@@ -31,15 +31,22 @@
 		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
 			if [[ ! -d ${D}/usr/share/man/${mandir} ]] ; then
 				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

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-27 23:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27 23:08 [gentoo-commits] portage r10459 - main/trunk/bin Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox