1 |
Author: zmedico |
2 |
Date: 2008-05-27 23:08:22 +0000 (Tue, 27 May 2008) |
3 |
New Revision: 10459 |
4 |
|
5 |
Modified: |
6 |
main/trunk/bin/doman |
7 |
Log: |
8 |
Bug #222439 - Add doman support for foo.lang.N filenames. Behavior is |
9 |
as follows: |
10 |
|
11 |
foo.1 -> man/man1/foo.1 |
12 |
foo.lang.1 -> man/lang/man1/foo.1 |
13 |
|
14 |
Thanks to Yuri Vasilevski for the initial patch. I've modified it to |
15 |
use bash's =~ operator and corresponding $BASH_REMATCH array. |
16 |
|
17 |
|
18 |
Modified: main/trunk/bin/doman |
19 |
=================================================================== |
20 |
--- main/trunk/bin/doman 2008-05-27 15:41:48 UTC (rev 10458) |
21 |
+++ main/trunk/bin/doman 2008-05-27 23:08:22 UTC (rev 10459) |
22 |
@@ -31,15 +31,22 @@ |
23 |
suffix=${realname##*.} |
24 |
fi |
25 |
|
26 |
- mandir=${i18n}man${suffix:0:1} |
27 |
+ if [[ $x =~ (.*)\.([a-z][a-z](_[A-Z][A-Z])?)\.(.*) ]] ; then |
28 |
+ name=${BASH_REMATCH[1]##*/}.${BASH_REMATCH[4]} |
29 |
+ mandir=${BASH_REMATCH[2]}/man${suffix:0:1} |
30 |
+ else |
31 |
+ name=${x##*/} |
32 |
+ mandir=${i18n}man${suffix:0:1} |
33 |
+ fi |
34 |
|
35 |
+ |
36 |
if echo ${mandir} | egrep -q 'man[0-9n](|f|p|pm)$' -; then |
37 |
if [[ -s ${x} ]] ; then |
38 |
if [[ ! -d ${D}/usr/share/man/${mandir} ]] ; then |
39 |
install -d "${D}/usr/share/man/${mandir}" |
40 |
fi |
41 |
|
42 |
- install -m0644 "${x}" "${D}/usr/share/man/${mandir}" |
43 |
+ install -m0644 "${x}" "${D}/usr/share/man/${mandir}/${name}" |
44 |
((ret+=$?)) |
45 |
elif [[ ! -e ${x} ]] ; then |
46 |
vecho "doman: ${x} does not exist" 1>&2 |
47 |
|
48 |
-- |
49 |
gentoo-commits@l.g.o mailing list |