components/timezone/do_pofile.sh
changeset 454 1ef5e4f29411
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/timezone/do_pofile.sh	Thu Aug 04 11:29:10 2011 +0530
@@ -0,0 +1,68 @@
+#! /bin/sh
+#
+# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Create messages file for zone_sun.tab, country.tab, continent.tab
+#
+AWK=/usr/bin/nawk
+ECHO=/usr/bin/echo
+
+ZONE_SUN_FILE=zone_sun.tab
+COUNTRY_FILE=country.tab
+CONTINENT_FILE=continent.tab
+
+DOMAIN=SUNW_OST_ZONEINFO
+
+$ECHO "domain \"$DOMAIN\""
+
+$ECHO "#"
+$ECHO "# These files are located in components/timezone."
+$ECHO "#"
+
+$ECHO "#"
+$ECHO "# continent.tab"
+$ECHO "#"
+
+# Get 2nd column of continent.tab file
+$AWK -F'\t' \
+	' 
+	/^#/ { next }
+	{ 
+		printf "msgid \"%s\"\n", $2 
+		printf "msgstr \"\"\n"
+	}
+	' < $CONTINENT_FILE
+
+$ECHO "#"
+$ECHO "# country.tab"
+$ECHO "#"
+
+# Get 2nd column of country.tab file
+$AWK -F'\t' \
+	' 
+	/^#/ { next }
+	{ 
+		printf "msgid \"%s\"\n", $2 
+		printf "msgstr \"\"\n"
+	}
+	' < $COUNTRY_FILE
+
+
+$ECHO "#"
+$ECHO "# zone.tab"
+$ECHO "#"
+
+# Get 5th column (if it exists) of zone_sun.tab file
+$AWK -F'\t' \
+	' 
+	/^#/ { next }
+	{ 
+		if (NF > 4) {
+			printf "msgid \"%s\"\n", $5 
+			printf "msgstr \"\"\n"
+		}
+	}
+	' < $ZONE_SUN_FILE
+