common/bin/compare.sh

changeset 564
befbad2e4d87
parent 518
6ff2e1280dc3
child 565
39194e004ade
equal deleted inserted replaced
563:348a881c6da0 564:befbad2e4d87
96 # consequtive invokations seemingly randomly. 96 # consequtive invokations seemingly randomly.
97 # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this. 97 # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this.
98 if test "x$SUFFIX" = "xclass"; then 98 if test "x$SUFFIX" = "xclass"; then
99 # To improve performance when large diffs are found, do a rough filtering of classes 99 # To improve performance when large diffs are found, do a rough filtering of classes
100 # elibeble for these exceptions 100 # elibeble for these exceptions
101 if $GREP -R -e '[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}' -e thePoint -e aPoint -e setItemsPtr ${THIS_FILE} > /dev/null; then 101 if $GREP -R -e '[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}' \
102 -e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \
103 -e thePoint -e aPoint -e setItemsPtr ${THIS_FILE} > /dev/null; then
102 $JAVAP -c -constants -l -p ${OTHER_FILE} > ${OTHER_FILE}.javap 104 $JAVAP -c -constants -l -p ${OTHER_FILE} > ${OTHER_FILE}.javap
103 $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap 105 $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap
104 TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \ 106 TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
105 $GREP '^[<>]' | \ 107 $GREP '^[<>]' | \
106 $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ 108 $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
109 -e '/[0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}/d' \
107 -e '/[<>].*Point Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \ 110 -e '/[<>].*Point Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \
108 -e '/[<>].*public com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*itemsPtr();/d' \ 111 -e '/[<>].*public com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*itemsPtr();/d' \
109 -e '/[<>].*public void setItemsPtr(com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*);/d') 112 -e '/[<>].*public void setItemsPtr(com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*);/d')
110 fi 113 fi
111 fi 114 fi
303 # Ignore time stamps in docs files 306 # Ignore time stamps in docs files
304 OTHER_FILE=$WORK_DIR/$f.other 307 OTHER_FILE=$WORK_DIR/$f.other
305 THIS_FILE=$WORK_DIR/$f.this 308 THIS_FILE=$WORK_DIR/$f.this
306 $MKDIR -p $(dirname $OTHER_FILE) 309 $MKDIR -p $(dirname $OTHER_FILE)
307 $MKDIR -p $(dirname $THIS_FILE) 310 $MKDIR -p $(dirname $THIS_FILE)
311 #Note that | doesn't work on mac sed.
308 $CAT $OTHER_DIR/$f | $SED -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \ 312 $CAT $OTHER_DIR/$f | $SED -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
309 -e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \ 313 -e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \
310 -e 's/\(Monday\|Tuesday\|Wednesday\|Thursday\|Friday\|Saturday\|Sunday\), [A-Z][a-z]* [0-9][0-9]*, [12][0-9]* [0-9][0-9:]* \(AM\|PM\) [A-Z][A-Z]*/(removed)/' \ 314 -e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [12][0-9]* [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/(removed)/' \
315 -e 's/[A-Z][a-z]* [A-Z][a-z]* [0-9][0-9] [0-9][0-9:]* [A-Z][A-Z]* [12][0-9]*/(removed)/' \
311 -e 's/^\( from \).*\(\.idl\)$/\1(removed)\2/' \ 316 -e 's/^\( from \).*\(\.idl\)$/\1(removed)\2/' \
312 > $OTHER_FILE 317 > $OTHER_FILE
313 $CAT $THIS_DIR/$f | $SED -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \ 318 $CAT $THIS_DIR/$f | $SED -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
314 -e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \ 319 -e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \
315 -e 's/\(Monday\|Tuesday\|Wednesday\|Thursday\|Friday\|Saturday\|Sunday\), [A-Z][a-z]* [0-9][0-9]*, [12][0-9]* [0-9][0-9:]* \(AM\|PM\) [A-Z][A-Z]*/(removed)/' \ 320 -e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [12][0-9]* [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/(removed)/' \
321 -e 's/[A-Z][a-z]* [A-Z][a-z]* [0-9][0-9] [0-9][0-9:]* [A-Z][A-Z]* [12][0-9]*/(removed)/' \
316 -e 's/^\( from \).*\(\.idl\)$/\1(removed)\2/' \ 322 -e 's/^\( from \).*\(\.idl\)$/\1(removed)\2/' \
317 > $THIS_FILE 323 > $THIS_FILE
318 else 324 else
319 OTHER_FILE=$OTHER_DIR/$f 325 OTHER_FILE=$OTHER_DIR/$f
320 THIS_FILE=$THIS_DIR/$f 326 THIS_FILE=$THIS_DIR/$f
368 $MKDIR -p $OTHER_UNZIPDIR 374 $MKDIR -p $OTHER_UNZIPDIR
369 (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP) 375 (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
370 (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP) 376 (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
371 377
372 # Find all archives inside and unzip them as well to compare the contents rather than 378 # Find all archives inside and unzip them as well to compare the contents rather than
373 # the archives. 379 # the archives. pie.jar.pack.gz i app3.war is corrupt, skip it.
374 EXCEPTIONS="" 380 EXCEPTIONS="pie.jar.pack.gz"
375 for pack in $($FIND $THIS_UNZIPDIR -name "*.pack" -o -name "*.pack.gz"); do 381 for pack in $($FIND $THIS_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a ! -name pie.jar.pack.gz); do
376 ($UNPACK200 $pack $pack.jar) 382 ($UNPACK200 $pack $pack.jar)
377 # Filter out the unzipped archives from the diff below. 383 # Filter out the unzipped archives from the diff below.
378 EXCEPTIONS="$EXCEPTIONS $pack $pack.jar" 384 EXCEPTIONS="$EXCEPTIONS $pack $pack.jar"
379 done 385 done
380 for pack in $($FIND $OTHER_UNZIPDIR -name "*.pack" -o -name "*.pack.gz"); do 386 for pack in $($FIND $OTHER_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a ! -name pie.jar.pack.gz); do
381 ($UNPACK200 $pack $pack.jar) 387 ($UNPACK200 $pack $pack.jar)
382 EXCEPTIONS="$EXCEPTIONS $pack $pack.jar" 388 EXCEPTIONS="$EXCEPTIONS $pack $pack.jar"
383 done 389 done
384 for zip in $($FIND $THIS_UNZIPDIR -name "*.jar" -o -name "*.zip"); do 390 for zip in $($FIND $THIS_UNZIPDIR -name "*.jar" -o -name "*.zip"); do
385 $MKDIR $zip.unzip 391 $MKDIR $zip.unzip
1071 echo 1077 echo
1072 fi 1078 fi
1073 1079
1074 1080
1075 # Figure out the layout of the this build. Which kinds of images have been produced 1081 # Figure out the layout of the this build. Which kinds of images have been produced
1076 if [ -d "$THIS/deploy/j2sdk-image" ]; then 1082 if [ -d "$THIS/install/j2sdk-image" ]; then
1083 THIS_J2SDK="$THIS/install/j2sdk-image"
1084 THIS_J2RE="$THIS/install/j2re-image"
1085 echo "Comparing install images"
1086 elif [ -d "$THIS/deploy/j2sdk-image" ]; then
1077 THIS_J2SDK="$THIS/deploy/j2sdk-image" 1087 THIS_J2SDK="$THIS/deploy/j2sdk-image"
1078 THIS_J2RE="$THIS/deploy/j2re-image" 1088 THIS_J2RE="$THIS/deploy/j2re-image"
1079 echo "Comparing deploy images" 1089 echo "Comparing deploy images"
1080 elif [ -d "$THIS/images/j2sdk-image" ]; then 1090 elif [ -d "$THIS/images/j2sdk-image" ]; then
1081 THIS_J2SDK="$THIS/images/j2sdk-image" 1091 THIS_J2SDK="$THIS/images/j2sdk-image"
1082 THIS_J2RE="$THIS/images/j2re-image" 1092 THIS_J2RE="$THIS/images/j2re-image"
1083 fi 1093 fi
1094
1084 if [ -d "$THIS/images/j2sdk-overlay-image" ]; then 1095 if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
1085 THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image" 1096 if [ -d "$THIS/install/j2sdk-image" ]; then
1086 THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image" 1097 # If there is an install image, prefer that, it's also overlay
1098 THIS_J2SDK_OVERLAY="$THIS/install/j2sdk-image"
1099 THIS_J2RE_OVERLAY="$THIS/install/j2re-image"
1100 else
1101 THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image"
1102 THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image"
1103 fi
1087 fi 1104 fi
1088 1105
1089 if [ -d "$THIS/images/j2sdk-bundle" ]; then 1106 if [ -d "$THIS/images/j2sdk-bundle" ]; then
1090 THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle" 1107 THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle"
1091 THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle" 1108 THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle"
1098 OTHER_J2RE="$OTHER/j2re-image" 1115 OTHER_J2RE="$OTHER/j2re-image"
1099 else 1116 else
1100 OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image" 1117 OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image"
1101 OTHER_J2RE_OVERLAY="$OTHER/j2re-image" 1118 OTHER_J2RE_OVERLAY="$OTHER/j2re-image"
1102 fi 1119 fi
1103 1120 elif [ -d "$OTHER/images/j2sdk-image" ]; then
1121 OTHER_J2SDK="$OTHER/images/j2sdk-image"
1122 OTHER_J2RE="$OTHER/images/j2re-image"
1104 fi 1123 fi
1105 1124
1106 if [ -d "$OTHER/j2sdk-bundle" ]; then 1125 if [ -d "$OTHER/j2sdk-bundle" ]; then
1107 OTHER_J2SDK_BUNDLE="$OTHER/j2sdk-bundle" 1126 OTHER_J2SDK_BUNDLE="$OTHER/j2sdk-bundle"
1108 OTHER_J2RE_BUNDLE="$OTHER/j2re-bundle" 1127 OTHER_J2RE_BUNDLE="$OTHER/j2re-bundle"

mercurial