18 #
19 # You should have received a copy of the GNU General Public License version
20 # 2 along with this work; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 #
23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
24 # or visit www.oracle.com if you need additional information or have any
25 # questions.
26 #
27
28 #
29 # This script is to generate the supported locale list string and replace the
30 # LocaleDataMetaInfo-XLocales.java.template in <ws>/src/share/classes/sun/util
31 #
32 # SORT, NAWK & SED is passed in as environment variables.
33 #
34
35 # A list of resource base name list;
36 RESOURCE_NAMES=$1
37
38 # A list of US resources;
39 US_FILES_LIST=$2
40
41 # A list of non-US resources;
42 NONUS_FILES_LIST=$3
43
44 INPUT_FILE=$4
45 OUTPUT_FILE=$5
46
47 localelist=
48 getlocalelist() {
49 localelist=""
50 localelist=`$NAWK -F$1_ '{print $2}' $2 | $SORT | $SED -e 's/_/-/g'`
51 }
52
53 sed_script="$SED -e \"s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@\" "
54
55 # ja-JP-JP and th-TH-TH need to be manually added, as they don't have any resource files.
56 nonusall=" ja-JP-JP th-TH-TH "
57
58 for FILE in $RESOURCE_NAMES
59 do
60 getlocalelist $FILE $US_FILES_LIST
61 sed_script=$sed_script"-e \"s@#"$FILE"_USLocales#@$localelist@g\" "
62 usall=$usall" "$localelist
63 getlocalelist $FILE $NONUS_FILES_LIST
64 sed_script=$sed_script"-e \"s@#"$FILE"_NonUSLocales#@$localelist@g\" "
65 nonusall=$nonusall" "$localelist
66 done
67
68 usall=`(for LOC in $usall; do echo $LOC;done) |$SORT -u`
69 nonusall=`(for LOC in $nonusall; do echo $LOC;done) |$SORT -u`
70
71 sed_script=$sed_script"-e \"s@#AvailableLocales_USLocales#@$usall@g\" "
72 sed_script=$sed_script"-e \"s@#AvailableLocales_NonUSLocales#@$nonusall@g\" "
73
74 sed_script=$sed_script"$INPUT_FILE > $OUTPUT_FILE"
75 eval $sed_script
|
18 #
19 # You should have received a copy of the GNU General Public License version
20 # 2 along with this work; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 #
23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
24 # or visit www.oracle.com if you need additional information or have any
25 # questions.
26 #
27
28 #
29 # This script is to generate the supported locale list string and replace the
30 # LocaleDataMetaInfo-XLocales.java.template in <ws>/src/share/classes/sun/util
31 #
32 # SORT, NAWK & SED is passed in as environment variables.
33 #
34
35 # A list of resource base name list;
36 RESOURCE_NAMES=$1
37
38 # A list of EN resources;
39 EN_FILES_LIST=$2
40
41 # A list of non-EN resources;
42 NONEN_FILES_LIST=$3
43
44 INPUT_FILE=$4
45 OUTPUT_FILE=$5
46
47 localelist=
48 getlocalelist() {
49 localelist=""
50 localelist=`$NAWK -F$1_ '{print $2}' $2 | $SORT | $SED -e 's/_/-/g'`
51 }
52
53 sed_script="$SED -e \"s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@\" "
54
55 # ja-JP-JP and th-TH-TH need to be manually added, as they don't have any resource files.
56 nonenall=" ja-JP-JP th-TH-TH "
57
58 for FILE in $RESOURCE_NAMES
59 do
60 getlocalelist $FILE $EN_FILES_LIST
61 sed_script=$sed_script"-e \"s@#"$FILE"_ENLocales#@$localelist@g\" "
62 enall=$enall" "$localelist
63 getlocalelist $FILE $NONEN_FILES_LIST
64 sed_script=$sed_script"-e \"s@#"$FILE"_NonENLocales#@$localelist@g\" "
65 nonenall=$nonenall" "$localelist
66 done
67
68 enall=`(for LOC in $enall; do echo $LOC;done) |$SORT -u`
69 nonenall=`(for LOC in $nonenall; do echo $LOC;done) |$SORT -u`
70
71 sed_script=$sed_script"-e \"s@#AvailableLocales_ENLocales#@$enall@g\" "
72 sed_script=$sed_script"-e \"s@#AvailableLocales_NonENLocales#@$nonenall@g\" "
73
74 sed_script=$sed_script"$INPUT_FILE > $OUTPUT_FILE"
75 eval $sed_script
|