xref: /onnv-gate/usr/src/cmd/zic/do_pofile.sh (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#! /bin/sh
2*0Sstevel@tonic-gate#
3*0Sstevel@tonic-gate# Copyright (c) 2001 by Sun Microsystems, Inc.
4*0Sstevel@tonic-gate# All rights reserved.
5*0Sstevel@tonic-gate#
6*0Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
7*0Sstevel@tonic-gate
8*0Sstevel@tonic-gate#
9*0Sstevel@tonic-gate# Create messages file for zone_sun.tab, country.tab, continent.tab
10*0Sstevel@tonic-gate#
11*0Sstevel@tonic-gateAWK=/usr/bin/nawk
12*0Sstevel@tonic-gateECHO=/usr/bin/echo
13*0Sstevel@tonic-gate
14*0Sstevel@tonic-gateZONE_SUN_FILE=zone_sun.tab
15*0Sstevel@tonic-gateCOUNTRY_FILE=country.tab
16*0Sstevel@tonic-gateCONTINENT_FILE=continent.tab
17*0Sstevel@tonic-gate
18*0Sstevel@tonic-gateDOMAIN=SUNW_OST_ZONEINFO
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gate$ECHO "domain \"$DOMAIN\""
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gate$ECHO "#"
23*0Sstevel@tonic-gate$ECHO "# These files are located in usr/src/cmd/zic."
24*0Sstevel@tonic-gate$ECHO "#"
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gate$ECHO "#"
27*0Sstevel@tonic-gate$ECHO "# continent.tab"
28*0Sstevel@tonic-gate$ECHO "#"
29*0Sstevel@tonic-gate
30*0Sstevel@tonic-gate# Get 2nd column of continent.tab file
31*0Sstevel@tonic-gate$AWK -F'\t' \
32*0Sstevel@tonic-gate	'
33*0Sstevel@tonic-gate	/^#/ { next }
34*0Sstevel@tonic-gate	{
35*0Sstevel@tonic-gate		printf "msgid \"%s\"\n", $2
36*0Sstevel@tonic-gate		printf "msgstr \"\"\n"
37*0Sstevel@tonic-gate	}
38*0Sstevel@tonic-gate	' < $CONTINENT_FILE
39*0Sstevel@tonic-gate
40*0Sstevel@tonic-gate$ECHO "#"
41*0Sstevel@tonic-gate$ECHO "# country.tab"
42*0Sstevel@tonic-gate$ECHO "#"
43*0Sstevel@tonic-gate
44*0Sstevel@tonic-gate# Get 2nd column of country.tab file
45*0Sstevel@tonic-gate$AWK -F'\t' \
46*0Sstevel@tonic-gate	'
47*0Sstevel@tonic-gate	/^#/ { next }
48*0Sstevel@tonic-gate	{
49*0Sstevel@tonic-gate		printf "msgid \"%s\"\n", $2
50*0Sstevel@tonic-gate		printf "msgstr \"\"\n"
51*0Sstevel@tonic-gate	}
52*0Sstevel@tonic-gate	' < $COUNTRY_FILE
53*0Sstevel@tonic-gate
54*0Sstevel@tonic-gate
55*0Sstevel@tonic-gate$ECHO "#"
56*0Sstevel@tonic-gate$ECHO "# zone.tab"
57*0Sstevel@tonic-gate$ECHO "#"
58*0Sstevel@tonic-gate
59*0Sstevel@tonic-gate# Get 5th column (if it exists) of zone_sun.tab file
60*0Sstevel@tonic-gate$AWK -F'\t' \
61*0Sstevel@tonic-gate	'
62*0Sstevel@tonic-gate	/^#/ { next }
63*0Sstevel@tonic-gate	{
64*0Sstevel@tonic-gate		if (NF > 4) {
65*0Sstevel@tonic-gate			printf "msgid \"%s\"\n", $5
66*0Sstevel@tonic-gate			printf "msgstr \"\"\n"
67*0Sstevel@tonic-gate		}
68*0Sstevel@tonic-gate	}
69*0Sstevel@tonic-gate	' < $ZONE_SUN_FILE
70*0Sstevel@tonic-gate
71