United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6482445 j2se/make/java/java/localegen.sh uses 'sort' from PATH, could get system32/sort
JDK-6482445 : j2se/make/java/java/localegen.sh uses 'sort' from PATH, could get system32/sort

Details
Type:
Bug
Submit Date:
2006-10-16
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
infrastructure
OS:
generic
Sub-Component:
build
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
The script j2se/make/java/java/localegen.sh uses 'sort' from the PATH setting, I suspect that this will be a problem for anyone with a PATH order where the unix utilities are after the system32 paths.

                                    

Comments
EVALUATION

Should be simple script fix, or adding a SORT argument.
                                     
2008-03-19
SUGGESTED FIX

diff --git a/make/java/java/genlocales.gmk b/make/java/java/genlocales.gmk
--- a/make/java/java/genlocales.gmk
+++ b/make/java/java/genlocales.gmk
@@ -80,7 +80,8 @@ RESOURCE_NAMES="FormatData CollationData
        @$(ECHO) $(subst .java,'\n',$(Euro_Resources_java)) >> $@.tmp.euro;
        @$(ECHO) $(subst .properties,'\n',$(NonEuro_Resources_properties)) > $@.tmp.noneuro;
        @$(ECHO) $(subst .java,'\n',$(NonEuro_Resources_java)) >> $@.tmp.noneuro;
-       NAWK=$(NAWK) SED=$(SED) $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \
+       NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \
+            $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \
                $@.tmp.noneuro $< $@
        @$(RM) $@.tmp.euro $@.tmp.noneuro;
 
diff --git a/make/java/java/localegen.sh b/make/java/java/localegen.sh
--- a/make/java/java/localegen.sh
+++ b/make/java/java/localegen.sh
@@ -29,7 +29,7 @@
 # This script is to generate the supported locale list string and replace the
 # LocaleDataMetaInfo-XLocales.java in <ws>/src/share/classes/sun/util
 # 
-# NAWK & SED is passed in as environment variables.
+# SORT, NAWK & SED is passed in as environment variables.
 #
 
 # A list of resource base name list;
@@ -47,7 +47,7 @@ localelist=
 localelist=
 getlocalelist() {
     localelist=""
-    localelist=`$NAWK -F$1_ '{print $2}' $2 | sort`
+    localelist=`$NAWK -F$1_ '{print $2}' $2 | $SORT`
 }
 
 sed_script="$SED -e \"s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@\" "
                                     
2008-03-28
EVALUATION

http://hg.openjdk.java.net/jdk7/build/jdk/rev/e6157955511e
                                     
2008-04-01



Hardware and Software, Engineered to Work Together