common/bin/compare.sh
changeset 27595 cff167b3bfa2
parent 25854 98ce0879ab4c
child 27602 236555ddac42
equal deleted inserted replaced
27594:e425f93c3dda 27595:cff167b3bfa2
    20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    21 # or visit www.oracle.com if you need additional information or have any
    21 # or visit www.oracle.com if you need additional information or have any
    22 # questions.
    22 # questions.
    23 #
    23 #
    24 
    24 
    25 # This script is processed by configure before it's usable. It is run from 
    25 # This script is processed by configure before it's usable. It is run from
    26 # the root of the build directory.
    26 # the root of the build directory.
    27 
    27 
    28 
    28 
    29 ##########################################################################################
    29 ##########################################################################################
    30 
    30 
    74     SUFFIX="${THIS_FILE##*.}"
    74     SUFFIX="${THIS_FILE##*.}"
    75 
    75 
    76     TMP=1
    76     TMP=1
    77 
    77 
    78     if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then
    78     if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then
       
    79         # Filter out date string, ant version and java version differences.
    79         TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
    80         TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
    80             $GREP '^[<>]' | \
    81             $GREP '^[<>]' | \
    81             $SED -e '/[<>] Ant-Version: Apache Ant .*/d' \
    82             $SED -e '/[<>] Ant-Version: Apache Ant .*/d' \
    82 	         -e '/[<>] Created-By: .* (Oracle Corporation).*/d')
    83                  -e '/[<>] Created-By: .* (Oracle [Corpatin)]*/d' \
       
    84                  -e '/[<>]  [Corpatin]*)/d' \
       
    85                  -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d')
    83     fi
    86     fi
    84     if test "x$SUFFIX" = "xjava"; then
    87     if test "x$SUFFIX" = "xjava"; then
    85         TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
    88         TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
    86             $GREP '^[<>]' | \
    89             $GREP '^[<>]' | \
    87             $SED -e '/[<>] \* from.*\.idl/d' \
    90             $SED -e '/[<>] \* from.*\.idl/d' \
    90                  -e '/\/\/ Generated from input file.*/d' \
    93                  -e '/\/\/ Generated from input file.*/d' \
    91                  -e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \
    94                  -e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \
    92                  -e '/\/\/ java GenerateCharacter.*/d')
    95                  -e '/\/\/ java GenerateCharacter.*/d')
    93     fi
    96     fi
    94     # Ignore date strings in class files.
    97     # Ignore date strings in class files.
    95     # On Macosx the system sources for generated java classes produce different output on 
    98     # On Macosx the system sources for generated java classes produce different output on
    96     # consequtive invocations seemingly randomly.
    99     # consequtive invocations seemingly randomly.
    97     # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this.
   100     # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this.
    98     # Anonymous lambda classes get randomly assigned counters in their names.
   101     # Anonymous lambda classes get randomly assigned counters in their names.
    99     if test "x$SUFFIX" = "xclass"; then
   102     if test "x$SUFFIX" = "xclass"; then
   100         # To improve performance when large diffs are found, do a rough filtering of classes
   103         # To improve performance when large diffs are found, do a rough filtering of classes
   101         # elibeble for these exceptions
   104         # elibeble for these exceptions
   102         if $GREP -R -e '[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}' \
   105         if $GREP -R -e '[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}' \
   103 	        -e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \
   106                 -e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \
   104 	        -e thePoint -e aPoint -e setItemsPtr \
   107                 -e thePoint -e aPoint -e setItemsPtr \
   105                 -e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null; then
   108                 -e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null; then
   106             $JAVAP -c -constants -l -p ${OTHER_FILE} >  ${OTHER_FILE}.javap
   109             $JAVAP -c -constants -l -p ${OTHER_FILE} >  ${OTHER_FILE}.javap
   107             $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap
   110             $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap
   108             TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
   111             TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
   109                 $GREP '^[<>]' | \
   112                 $GREP '^[<>]' | \
   110                 $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
   113                 $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
   111 		     -e '/[0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}/d' \
   114                      -e '/[0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}/d' \
   112  	             -e '/[<>].*Point   Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \
   115                      -e '/[<>].*Point   Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \
   113 	             -e '/[<>].*public com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*itemsPtr();/d' \
   116                      -e '/[<>].*public com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*itemsPtr();/d' \
   114 	             -e '/[<>].*public void setItemsPtr(com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*);/d' \
   117                      -e '/[<>].*public void setItemsPtr(com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*);/d' \
   115                      -e '/[<>].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d')
   118                      -e '/[<>].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d')
   116         fi
   119         fi
   117     fi
   120     fi
   118     if test "x$SUFFIX" = "xproperties"; then
   121     if test "x$SUFFIX" = "xproperties"; then
   119         # Run through nawk to add possibly missing newline at end of file.
   122         # Run through nawk to add possibly missing newline at end of file.
   120         $CAT $OTHER_FILE | $NAWK '{ print }' | LC_ALL=C $SORT > $OTHER_FILE.cleaned
   123         $CAT $OTHER_FILE | $NAWK '{ print }' | LC_ALL=C $SORT > $OTHER_FILE.cleaned
   121 # Disable this exception since we aren't changing the properties cleaning method yet.
   124 # Disable this exception since we aren't changing the properties cleaning method yet.
   122 #        $CAT $OTHER_FILE | $SED -e 's/\([^\\]\):/\1\\:/g' -e  's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
   125 #        $CAT $OTHER_FILE | $SED -e 's/\([^\\]\):/\1\\:/g' -e  's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
   123 #            | $SED -f "$SRC_ROOT/common/makefiles/support/unicode2x.sed" \
   126 #            | $SED -f "$SRC_ROOT/common/makefiles/support/unicode2x.sed" \
   124 #  	    | $SED -e '/^#/d' -e '/^$/d' \
   127 #            | $SED -e '/^#/d' -e '/^$/d' \
   125 #            -e :a -e '/\\$/N; s/\\\n//; ta' \
   128 #            -e :a -e '/\\$/N; s/\\\n//; ta' \
   126 #  	    -e 's/^[ \t]*//;s/[ \t]*$//' \
   129 #            -e 's/^[ \t]*//;s/[ \t]*$//' \
   127 #	    -e 's/\\=/=/' | LC_ALL=C $SORT > $OTHER_FILE.cleaned
   130 #            -e 's/\\=/=/' | LC_ALL=C $SORT > $OTHER_FILE.cleaned
   128         # Filter out date string differences.
   131         # Filter out date string differences.
   129         TMP=$(LC_ALL=C $DIFF $OTHER_FILE.cleaned $THIS_FILE | \
   132         TMP=$(LC_ALL=C $DIFF $OTHER_FILE.cleaned $THIS_FILE | \
   130             $GREP '^[<>]' | \
   133             $GREP '^[<>]' | \
   131             $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d')
   134             $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d')
   132     fi
   135     fi
   133     if test "x$SUFFIX" = "xMF"; then
   136     if test "x$SUFFIX" = "xhtml"; then
   134         # Filter out date string differences.
       
   135         TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
   137         TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
   136             $GREP '^[<>]' | \
   138             $GREP '^[<>]' | \
   137             $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d')
   139             $SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' )
   138     fi
   140     fi
   139     if test -n "$TMP"; then
   141     if test -n "$TMP"; then
   140         echo Files $OTHER_FILE and $THIS_FILE differ
   142         echo Files $OTHER_FILE and $THIS_FILE differ
   141         return 1
   143         return 1
   142     fi
   144     fi
   156 
   158 
   157     (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other)
   159     (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other)
   158     (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this)
   160     (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this)
   159 
   161 
   160     $DIFF $WORK_DIR/dirs_other $WORK_DIR/dirs_this > $WORK_DIR/dirs_diff
   162     $DIFF $WORK_DIR/dirs_other $WORK_DIR/dirs_this > $WORK_DIR/dirs_diff
   161     
   163 
   162     echo -n Directory structure...
   164     echo -n Directory structure...
   163     if [ -s $WORK_DIR/dirs_diff ]; then
   165     if [ -s $WORK_DIR/dirs_diff ]; then
   164         echo Differences found.
   166         echo Differences found.
   165         REGRESSIONS=true
   167         REGRESSIONS=true
   166         # Differences in directories found.
   168         # Differences in directories found.
   190 
   192 
   191     $MKDIR -p $WORK_DIR
   193     $MKDIR -p $WORK_DIR
   192 
   194 
   193     (cd $OTHER_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_other)
   195     (cd $OTHER_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_other)
   194     (cd $THIS_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_this)
   196     (cd $THIS_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_this)
   195     
   197 
   196     $DIFF $WORK_DIR/files_other $WORK_DIR/files_this > $WORK_DIR/files_diff
   198     $DIFF $WORK_DIR/files_other $WORK_DIR/files_this > $WORK_DIR/files_diff
   197 
   199 
   198     echo -n File names...
   200     echo -n File names...
   199     if [ -s $WORK_DIR/files_diff ]; then
   201     if [ -s $WORK_DIR/files_diff ]; then
   200         echo Differences found.
   202         echo Differences found.
   234         if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
   236         if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
   235         OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
   237         OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
   236         TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
   238         TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
   237         if [ "$OP" != "$TP" ]
   239         if [ "$OP" != "$TP" ]
   238         then
   240         then
   239 	    if [ -z "$found" ]; then echo ; found="yes"; fi
   241             if [ -z "$found" ]; then echo ; found="yes"; fi
   240 	    $PRINTF "\told: ${OP} new: ${TP}\t$f\n"
   242             $PRINTF "\tother: ${OP} this: ${TP}\t$f\n"
   241         fi
   243         fi
   242     done
   244     done
   243     if [ -z "$found" ]; then 
   245     if [ -z "$found" ]; then
   244         echo "Identical!"
   246         echo "Identical!"
   245     else
   247     else
   246         REGRESSIONS=true
   248         REGRESSIONS=true
   247     fi
   249     fi
   248 }
   250 }
   263     do
   265     do
   264         if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
   266         if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
   265         if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
   267         if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
   266         OF=`cd ${OTHER_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
   268         OF=`cd ${OTHER_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
   267         TF=`cd ${THIS_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
   269         TF=`cd ${THIS_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
   268         if [ "$f" = "./src.zip" ] || [[ "$f" = *"/Home/src.zip" ]] || [[ "$f" = *"/lib/JObjC.jar" ]]
       
   269         then
       
   270 	    if [ "`echo $OF | $GREP -ic zip`" -gt 0 -a "`echo $TF | $GREP -ic zip`" -gt 0 ]
       
   271 	    then
       
   272 	        # the way we produces zip-files make it so that directories are stored in old file
       
   273 	        # but not in new (only files with full-path)
       
   274 	        # this makes file-5.09 report them as different
       
   275 	        continue;
       
   276 	    fi
       
   277         fi
       
   278         
       
   279         if [ "$OF" != "$TF" ]
   270         if [ "$OF" != "$TF" ]
   280         then
   271         then
   281 	    if [ -z "$found" ]; then echo ; found="yes"; fi
   272             if [ "`echo $OF | $GREP -c 'Zip archive data'`" -gt 0 ] \
   282 	    $PRINTF "\tother: ${OF}\n\tthis : ${TF}\n"
   273                 && [ "`echo $TF | $GREP -c 'Zip archive data'`" -gt 0 ]
       
   274             then
       
   275                 # the way we produce zip-files make it so that directories are stored in
       
   276                 # old file but not in new (only files with full-path) this makes file
       
   277                 # report them as different
       
   278                 continue
       
   279             else
       
   280                 if [ -z "$found" ]; then echo ; found="yes"; fi
       
   281                 $PRINTF "\tother: ${OF}\n\tthis : ${TF}\n"
       
   282             fi
   283         fi
   283         fi
   284     done
   284     done
   285     if [ -z "$found" ]; then 
   285     if [ -z "$found" ]; then
   286         echo "Identical!"
   286         echo "Identical!"
   287     else
   287     else
   288         REGRESSIONS=true
   288         REGRESSIONS=true
   289     fi
   289     fi
   290 }
   290 }
   294 
   294 
   295 compare_general_files() {
   295 compare_general_files() {
   296     THIS_DIR=$1
   296     THIS_DIR=$1
   297     OTHER_DIR=$2
   297     OTHER_DIR=$2
   298     WORK_DIR=$3
   298     WORK_DIR=$3
   299     
   299 
   300     GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
   300     GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
   301         ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
   301         ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
   302         ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
   302         ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" ! -name "*.cpl" \
   303         ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
   303         ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
   304         ! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" \
   304         ! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" ! -name "*.jmod" \
       
   305         ! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" ! -name "JavaUpdater" \
   305         | $GREP -v "./bin/"  | $SORT | $FILTER)
   306         | $GREP -v "./bin/"  | $SORT | $FILTER)
   306 
   307 
   307     echo General files...
   308     echo General files...
   308     for f in $GENERAL_FILES
   309     for f in $GENERAL_FILES
   309     do
   310     do
   375     fi
   376     fi
   376 
   377 
   377     THIS_SUFFIX="${THIS_ZIP##*.}"
   378     THIS_SUFFIX="${THIS_ZIP##*.}"
   378     OTHER_SUFFIX="${OTHER_ZIP##*.}"
   379     OTHER_SUFFIX="${OTHER_ZIP##*.}"
   379     if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then
   380     if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then
   380         echo The files do not have the same suffix type!
   381         echo "The files do not have the same suffix type! ($THIS_SUFFIX != $OTHER_SUFFIX)"
   381         return 2
   382         return 2
   382     fi
   383     fi
   383 
   384 
   384     TYPE="$THIS_SUFFIX"
   385     TYPE="$THIS_SUFFIX"
   385 
   386 
   387     then
   388     then
   388         return 0
   389         return 0
   389     fi
   390     fi
   390     # Not quite identical, the might still contain the same data.
   391     # Not quite identical, the might still contain the same data.
   391     # Unpack the jar/zip files in temp dirs
   392     # Unpack the jar/zip files in temp dirs
   392     
   393 
   393     THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this
   394     THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this
   394     OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other
   395     OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other
   395     $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
   396     $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
   396     $MKDIR -p $THIS_UNZIPDIR
   397     $MKDIR -p $THIS_UNZIPDIR
   397     $MKDIR -p $OTHER_UNZIPDIR
   398     $MKDIR -p $OTHER_UNZIPDIR
   456             | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
   457             | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
   457     fi
   458     fi
   458 
   459 
   459     $RM -f $WORK_DIR/$ZIP_FILE.diffs
   460     $RM -f $WORK_DIR/$ZIP_FILE.diffs
   460     for file in $DIFFING_FILES; do
   461     for file in $DIFFING_FILES; do
   461 	if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then
   462         if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then
   462             diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs
   463             diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs
   463 	fi
   464         fi
   464     done
   465     done
   465 
   466 
   466     if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then
   467     if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then
   467         return_value=1
   468         return_value=1
   468         echo "        Differing files in $ZIP_FILE"
   469         echo "        Differing files in $ZIP_FILE"
   565     WORK_FILE_BASE=$WORK_DIR/$BIN_FILE
   566     WORK_FILE_BASE=$WORK_DIR/$BIN_FILE
   566     FILE_WORK_DIR=$(dirname $WORK_FILE_BASE)
   567     FILE_WORK_DIR=$(dirname $WORK_FILE_BASE)
   567 
   568 
   568     $MKDIR -p $FILE_WORK_DIR
   569     $MKDIR -p $FILE_WORK_DIR
   569 
   570 
       
   571     # Make soft links to original files from work dir to facilitate debugging
       
   572     $LN -f -s $THIS_FILE $WORK_FILE_BASE.this
       
   573     $LN -f -s $OTHER_FILE $WORK_FILE_BASE.other
       
   574 
   570     ORIG_THIS_FILE="$THIS_FILE"
   575     ORIG_THIS_FILE="$THIS_FILE"
   571     ORIG_OTHER_FILE="$OTHER_FILE"
   576     ORIG_OTHER_FILE="$OTHER_FILE"
   572 
   577 
   573     if [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then
   578     if [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then
   574         THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME
   579         THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME
   581         THIS_FILE="$THIS_STRIPPED_FILE"
   586         THIS_FILE="$THIS_STRIPPED_FILE"
   582         OTHER_FILE="$OTHER_STRIPPED_FILE"
   587         OTHER_FILE="$OTHER_STRIPPED_FILE"
   583     fi
   588     fi
   584 
   589 
   585     if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
   590     if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
   586 	unset _NT_SYMBOL_PATH
   591         unset _NT_SYMBOL_PATH
   587 	# On windows we need to unzip the debug symbols, if present
   592         # On windows we need to unzip the debug symbols, if present
   588 	OTHER_FILE_BASE=${OTHER_FILE/.dll/}
   593         OTHER_FILE_BASE=${OTHER_FILE/.dll/}
   589 	OTHER_FILE_BASE=${OTHER_FILE_BASE/.exe/}
   594         OTHER_FILE_BASE=${OTHER_FILE_BASE/.exe/}
   590 	DIZ_NAME=$(basename $OTHER_FILE_BASE).diz
   595         OTHER_FILE_BASE=${OTHER_FILE_BASE/.cpl/}
       
   596         DIZ_NAME=$(basename $OTHER_FILE_BASE).diz
   591         # java.exe and java.dll diz files will have the same name. Have to
   597         # java.exe and java.dll diz files will have the same name. Have to
   592 	# make sure java.exe gets the right one. This is only needed for 
   598         # make sure java.exe gets the right one. This is only needed for
   593 	# OTHER since in the new build, all pdb files are left around.
   599         # OTHER since in the new build, all pdb files are left around.
   594 	if [ "$NAME" = "java.exe" ] && [ -f "$OTHER/tmp/java/java/obj64/java.diz" ]; then
   600         if [ "$NAME" = "java.exe" ] && [ -f "$OTHER/tmp/java/java/obj64/java.diz" ]; then
   595 	    OTHER_DIZ_FILE="$OTHER/tmp/java/java/obj64/java.diz"
   601             OTHER_DIZ_FILE="$OTHER/tmp/java/java/obj64/java.diz"
   596 	elif [ -f "${OTHER_FILE_BASE}.diz" ]; then
   602         elif [ -f "${OTHER_FILE_BASE}.diz" ]; then
   597 	    OTHER_DIZ_FILE=${OTHER_FILE_BASE}.diz
   603             OTHER_DIZ_FILE=${OTHER_FILE_BASE}.diz
   598 	else
   604         else
   599             # Some files, jli.dll, appears twice in the image but only one of
   605             # Some files, jli.dll, appears twice in the image but only one of
   600 	    # thme has a diz file next to it.
   606             # thme has a diz file next to it.
   601 	    OTHER_DIZ_FILE="$($FIND $OTHER_DIR -name $DIZ_NAME | $SED 1q)"
   607             OTHER_DIZ_FILE="$($FIND $OTHER_DIR -name $DIZ_NAME | $SED 1q)"
   602 	    if [ ! -f "$OTHER_DIZ_FILE" ]; then
   608             if [ ! -f "$OTHER_DIZ_FILE" ]; then
   603 		# As a last resort, look for diz file in the whole build output
   609                 # As a last resort, look for diz file in the whole build output
   604 		# dir.
   610                 # dir.
   605 		OTHER_DIZ_FILE="$($FIND $OTHER -name $DIZ_NAME | $SED 1q)"
   611                 OTHER_DIZ_FILE="$($FIND $OTHER -name $DIZ_NAME | $SED 1q)"
   606 	    fi
   612             fi
   607 	fi
   613         fi
   608 	if [ -n "$OTHER_DIZ_FILE" ]; then
   614         if [ -n "$OTHER_DIZ_FILE" ]; then
   609 	    $MKDIR -p $FILE_WORK_DIR/other
   615             $MKDIR -p $FILE_WORK_DIR/other
   610 	    (cd $FILE_WORK_DIR/other ; $UNARCHIVE -o $OTHER_DIZ_FILE)
   616             (cd $FILE_WORK_DIR/other ; $UNARCHIVE -o $OTHER_DIZ_FILE)
   611 	    export _NT_SYMBOL_PATH="$FILE_WORK_DIR/other"
   617             export _NT_SYMBOL_PATH="$FILE_WORK_DIR/other"
   612 	fi
   618         fi
   613 	THIS_FILE_BASE=${THIS_FILE/.dll/}
   619         THIS_FILE_BASE=${THIS_FILE/.dll/}
   614 	THIS_FILE_BASE=${THIS_FILE_BASE/.exe/}
   620         THIS_FILE_BASE=${THIS_FILE_BASE/.exe/}
   615 	if [ -f "${THIS_FILE/.dll/}.diz" ]; then
   621         if [ -f "${THIS_FILE/.dll/}.diz" ]; then
   616 	    THIS_DIZ_FILE=${THIS_FILE/.dll/}.diz
   622             THIS_DIZ_FILE=${THIS_FILE/.dll/}.diz
   617 	else
   623         else
   618 	    THIS_DIZ_FILE="$($FIND $THIS_DIR -name $DIZ_NAME | $SED 1q)"
   624             THIS_DIZ_FILE="$($FIND $THIS_DIR -name $DIZ_NAME | $SED 1q)"
   619 	    if [ ! -f "$THIS_DIZ_FILE" ]; then
   625             if [ ! -f "$THIS_DIZ_FILE" ]; then
   620 		# As a last resort, look for diz file in the whole build output
   626                 # As a last resort, look for diz file in the whole build output
   621 		# dir.
   627                 # dir.
   622 		THIS_DIZ_FILE="$($FIND $THIS -name $DIZ_NAME | $SED 1q)"
   628                 THIS_DIZ_FILE="$($FIND $THIS -name $DIZ_NAME | $SED 1q)"
   623 	    fi
   629             fi
   624 	fi
   630         fi
   625 	if [ -n "$THIS_DIZ_FILE" ]; then
   631         if [ -n "$THIS_DIZ_FILE" ]; then
   626 	    $MKDIR -p $FILE_WORK_DIR/this
   632             $MKDIR -p $FILE_WORK_DIR/this
   627 	    (cd $FILE_WORK_DIR/this ; $UNARCHIVE -o $THIS_DIZ_FILE)
   633             (cd $FILE_WORK_DIR/this ; $UNARCHIVE -o $THIS_DIZ_FILE)
   628 	    export _NT_SYMBOL_PATH="$_NT_SYMBOL_PATH;$FILE_WORK_DIR/this"
   634             export _NT_SYMBOL_PATH="$_NT_SYMBOL_PATH;$FILE_WORK_DIR/this"
   629 	fi
   635         fi
   630     fi
   636     fi
   631 
   637 
   632     if [ -z "$SKIP_BIN_DIFF" ]; then
   638     if [ -z "$SKIP_BIN_DIFF" ]; then
   633         if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
   639         if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
   634         # The files were bytewise identical.
   640         # The files were bytewise identical.
   635             if [ -n "$VERBOSE" ]; then
   641             if [ -n "$VERBOSE" ]; then
   636                 echo "        :           :         :         :          : $BIN_FILE"
   642                 echo "        :           :         :         :          :          : $BIN_FILE"
   637             fi
   643             fi
   638             return 0
   644             return 0
   639         fi
   645         fi
   640         BIN_MSG=" diff "
   646         BIN_MSG=" diff "
   641         if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then
   647         if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then
   662     if [ $THIS_SIZE -ne $OTHER_SIZE ]; then
   668     if [ $THIS_SIZE -ne $OTHER_SIZE ]; then
   663         DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE)
   669         DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE)
   664         DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE)
   670         DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE)
   665         SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM)
   671         SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM)
   666         if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] \
   672         if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] \
   667 	    && [ "$DIFF_SIZE_REL" -lt 102 ]; then
   673             && [ "$DIFF_SIZE_REL" -lt 102 ]; then
   668             SIZE_MSG="($SIZE_MSG)"
   674             SIZE_MSG="($SIZE_MSG)"
   669             DIFF_SIZE=
   675             DIFF_SIZE=
   670         elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
   676         elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
   671 	    && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
   677             && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
   672 	    && [ "$DIFF_SIZE_NUM" = 512 ]; then
   678             && [ "$DIFF_SIZE_NUM" = 512 ]; then
   673 	    # On windows, size of binaries increase in 512 increments.
   679             # On windows, size of binaries increase in 512 increments.
   674             SIZE_MSG="($SIZE_MSG)"
   680             SIZE_MSG="($SIZE_MSG)"
   675             DIFF_SIZE=
   681             DIFF_SIZE=
   676         elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
   682         elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
   677 	    && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
   683             && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
   678 	    && [ "$DIFF_SIZE_NUM" = -512 ]; then
   684             && [ "$DIFF_SIZE_NUM" = -512 ]; then
   679 	    # On windows, size of binaries increase in 512 increments.
   685             # On windows, size of binaries increase in 512 increments.
   680             SIZE_MSG="($SIZE_MSG)"
   686             SIZE_MSG="($SIZE_MSG)"
   681             DIFF_SIZE=
   687             DIFF_SIZE=
   682         else
   688         else
   683             if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
   689             if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
   684                 DIFF_SIZE=true
   690                 DIFF_SIZE=true
   709 
   715 
   710     # Check symbols
   716     # Check symbols
   711     if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
   717     if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
   712         # The output from dumpbin on windows differs depending on if the debug symbol
   718         # The output from dumpbin on windows differs depending on if the debug symbol
   713         # files are still around at the location the binary is pointing too. Need
   719         # files are still around at the location the binary is pointing too. Need
   714 	# to filter out that extra information.
   720         # to filter out that extra information.
   715 	$DUMPBIN -exports $OTHER_FILE | $GREP  -E '^ +[0-9A-F]+ +[0-9A-F]+ [0-9A-F]+' | sed 's/ = .*//g' | cut -c27- | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
   721         $DUMPBIN -exports $OTHER_FILE | $GREP  -E '^ +[0-9A-F]+ +[0-9A-F]+ [0-9A-F]+' | sed 's/ = .*//g' | cut -c27- | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
   716 	$DUMPBIN -exports $THIS_FILE  | $GREP  -E '^ +[0-9A-F]+ +[0-9A-F]+ [0-9A-F]+' | sed 's/ = .*//g' | cut -c27- | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
   722         $DUMPBIN -exports $THIS_FILE  | $GREP  -E '^ +[0-9A-F]+ +[0-9A-F]+ [0-9A-F]+' | sed 's/ = .*//g' | cut -c27- | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
   717     elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
   723     elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
   718         # Some symbols get seemingly random 15 character prefixes. Filter them out.
   724         # Some symbols get seemingly random 15 character prefixes. Filter them out.
   719         $NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
   725         $NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
   720 	$NM -a $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
   726         $NM -a $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
   721     else
   727     else
   722 	$NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
   728         $NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
   723 	$NM -a $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
   729         $NM -a $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
   724     fi
   730     fi
   725     
   731 
   726     LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
   732     LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
   727     if [ -s $WORK_FILE_BASE.symbols.diff ]; then
   733     if [ -s $WORK_FILE_BASE.symbols.diff ]; then
   728         SYM_MSG=" diff  "
   734         SYM_MSG=" diff  "
   729         if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then
   735         if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then
   730             DIFF_SYM=true
   736             DIFF_SYM=true
   733                 REGRESSIONS=true
   739                 REGRESSIONS=true
   734             else
   740             else
   735                 SYM_MSG=" $SYM_MSG "
   741                 SYM_MSG=" $SYM_MSG "
   736             fi
   742             fi
   737         else
   743         else
   738             SYM_MSG="($SYM_MSG)"            
   744             SYM_MSG="($SYM_MSG)"
   739             DIFF_SYM=
   745             DIFF_SYM=
   740         fi
   746         fi
   741     else
   747     else
   742         SYM_MSG="         "
   748         SYM_MSG="         "
   743         DIFF_SYM=
   749         DIFF_SYM=
   746         fi
   752         fi
   747     fi
   753     fi
   748 
   754 
   749     # Check dependencies
   755     # Check dependencies
   750     if [ -n "$LDD_CMD" ]; then
   756     if [ -n "$LDD_CMD" ]; then
   751 	(cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
   757         (cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
   752 	(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
   758         (cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
   753 	(cd $FILE_WORK_DIR && $RM -f $NAME)
   759         (cd $FILE_WORK_DIR && $RM -f $NAME)
   754 	
   760 
   755 	LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
   761         LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
   756 	LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq
   762         LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq
   757 	
   763 
   758 	if [ -s $WORK_FILE_BASE.deps.diff ]; then
   764         if [ -s $WORK_FILE_BASE.deps.diff ]; then
   759             if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then
   765             if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then
   760 		DEP_MSG=" diff  "
   766                 DEP_MSG=" diff  "
   761             else
   767             else
   762 		DEP_MSG=" redun "
   768                 DEP_MSG=" redun "
   763             fi
   769             fi
   764             if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then
   770             if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then
   765 		DIFF_DEP=true
   771                 DIFF_DEP=true
   766 		if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then
   772                 if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then
   767                     DEP_MSG="*$DEP_MSG*"
   773                     DEP_MSG="*$DEP_MSG*"
   768                     REGRESSIONS=true
   774                     REGRESSIONS=true
   769 		else
   775                 else
   770                     DEP_MSG=" $DEP_MSG "
   776                     DEP_MSG=" $DEP_MSG "
   771 		fi
   777                 fi
   772             else
   778             else
   773 		DEP_MSG="($DEP_MSG)"
   779                 DEP_MSG="($DEP_MSG)"
   774 		DIFF_DEP=
   780                 DIFF_DEP=
   775             fi
   781             fi
   776 	else
   782         else
   777 	    DEP_MSG="         "
   783             DEP_MSG="         "
   778 	    DIFF_DEP=
   784             DIFF_DEP=
   779             if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
   785             if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
   780                 DEP_MSG="     !      "
   786                 DEP_MSG="     !      "
   781             fi
   787             fi
   782 	fi
   788         fi
   783     else
   789     else
   784 	DEP_MSG="    -    "
   790         DEP_MSG="    -    "
   785     fi
   791     fi
   786     
   792 
   787     # Compare fulldump output
   793     # Compare fulldump output
   788     if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then
   794     if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then
   789         $FULLDUMP_CMD $OTHER_FILE > $WORK_FILE_BASE.fulldump.other 2>&1
   795         $FULLDUMP_CMD $OTHER_FILE > $WORK_FILE_BASE.fulldump.other 2>&1
   790         $FULLDUMP_CMD $THIS_FILE > $WORK_FILE_BASE.fulldump.this 2>&1
   796         $FULLDUMP_CMD $THIS_FILE > $WORK_FILE_BASE.fulldump.this 2>&1
   791         LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff
   797         LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff
   792         
   798 
   793         if [ -s $WORK_FILE_BASE.fulldump.diff ]; then
   799         if [ -s $WORK_FILE_BASE.fulldump.diff ]; then
   794             ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}')
   800             ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}')
   795             ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE)
   801             ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE)
   796             if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then
   802             if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then
   797                 DIFF_ELF=true
   803                 DIFF_ELF=true
   814         fi
   820         fi
   815     fi
   821     fi
   816 
   822 
   817     # Compare disassemble output
   823     # Compare disassemble output
   818     if [ -n "$DIS_CMD" ] && [ -z "$SKIP_DIS_DIFF" ]; then
   824     if [ -n "$DIS_CMD" ] && [ -z "$SKIP_DIS_DIFF" ]; then
   819 	if [ -z "$DIS_DIFF_FILTER" ]; then
   825         # By default we filter out differences that include references to symbols.
   820 	    DIS_DIFF_FILTER="$CAT"
   826         # To get a raw diff with the complete disassembly, set
   821 	fi
   827         # DIS_DIFF_FILTER="$CAT"
   822         $DIS_CMD $OTHER_FILE | $GREP -v $NAME | $DIS_DIFF_FILTER > $WORK_FILE_BASE.dis.other 2>&1
   828         if [ -z "$DIS_DIFF_FILTER" ]; then
   823         $DIS_CMD $THIS_FILE  | $GREP -v $NAME | $DIS_DIFF_FILTER > $WORK_FILE_BASE.dis.this  2>&1
   829             DIS_DIFF_FILTER="$GREP -v ' # .* <.*>$'"
   824         
   830         fi
       
   831         $DIS_CMD $OTHER_FILE | $GREP -v $NAME | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.other 2>&1
       
   832         $DIS_CMD $THIS_FILE  | $GREP -v $NAME | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this  2>&1
       
   833 
   825         LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
   834         LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
   826         
   835 
   827         if [ -s $WORK_FILE_BASE.dis.diff ]; then
   836         if [ -s $WORK_FILE_BASE.dis.diff ]; then
   828             DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}')
   837             DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}')
   829             DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE)
   838             DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE)
   830             if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then
   839             if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then
   831                 DIFF_DIS=true
   840                 DIFF_DIS=true
   899 compare_all_libs() {
   908 compare_all_libs() {
   900     THIS_DIR=$1
   909     THIS_DIR=$1
   901     OTHER_DIR=$2
   910     OTHER_DIR=$2
   902     WORK_DIR=$3
   911     WORK_DIR=$3
   903 
   912 
   904     LIBS=$(cd $THIS_DIR && $FIND . -type f \( -name 'lib*.so' -o -name '*.dylib' -o -name '*.dll' -o -name 'JavaControlPanel' \) | $SORT | $FILTER)
   913     LIBS=$(cd $THIS_DIR && $FIND . -type f \( -name 'lib*.so' -o -name '*.dylib' \
       
   914         -o -name '*.dll' -o -name '*.obj' -o -name '*.o' \
       
   915         -o -name '*.cpl' \) | $SORT | $FILTER)
   905 
   916 
   906     if [ -n "$LIBS" ]; then
   917     if [ -n "$LIBS" ]; then
   907         echo Libraries...
   918         echo Libraries...
   908         print_binary_diff_header
   919         print_binary_diff_header
   909         for l in $LIBS; do
   920         for l in $LIBS; do
   959 
   970 
   960 COMPARE_ROOT=/tmp/cimages.$USER
   971 COMPARE_ROOT=/tmp/cimages.$USER
   961 $MKDIR -p $COMPARE_ROOT
   972 $MKDIR -p $COMPARE_ROOT
   962 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
   973 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
   963     if [ "$(uname -o)" = "Cygwin" ]; then
   974     if [ "$(uname -o)" = "Cygwin" ]; then
   964 	COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT)
   975         COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT)
   965     fi
   976     fi
   966 fi
   977 fi
   967 
   978 
   968 THIS="$( cd "$( dirname "$0" )" && pwd )"
   979 THIS="$( cd "$( dirname "$0" )" && pwd )"
   969 echo "$THIS"
   980 echo "$THIS"
  1083             CMP_TYPES=false
  1094             CMP_TYPES=false
  1084             CMP_ZIPS=true
  1095             CMP_ZIPS=true
  1085             CMP_JARS=true
  1096             CMP_JARS=true
  1086             CMP_LIBS=true
  1097             CMP_LIBS=true
  1087             CMP_EXECS=true
  1098             CMP_EXECS=true
  1088             
  1099 
  1089             if [ -z "$FILTER" ]; then
  1100             if [ -z "$FILTER" ]; then
  1090                 FILTER="$GREP"
  1101                 FILTER="$GREP"
  1091             fi
  1102             fi
  1092             FILTER="$FILTER -e $1"
  1103             FILTER="$FILTER -e $1"
  1093             ;;
  1104             ;;
  1134     FILTER="$CAT"
  1145     FILTER="$CAT"
  1135 fi
  1146 fi
  1136 
  1147 
  1137 if [ "$SKIP_DEFAULT" != "true" ]; then
  1148 if [ "$SKIP_DEFAULT" != "true" ]; then
  1138     if [ -z "$OTHER" ]; then
  1149     if [ -z "$OTHER" ]; then
  1139         OTHER="$THIS/../$LEGACY_BUILD_DIR"
  1150         echo "Nothing to compare to, set with -o"
  1140         if [ -d "$OTHER" ]; then
  1151         exit 1
  1141             OTHER="$( cd "$OTHER" && pwd )"
       
  1142         else
       
  1143             echo "Default old build directory does not exist:"
       
  1144             echo "$OTHER"
       
  1145             exit 1
       
  1146         fi
       
  1147         echo "Comparing to default old build:"
       
  1148         echo "$OTHER"
       
  1149         echo
       
  1150     else
  1152     else
  1151         if [ ! -d "$OTHER" ]; then
  1153         if [ ! -d "$OTHER" ]; then
  1152             echo "Other build directory does not exist:"
  1154             echo "Other build directory does not exist:"
  1153             echo "$OTHER"
  1155             echo "$OTHER"
  1154             exit 1
  1156             exit 1
  1158         echo "$OTHER"
  1160         echo "$OTHER"
  1159         echo
  1161         echo
  1160     fi
  1162     fi
  1161 
  1163 
  1162 
  1164 
  1163     # Figure out the layout of the this build. Which kinds of images have been produced
  1165     # Find the common images to compare, prioritizing later build stages
  1164     if [ -d "$THIS/install/j2sdk-image" ]; then
  1166     if [ -d "$THIS/install/j2sdk-image" ] && [ -d "$OTHER/install/j2sdk-image" ]; then
  1165         THIS_J2SDK="$THIS/install/j2sdk-image"
  1167         THIS_J2SDK="$THIS/install/j2sdk-image"
  1166         THIS_J2RE="$THIS/install/j2re-image"
  1168         THIS_J2RE="$THIS/install/j2re-image"
  1167         echo "Selecting install images in this build"
  1169         OTHER_J2SDK="$OTHER/install/j2sdk-image"
  1168     elif [ -d "$THIS/deploy/j2sdk-image" ]; then
  1170         OTHER_J2RE="$OTHER/install/j2re-image"
       
  1171         echo "Selecting install images for compare"
       
  1172     elif [ -d "$THIS/deploy/j2sdk-image" ] && [ -d "$OTHER/deploy/j2sdk-image" ]; then
  1169         THIS_J2SDK="$THIS/deploy/j2sdk-image"
  1173         THIS_J2SDK="$THIS/deploy/j2sdk-image"
  1170         THIS_J2RE="$THIS/deploy/j2re-image"
  1174         THIS_J2RE="$THIS/deploy/j2re-image"
  1171         echo "Selecting deploy images in this build"
  1175         OTHER_J2SDK="$OTHER/deploy/j2sdk-image"
  1172     elif [ -d "$THIS/images/j2sdk-image" ]; then
  1176         OTHER_J2RE="$OTHER/deploy/j2re-image"
       
  1177         echo "Selecting deploy images for compare"
       
  1178     elif [ -d "$THIS/images/j2sdk-image" ] && [ -d "$OTHER/images/j2sdk-image" ]; then
  1173         THIS_J2SDK="$THIS/images/j2sdk-image"
  1179         THIS_J2SDK="$THIS/images/j2sdk-image"
  1174         THIS_J2RE="$THIS/images/j2re-image"
  1180         THIS_J2RE="$THIS/images/j2re-image"
  1175         echo "Selecting jdk images in this build"
  1181         OTHER_J2SDK="$OTHER/images/j2sdk-image"
  1176     fi
  1182         OTHER_J2RE="$OTHER/images/j2re-image"
  1177 
  1183         echo "Selecting jdk images for compare"
  1178     if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
  1184     else
  1179         if [ -d "$THIS/install/j2sdk-image" ]; then
  1185         echo "No common images found."
  1180             # If there is an install image, prefer that, it's also overlay
  1186         exit 1
  1181             THIS_J2SDK_OVERLAY="$THIS/install/j2sdk-image"
  1187     fi
  1182             THIS_J2RE_OVERLAY="$THIS/install/j2re-image"
  1188 
  1183             echo "Selecting install overlay images in this build"
  1189     if [ -d "$THIS/images/j2sdk-bundle" ] && [ -d "$OTHER/images/j2sdk-bundle" ]; then
  1184         else
       
  1185             THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image"
       
  1186             THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image"
       
  1187             echo "Selecting jdk overlay images in this build"
       
  1188         fi
       
  1189     fi
       
  1190 
       
  1191     if [ -d "$THIS/images/j2sdk-bundle" ]; then
       
  1192         THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle"
  1190         THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle"
  1193         THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle"
  1191         THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle"
  1194         echo "Selecting bundles in this build"
       
  1195     fi
       
  1196 
       
  1197     # Figure out the layout of the other build (old or new, normal or overlay image)
       
  1198     if [ -d "$OTHER/j2sdk-image" ]; then
       
  1199         if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then
       
  1200             OTHER_J2SDK="$OTHER/j2sdk-image"
       
  1201             OTHER_J2RE="$OTHER/j2re-image"
       
  1202             echo "Selecting old-style images in other build"
       
  1203         else
       
  1204             OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image"
       
  1205             OTHER_J2RE_OVERLAY="$OTHER/j2re-image"
       
  1206             echo "Selecting overlay images in other build"
       
  1207         fi
       
  1208     elif [ -d "$OTHER/install/j2sdk-image" ]; then
       
  1209         OTHER_J2SDK="$OTHER/install/j2sdk-image"
       
  1210         OTHER_J2RE="$OTHER/install/j2re-image"
       
  1211         echo "Selecting install images in other build"
       
  1212     elif [ -d "$OTHER/deploy/j2sdk-image" ]; then
       
  1213         OTHER_J2SDK="$OTHER/deploy/j2sdk-image"
       
  1214         OTHER_J2RE="$OTHER/deploy/j2re-image"
       
  1215         echo "Selecting deploy images in other build"
       
  1216     elif [ -d "$OTHER/images/j2sdk-image" ]; then
       
  1217         OTHER_J2SDK="$OTHER/images/j2sdk-image"
       
  1218         OTHER_J2RE="$OTHER/images/j2re-image"
       
  1219         echo "Selecting jdk images in other build"
       
  1220     fi
       
  1221 
       
  1222     if [ -d "$OTHER/j2sdk-bundle" ]; then
       
  1223         OTHER_J2SDK_BUNDLE="$OTHER/j2sdk-bundle"
       
  1224         OTHER_J2RE_BUNDLE="$OTHER/j2re-bundle"
       
  1225         echo "Selecting bundles in other build"
       
  1226     elif [ -d "$OTHER/images/j2sdk-bundle" ]; then
       
  1227         OTHER_J2SDK_BUNDLE="$OTHER/images/j2sdk-bundle"
  1192         OTHER_J2SDK_BUNDLE="$OTHER/images/j2sdk-bundle"
  1228         OTHER_J2RE_BUNDLE="$OTHER/images/j2re-bundle"
  1193         OTHER_J2RE_BUNDLE="$OTHER/images/j2re-bundle"
  1229         echo "Selecting jdk bundles in other build"
  1194         echo "Also comparing macosx bundles"
  1230     fi
  1195     fi
  1231     
  1196 
  1232     if [ -z "$THIS_J2SDK" ] || [ -z "$THIS_J2RE" ]; then
  1197     if [ -d "$THIS/deploy" ] && [ -d "$OTHER/deploy" ]; then
  1233         if [ -z "$THIS_J2SDK_OVERLAY" ]; then
  1198         THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/dist/installer/bundles"
  1234             echo "Cannot locate images for this build. Are you sure you have run 'make images'?"
  1199         OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/bundles"
  1235             exit 1
  1200         echo "Also comparing deploy/bundles"
  1236         fi
  1201         if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
  1237     fi
  1202             THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/deploy/JavaAppletPlugin.plugin"
  1238 
  1203             OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/deploy/JavaAppletPlugin.plugin"
  1239     if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then
  1204             echo "Also comparing JavaAppletPlugin"
  1240         echo "OTHER build only has an overlay image while this build does not. Nothing to compare!"
  1205         fi
  1241         exit 1
       
  1242     fi
       
  1243 
       
  1244     if [ -z "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
       
  1245         echo "WARNING! OTHER build has bundles built while this build does not."
       
  1246         echo "Skipping bundle compare!"
       
  1247     fi
  1206     fi
  1248 
  1207 
  1249     if [ -d "$OTHER/images" ]; then
  1208     if [ -d "$OTHER/images" ]; then
  1250         OTHER_SEC_DIR="$OTHER/images"
  1209         OTHER_SEC_DIR="$OTHER/images"
  1251     else
  1210     else
  1264         OTHER_JGSS_WINDOWS_BIN="$OTHER_SEC_DIR/$JGSS_WINDOWS_BIN"
  1223         OTHER_JGSS_WINDOWS_BIN="$OTHER_SEC_DIR/$JGSS_WINDOWS_BIN"
  1265         THIS_SEC_WINDOWS_BIN="$THIS_SEC_DIR/sec-windows-bin.zip"
  1224         THIS_SEC_WINDOWS_BIN="$THIS_SEC_DIR/sec-windows-bin.zip"
  1266         THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
  1225         THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
  1267     fi
  1226     fi
  1268 
  1227 
  1269     if [ -d "$THIS/docs" ]; then
  1228     if [ -d "$THIS/docs" ] && [ -d "$OTHER/docs" ]; then
  1270         THIS_DOCS="$THIS/docs"
  1229         THIS_DOCS="$THIS/docs"
  1271     fi
       
  1272 
       
  1273     if [ -d "$OTHER/docs" ]; then
       
  1274         OTHER_DOCS="$OTHER/docs"
  1230         OTHER_DOCS="$OTHER/docs"
  1275     fi
  1231         echo "Also comparing docs"
  1276 
  1232     else
  1277     if [ -z "$THIS_DOCS" ]; then
       
  1278         echo "WARNING! Docs haven't been built and won't be compared."
  1233         echo "WARNING! Docs haven't been built and won't be compared."
  1279     fi
  1234     fi
  1280 
       
  1281     if [ -z "$OTHER_DOCS" ]; then
       
  1282         echo "WARNING! Other build doesn't contain docs, skipping doc compare."
       
  1283     fi
       
  1284 
       
  1285 fi
  1235 fi
  1286 
  1236 
  1287 ##########################################################################################
  1237 ##########################################################################################
  1288 # Do the work
  1238 # Do the work
  1289 
  1239 
  1291     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1241     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1292         echo -n "J2SDK "
  1242         echo -n "J2SDK "
  1293         compare_dirs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1243         compare_dirs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1294         echo -n "J2RE  "
  1244         echo -n "J2RE  "
  1295         compare_dirs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1245         compare_dirs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1296         
  1246 
  1297         echo -n "J2SDK "
  1247         echo -n "J2SDK "
  1298         compare_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1248         compare_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1299         echo -n "J2RE  "
  1249         echo -n "J2RE  "
  1300         compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1250         compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1301     fi
       
  1302     if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
       
  1303         echo -n "J2SDK Overlay "
       
  1304         compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
       
  1305         echo -n "J2RE  Overlay "
       
  1306         compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
       
  1307         
       
  1308         echo -n "J2SDK Overlay "
       
  1309         compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
       
  1310         echo -n "J2RE  Overlay "
       
  1311         compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
       
  1312     fi
  1251     fi
  1313     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
  1252     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
  1314         echo -n "J2SDK Bundle "
  1253         echo -n "J2SDK Bundle "
  1315         compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
  1254         compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
  1316         echo -n "J2RE  Bundle "
  1255         echo -n "J2RE  Bundle "
  1317         compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
  1256         compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
  1318         
  1257 
  1319         echo -n "J2SDK Bundle "
  1258         echo -n "J2SDK Bundle "
  1320         compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
  1259         compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
  1321         echo -n "J2RE  Bundle "
  1260         echo -n "J2RE  Bundle "
  1322         compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
  1261         compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
  1323     fi
  1262     fi
  1328         compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
  1267         compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
  1329     fi
  1268     fi
  1330     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1269     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1331         compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1270         compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1332         compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1271         compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
       
  1272     fi
       
  1273     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
       
  1274         echo -n "JavaAppletPlugin "
       
  1275         compare_dirs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
       
  1276         echo -n "JavaAppletPlugin "
       
  1277         compare_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
  1333     fi
  1278     fi
  1334 fi
  1279 fi
  1335 
  1280 
  1336 if [ "$CMP_PERMS" = "true" ]; then
  1281 if [ "$CMP_PERMS" = "true" ]; then
  1337     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1282     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1338         echo -n "J2SDK "
  1283         echo -n "J2SDK "
  1339         compare_permissions $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1284         compare_permissions $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1340         echo -n "J2RE  "
  1285         echo -n "J2RE  "
  1341         compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1286         compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1342     fi
  1287     fi
  1343     if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
       
  1344         echo -n "J2SDK Overlay "
       
  1345         compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
       
  1346         echo -n "J2RE  Overlay "
       
  1347         compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
       
  1348     fi
       
  1349     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
       
  1350         echo -n "J2SDK Bundle "
       
  1351         compare_permissions $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
       
  1352         echo -n "J2RE  Bundle "
       
  1353         compare_permissions $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
       
  1354     fi
       
  1355     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1288     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1356         compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1289         compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
       
  1290     fi
       
  1291     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
       
  1292         echo -n "JavaAppletPlugin "
       
  1293         compare_permissions $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
  1357     fi
  1294     fi
  1358 fi
  1295 fi
  1359 
  1296 
  1360 if [ "$CMP_TYPES" = "true" ]; then
  1297 if [ "$CMP_TYPES" = "true" ]; then
  1361     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1298     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1362         echo -n "J2SDK "
  1299         echo -n "J2SDK "
  1363         compare_file_types $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1300         compare_file_types $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1364         echo -n "J2RE  "
  1301         echo -n "J2RE  "
  1365         compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1302         compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1366     fi
  1303     fi
  1367     if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
       
  1368         echo -n "J2SDK Overlay "
       
  1369         compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
       
  1370         echo -n "J2RE  Overlay "
       
  1371         compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
       
  1372     fi
       
  1373     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
  1304     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
  1374         echo -n "J2SDK Bundle "
  1305         echo -n "J2SDK Bundle "
  1375         compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
  1306         compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
  1376         echo -n "J2RE  Bundle "
  1307         echo -n "J2RE  Bundle "
  1377         compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
  1308         compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
  1378     fi
  1309     fi
  1379     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1310     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1380         compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1311         compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
       
  1312     fi
       
  1313     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
       
  1314         echo -n "JavaAppletPlugin "
       
  1315         compare_file_types $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
  1381     fi
  1316     fi
  1382 fi
  1317 fi
  1383 
  1318 
  1384 if [ "$CMP_GENERAL" = "true" ]; then
  1319 if [ "$CMP_GENERAL" = "true" ]; then
  1385     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1320     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1386         echo -n "J2SDK "
  1321         echo -n "J2SDK "
  1387         compare_general_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1322         compare_general_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1388         echo -n "J2RE  "
  1323         echo -n "J2RE  "
  1389         compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1324         compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1390     fi
  1325     fi
  1391     if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
       
  1392         echo -n "J2SDK Overlay "
       
  1393         compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
       
  1394         echo -n "J2RE  Overlay "
       
  1395         compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
       
  1396     fi
       
  1397     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
  1326     if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
  1398         echo -n "J2SDK Bundle "
  1327         echo -n "J2SDK Bundle "
  1399         compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
  1328         compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
  1400         echo -n "J2RE  Bundle "
  1329         echo -n "J2RE  Bundle "
  1401         compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
  1330         compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
  1405         compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
  1334         compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
  1406     fi
  1335     fi
  1407     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1336     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1408         compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1337         compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1409     fi
  1338     fi
       
  1339     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
       
  1340         echo -n "JavaAppletPlugin "
       
  1341         compare_general_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
       
  1342     fi
  1410 fi
  1343 fi
  1411 
  1344 
  1412 if [ "$CMP_ZIPS" = "true" ]; then
  1345 if [ "$CMP_ZIPS" = "true" ]; then
  1413     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1346     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1414         compare_all_zip_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1347         compare_all_zip_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1432         fi
  1365         fi
  1433     fi
  1366     fi
  1434     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1367     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1435         compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1368         compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1436     fi
  1369     fi
       
  1370     if [ -n "$THIS_DEPLOY_BUNDLE_DIR" ] && [ -n "$OTHER_DEPLOY_BUNDLE_DIR" ]; then
       
  1371         compare_all_zip_files $THIS_DEPLOY_BUNDLE_DIR $OTHER_DEPLOY_BUNDLE_DIR $COMPARE_ROOT/deploy-bundle
       
  1372     fi
       
  1373     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
       
  1374         compare_all_zip_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
       
  1375     fi
  1437 fi
  1376 fi
  1438 
  1377 
  1439 if [ "$CMP_JARS" = "true" ]; then
  1378 if [ "$CMP_JARS" = "true" ]; then
  1440     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1379     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1441         compare_all_jar_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1380         compare_all_jar_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1442     fi
  1381     fi
  1443     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1382     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1444         compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1383         compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
       
  1384     fi
       
  1385     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
       
  1386         compare_all_jar_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
  1445     fi
  1387     fi
  1446 fi
  1388 fi
  1447 
  1389 
  1448 if [ "$CMP_LIBS" = "true" ]; then
  1390 if [ "$CMP_LIBS" = "true" ]; then
  1449     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1391     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1452         if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
  1394         if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
  1453             echo -n "J2RE  "
  1395             echo -n "J2RE  "
  1454             compare_all_libs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1396             compare_all_libs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1455         fi
  1397         fi
  1456     fi
  1398     fi
  1457     if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
       
  1458         echo -n "Bundle   "
       
  1459         compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
       
  1460     fi
       
  1461     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1399     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1462         compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1400         compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
       
  1401     fi
       
  1402     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
       
  1403         echo -n "JavaAppletPlugin "
       
  1404         compare_all_libs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
  1463     fi
  1405     fi
  1464 fi
  1406 fi
  1465 
  1407 
  1466 if [ "$CMP_EXECS" = "true" ]; then
  1408 if [ "$CMP_EXECS" = "true" ]; then
  1467     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1409     if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1468         compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1410         compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1469     fi
  1411         if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
  1470     if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
  1412             echo -n "J2RE  "
  1471         echo -n "Overlay "
  1413             compare_all_execs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1472         compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
  1414         fi
  1473     fi
  1415     fi
  1474     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1416     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
  1475         compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
  1417         compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
       
  1418     fi
       
  1419     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
       
  1420         echo -n "JavaAppletPlugin "
       
  1421         compare_all_execs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
  1476     fi
  1422     fi
  1477 fi
  1423 fi
  1478 
  1424 
  1479 echo
  1425 echo
  1480 
  1426