compare.sh revision 1664:c800f2919a1f
1#!/bin/bash 2# 3# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. 4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5# 6# This code is free software; you can redistribute it and/or modify it 7# under the terms of the GNU General Public License version 2 only, as 8# published by the Free Software Foundation. 9# 10# This code is distributed in the hope that it will be useful, but WITHOUT 11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13# version 2 for more details (a copy is included in the LICENSE file that 14# accompanied this code). 15# 16# You should have received a copy of the GNU General Public License version 17# 2 along with this work; if not, write to the Free Software Foundation, 18# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19# 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 22# questions. 23# 24 25# This script is processed by configure before it's usable. It is run from 26# the root of the build directory. 27 28 29################################################################################ 30 31# Check that we are run via the wrapper generated by configure 32if [ -z "$SRC_ROOT" ]; then 33 echo "Error: You must run this script using build/[conf]/compare.sh" 34 exit 1 35fi 36 37if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then 38 FULLDUMP_CMD="$OTOOL -v -V -h -X -d" 39 LDD_CMD="$OTOOL -L" 40 DIS_CMD="$OTOOL -v -t" 41 STAT_PRINT_SIZE="-f %z" 42elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then 43 FULLDUMP_CMD="$DUMPBIN -all" 44 LDD_CMD="$DUMPBIN -dependants | $GREP .dll" 45 DIS_CMD="$DUMPBIN -disasm:nobytes" 46 STAT_PRINT_SIZE="-c %s" 47else 48 FULLDUMP_CMD="$READELF -a" 49 LDD_CMD="$LDD" 50 DIS_CMD="$OBJDUMP -d" 51 STAT_PRINT_SIZE="-c %s" 52fi 53 54UNARCHIVE="$UNZIP -q" 55 56COMPARE_EXCEPTIONS_INCLUDE="$SRC_ROOT/common/bin/compare_exceptions.sh.incl" 57if [ ! -e "$COMPARE_EXCEPTIONS_INCLUDE" ]; then 58 echo "Error: Cannot locate the exceptions file, it should have been here: $COMPARE_EXCEPTIONS_INCLUDE" 59 exit 1 60fi 61# Include exception definitions 62. "$COMPARE_EXCEPTIONS_INCLUDE" 63 64################################################################################ 65# Compare text files and ignore specific differences: 66# 67# * Timestamps in Java sources generated by idl2java 68# * Sorting order and cleanup style in .properties files 69 70diff_text() { 71 OTHER_FILE=$1 72 THIS_FILE=$2 73 74 SUFFIX="${THIS_FILE##*.}" 75 76 TMP=1 77 78 if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then 79 # Filter out date string, ant version and java version differences. 80 TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \ 81 $GREP '^[<>]' | \ 82 $SED -e '/[<>] Ant-Version: Apache Ant .*/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') 86 fi 87 if test "x$SUFFIX" = "xjava"; then 88 TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \ 89 $GREP '^[<>]' | \ 90 $SED -e '/[<>] \* from.*\.idl/d' \ 91 -e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ 92 -e '/[<>] \*.*[0-9]\{4\} [0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \ 93 -e '/\/\/ Generated from input file.*/d' \ 94 -e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \ 95 -e '/\/\/ java GenerateCharacter.*/d') 96 fi 97 # Ignore date strings in class files. 98 # On Macosx the system sources for generated java classes produce different output on 99 # consequtive invocations seemingly randomly. 100 # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this. 101 # Anonymous lambda classes get randomly assigned counters in their names. 102 if test "x$SUFFIX" = "xclass"; then 103 # To improve performance when large diffs are found, do a rough filtering of classes 104 # elibeble for these exceptions 105 if $GREP -R -e '[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}' \ 106 -e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \ 107 -e thePoint -e aPoint -e setItemsPtr \ 108 -e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null; then 109 $JAVAP -c -constants -l -p "${OTHER_FILE}" > ${OTHER_FILE}.javap 110 $JAVAP -c -constants -l -p "${THIS_FILE}" > ${THIS_FILE}.javap 111 TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \ 112 $GREP '^[<>]' | \ 113 $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ 114 -e '/[0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}/d' \ 115 -e '/[<>].*Point Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \ 116 -e '/[<>].*public com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*itemsPtr();/d' \ 117 -e '/[<>].*public void setItemsPtr(com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*);/d' \ 118 -e '/[<>].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d') 119 fi 120 fi 121 if test "x$SUFFIX" = "xproperties"; then 122 # Run through nawk to add possibly missing newline at end of file. 123 $CAT $OTHER_FILE | $NAWK '{ print }' | LC_ALL=C $SORT > $OTHER_FILE.cleaned 124# Disable this exception since we aren't changing the properties cleaning method yet. 125# $CAT $OTHER_FILE | $SED -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ 126# | $SED -f "$SRC_ROOT/common/makefiles/support/unicode2x.sed" \ 127# | $SED -e '/^#/d' -e '/^$/d' \ 128# -e :a -e '/\\$/N; s/\\\n//; ta' \ 129# -e 's/^[ \t]*//;s/[ \t]*$//' \ 130# -e 's/\\=/=/' | LC_ALL=C $SORT > $OTHER_FILE.cleaned 131 # Filter out date string differences. 132 TMP=$(LC_ALL=C $DIFF $OTHER_FILE.cleaned $THIS_FILE | \ 133 $GREP '^[<>]' | \ 134 $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d') 135 fi 136 if test "x$SUFFIX" = "xhtml"; then 137 # Some javadoc versions do not put quotes around font size 138 HTML_FILTER="$SED \ 139 -e 's/<font size=-1>/<font size=\"-1\">/g'" 140 $CAT $THIS_FILE | eval "$HTML_FILTER" > $THIS_FILE.filtered 141 $CAT $OTHER_FILE | eval "$HTML_FILTER" > $OTHER_FILE.filtered 142 TMP=$(LC_ALL=C $DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \ 143 $GREP '^[<>]' | \ 144 $SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \ 145 -e '/[<>] <meta name="date" content=".*">/d' ) 146 fi 147 if test -n "$TMP"; then 148 echo Files $OTHER_FILE and $THIS_FILE differ 149 return 1 150 fi 151 152 return 0 153} 154 155################################################################################ 156# Compare directory structure 157 158compare_dirs() { 159 THIS_DIR=$1 160 OTHER_DIR=$2 161 WORK_DIR=$3 162 163 mkdir -p $WORK_DIR 164 165 (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other) 166 (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this) 167 168 $DIFF $WORK_DIR/dirs_other $WORK_DIR/dirs_this > $WORK_DIR/dirs_diff 169 170 echo -n Directory structure... 171 if [ -s $WORK_DIR/dirs_diff ]; then 172 echo Differences found. 173 REGRESSIONS=true 174 # Differences in directories found. 175 ONLY_OTHER=$($GREP '<' $WORK_DIR/dirs_diff) 176 if [ "$ONLY_OTHER" ]; then 177 echo Only in $OTHER 178 $GREP '<' $WORK_DIR/dirs_diff | $SED 's|< ./| |g' 179 fi 180 ONLY_THIS=$($GREP '>' $WORK_DIR/dirs_diff) 181 if [ "$ONLY_THIS" ]; then 182 echo Only in $THIS 183 $GREP '>' $WORK_DIR/dirs_diff | $SED 's|> ./| |g' 184 fi 185 else 186 echo Identical! 187 fi 188} 189 190 191################################################################################ 192# Compare file structure 193 194compare_files() { 195 THIS_DIR=$1 196 OTHER_DIR=$2 197 WORK_DIR=$3 198 199 $MKDIR -p $WORK_DIR 200 201 (cd $OTHER_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_other) 202 (cd $THIS_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_this) 203 204 $DIFF $WORK_DIR/files_other $WORK_DIR/files_this > $WORK_DIR/files_diff 205 206 echo -n File names... 207 if [ -s $WORK_DIR/files_diff ]; then 208 echo Differences found. 209 REGRESSIONS=true 210 # Differences in files found. 211 ONLY_OTHER=$($GREP '<' $WORK_DIR/files_diff) 212 if [ "$ONLY_OTHER" ]; then 213 echo Only in $OTHER 214 $GREP '<' $WORK_DIR/files_diff | $SED 's|< ./| |g' 215 fi 216 ONLY_THIS=$($GREP '>' $WORK_DIR/files_diff) 217 if [ "$ONLY_THIS" ]; then 218 echo Only in $THIS 219 $GREP '>' $WORK_DIR/files_diff | $SED 's|> ./| |g' 220 fi 221 else 222 echo Identical! 223 fi 224} 225 226 227################################################################################ 228# Compare permissions 229 230compare_permissions() { 231 THIS_DIR=$1 232 OTHER_DIR=$2 233 WORK_DIR=$3 234 235 mkdir -p $WORK_DIR 236 237 echo -n Permissions... 238 found="" 239 for f in `cd $OTHER_DIR && $FIND . -type f` 240 do 241 if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi 242 if [ ! -f ${THIS_DIR}/$f ]; then continue; fi 243 OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'` 244 TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'` 245 if [ "$OP" != "$TP" ] 246 then 247 if [ -z "$found" ]; then echo ; found="yes"; fi 248 $PRINTF "\tother: ${OP} this: ${TP}\t$f\n" 249 fi 250 done 251 if [ -z "$found" ]; then 252 echo "Identical!" 253 else 254 REGRESSIONS=true 255 fi 256} 257 258################################################################################ 259# Compare file command output 260 261compare_file_types() { 262 THIS_DIR=$1 263 OTHER_DIR=$2 264 WORK_DIR=$3 265 266 $MKDIR -p $WORK_DIR 267 268 echo -n File types... 269 found="" 270 for f in `cd $OTHER_DIR && $FIND . ! -type d` 271 do 272 if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi 273 if [ ! -f ${THIS_DIR}/$f ]; then continue; fi 274 OF=`cd ${OTHER_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'` 275 TF=`cd ${THIS_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'` 276 if [ "$OF" != "$TF" ] 277 then 278 if [ "`echo $OF | $GREP -c 'Zip archive data'`" -gt 0 ] \ 279 && [ "`echo $TF | $GREP -c 'Zip archive data'`" -gt 0 ] 280 then 281 # the way we produce zip-files make it so that directories are stored in 282 # old file but not in new (only files with full-path) this makes file 283 # report them as different 284 continue 285 else 286 if [ -z "$found" ]; then echo ; found="yes"; fi 287 $PRINTF "\tother: ${OF}\n\tthis : ${TF}\n" 288 fi 289 fi 290 done 291 if [ -z "$found" ]; then 292 echo "Identical!" 293 else 294 REGRESSIONS=true 295 fi 296} 297 298################################################################################ 299# Compare the rest of the files 300 301compare_general_files() { 302 THIS_DIR=$1 303 OTHER_DIR=$2 304 WORK_DIR=$3 305 306 GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" \ 307 ! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \ 308 ! -name "*.jimage" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \ 309 ! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \ 310 ! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" \ 311 ! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \ 312 ! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \ 313 ! -name "jspawnhelper" \ 314 | $GREP -v "./bin/" | $SORT | $FILTER) 315 316 echo General files... 317 for f in $GENERAL_FILES 318 do 319 if [ -e $OTHER_DIR/$f ]; then 320 SUFFIX="${f##*.}" 321 if [ "$(basename $f)" = "release" ]; then 322 # Ignore differences in change numbers in release file. 323 OTHER_FILE=$WORK_DIR/$f.other 324 THIS_FILE=$WORK_DIR/$f.this 325 $MKDIR -p $(dirname $OTHER_FILE) 326 $MKDIR -p $(dirname $THIS_FILE) 327 $CAT $OTHER_DIR/$f | $SED 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' > $OTHER_FILE 328 $CAT $THIS_DIR/$f | $SED 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' > $THIS_FILE 329 elif [ "x$SUFFIX" = "xhtml" ]; then 330 # Ignore time stamps in docs files 331 OTHER_FILE=$WORK_DIR/$f.other 332 THIS_FILE=$WORK_DIR/$f.this 333 $MKDIR -p $(dirname $OTHER_FILE) 334 $MKDIR -p $(dirname $THIS_FILE) 335 #Note that | doesn't work on mac sed. 336 $CAT $OTHER_DIR/$f | $SED -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \ 337 -e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \ 338 -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)/' \ 339 -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)/' \ 340 -e 's/^\( from \).*\(\.idl\)$/\1(removed)\2/' \ 341 -e 's/^\(.*\)\( o'"'"'clock \)\([A-Z][A-Z][A-Z]\)/(removed)\2(removed)/' \ 342 > $OTHER_FILE 343 $CAT $THIS_DIR/$f | $SED -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \ 344 -e 's/\(<meta name="date" content="\).*\(">\)/\1(removed)\2/' \ 345 -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)/' \ 346 -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)/' \ 347 -e 's/^\( from \).*\(\.idl\)$/\1(removed)\2/' \ 348 -e 's/^\(.*\)\( o'"'"'clock \)\([A-Z][A-Z][A-Z]\)/(removed)\2(removed)/' \ 349 > $THIS_FILE 350 else 351 OTHER_FILE=$OTHER_DIR/$f 352 THIS_FILE=$THIS_DIR/$f 353 fi 354 DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1) 355 if [ -n "$DIFF_OUT" ]; then 356 echo $f 357 REGRESSIONS=true 358 if [ "$SHOW_DIFFS" = "true" ]; then 359 echo "$DIFF_OUT" 360 fi 361 fi 362 fi 363 done 364 365 366} 367 368################################################################################ 369# Compare zip file 370 371compare_zip_file() { 372 THIS_DIR=$1 373 OTHER_DIR=$2 374 WORK_DIR=$3 375 ZIP_FILE=$4 376 # Optionally provide different name for other zipfile 377 OTHER_ZIP_FILE=$5 378 379 THIS_ZIP=$THIS_DIR/$ZIP_FILE 380 if [ -n "$OTHER_ZIP_FILE" ]; then 381 OTHER_ZIP=$OTHER_DIR/$OTHER_ZIP_FILE 382 else 383 OTHER_ZIP=$OTHER_DIR/$ZIP_FILE 384 fi 385 386 THIS_SUFFIX="${THIS_ZIP##*.}" 387 OTHER_SUFFIX="${OTHER_ZIP##*.}" 388 if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then 389 echo "The files do not have the same suffix type! ($THIS_SUFFIX != $OTHER_SUFFIX)" 390 return 2 391 fi 392 393 TYPE="$THIS_SUFFIX" 394 395 if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null 396 then 397 return 0 398 fi 399 # Not quite identical, the might still contain the same data. 400 # Unpack the jar/zip files in temp dirs 401 402 THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this 403 OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other 404 $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR 405 $MKDIR -p $THIS_UNZIPDIR 406 $MKDIR -p $OTHER_UNZIPDIR 407 if [ "$TYPE" = "jimage" ] 408 then 409 (cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP) 410 (cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP) 411 else 412 (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP) 413 (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP) 414 fi 415 416 # Find all archives inside and unzip them as well to compare the contents rather than 417 # the archives. pie.jar.pack.gz i app3.war is corrupt, skip it. 418 EXCEPTIONS="pie.jar.pack.gz" 419 for pack in $($FIND $THIS_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a ! -name pie.jar.pack.gz); do 420 ($UNPACK200 $pack $pack.jar) 421 # Filter out the unzipped archives from the diff below. 422 EXCEPTIONS="$EXCEPTIONS $pack $pack.jar" 423 done 424 for pack in $($FIND $OTHER_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a ! -name pie.jar.pack.gz); do 425 ($UNPACK200 $pack $pack.jar) 426 EXCEPTIONS="$EXCEPTIONS $pack $pack.jar" 427 done 428 for zip in $($FIND $THIS_UNZIPDIR -name "*.jar" -o -name "*.zip"); do 429 $MKDIR $zip.unzip 430 (cd $zip.unzip && $UNARCHIVE $zip) 431 EXCEPTIONS="$EXCEPTIONS $zip" 432 done 433 for zip in $($FIND $OTHER_UNZIPDIR -name "*.jar" -o -name "*.zip"); do 434 $MKDIR $zip.unzip 435 (cd $zip.unzip && $UNARCHIVE $zip) 436 EXCEPTIONS="$EXCEPTIONS $zip" 437 done 438 439 CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff 440 # On solaris, there is no -q option. 441 if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then 442 LC_ALL=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \ 443 | $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \ 444 > $CONTENTS_DIFF_FILE 445 else 446 LC_ALL=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE 447 fi 448 449 ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE) 450 ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE) 451 452 return_value=0 453 454 if [ -n "$ONLY_OTHER" ]; then 455 echo " Only OTHER $ZIP_FILE contains:" 456 echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g' 457 return_value=1 458 fi 459 460 if [ -n "$ONLY_THIS" ]; then 461 echo " Only THIS $ZIP_FILE contains:" 462 echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g' 463 return_value=1 464 fi 465 466 if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then 467 DIFFING_FILES=$($GREP -e 'differ$' -e '^diff ' $CONTENTS_DIFF_FILE \ 468 | $SED -e 's/^Files //g' -e 's/diff -r //g' | $CUT -f 1 -d ' ' \ 469 | $SED "s|$OTHER_UNZIPDIR/||g") 470 else 471 DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \ 472 | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") 473 fi 474 475 $RM -f $WORK_DIR/$ZIP_FILE.diffs 476 for file in $DIFFING_FILES; do 477 if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then 478 diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs 479 fi 480 done 481 482 if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then 483 return_value=1 484 echo " Differing files in $ZIP_FILE" 485 $CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP 'differ$' | cut -f 2 -d ' ' | \ 486 $SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist 487 $CAT $WORK_DIR/$ZIP_FILE.difflist 488 489 if [ -n "$SHOW_DIFFS" ]; then 490 for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do 491 if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then 492 LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap 493 elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then 494 LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i 495 else 496 LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i 497 fi 498 done 499 fi 500 fi 501 502 return $return_value 503} 504 505 506################################################################################ 507# Compare all zip files 508 509compare_all_zip_files() { 510 THIS_DIR=$1 511 OTHER_DIR=$2 512 WORK_DIR=$3 513 514 ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER ) 515 516 if [ -n "$ZIPS" ]; then 517 echo Zip files... 518 519 return_value=0 520 for f in $ZIPS; do 521 if [ -f "$OTHER_DIR/$f" ]; then 522 compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f 523 if [ "$?" != "0" ]; then 524 return_value=1 525 REGRESSIONS=true 526 fi 527 fi 528 done 529 fi 530 531 return $return_value 532} 533 534################################################################################ 535# Compare all jar files 536 537compare_all_jar_files() { 538 THIS_DIR=$1 539 OTHER_DIR=$2 540 WORK_DIR=$3 541 542 # TODO filter? 543 ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \ 544 -o -name "*.jimage" | $SORT | $FILTER) 545 546 if [ -n "$ZIPS" ]; then 547 echo Jar files... 548 549 return_value=0 550 for f in $ZIPS; do 551 if [ -f "$OTHER_DIR/$f" ]; then 552 compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f 553 if [ "$?" != "0" ]; then 554 return_value=1 555 REGRESSIONS=true 556 fi 557 fi 558 done 559 fi 560 561 return $return_value 562} 563 564################################################################################ 565# Compare binary (executable/library) file 566 567compare_bin_file() { 568 THIS_DIR=$1 569 OTHER_DIR=$2 570 WORK_DIR=$3 571 BIN_FILE=$4 572 OTHER_BIN_FILE=$5 573 574 THIS_FILE=$THIS_DIR/$BIN_FILE 575 if [ -n "$OTHER_BIN_FILE" ]; then 576 OTHER_FILE=$OTHER_DIR/$OTHER_BIN_FILE 577 else 578 OTHER_FILE=$OTHER_DIR/$BIN_FILE 579 fi 580 NAME=$(basename $BIN_FILE) 581 WORK_FILE_BASE=$WORK_DIR/$BIN_FILE 582 FILE_WORK_DIR=$(dirname $WORK_FILE_BASE) 583 584 $MKDIR -p $FILE_WORK_DIR 585 586 # Make soft links to original files from work dir to facilitate debugging 587 $LN -f -s $THIS_FILE $WORK_FILE_BASE.this 588 $LN -f -s $OTHER_FILE $WORK_FILE_BASE.other 589 590 ORIG_THIS_FILE="$THIS_FILE" 591 ORIG_OTHER_FILE="$OTHER_FILE" 592 593 if [ "$STRIP_ALL" = "true" ] || [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then 594 THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME 595 OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME 596 $MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other 597 $CP $THIS_FILE $THIS_STRIPPED_FILE 598 $CP $OTHER_FILE $OTHER_STRIPPED_FILE 599 $STRIP $THIS_STRIPPED_FILE 600 $STRIP $OTHER_STRIPPED_FILE 601 THIS_FILE="$THIS_STRIPPED_FILE" 602 OTHER_FILE="$OTHER_STRIPPED_FILE" 603 fi 604 605 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then 606 unset _NT_SYMBOL_PATH 607 # On windows we need to unzip the debug symbols, if present 608 OTHER_FILE_BASE=${OTHER_FILE/.dll/} 609 OTHER_FILE_BASE=${OTHER_FILE_BASE/.exe/} 610 OTHER_FILE_BASE=${OTHER_FILE_BASE/.cpl/} 611 DIZ_NAME=$(basename $OTHER_FILE_BASE).diz 612 # java.exe and java.dll diz files will have the same name. Have to 613 # make sure java.exe gets the right one. This is only needed for 614 # OTHER since in the new build, all pdb files are left around. 615 if [ "$NAME" = "java.exe" ] && [ -f "$OTHER/tmp/java/java/obj64/java.diz" ]; then 616 OTHER_DIZ_FILE="$OTHER/tmp/java/java/obj64/java.diz" 617 elif [ -f "${OTHER_FILE_BASE}.diz" ]; then 618 OTHER_DIZ_FILE=${OTHER_FILE_BASE}.diz 619 else 620 # Some files, jli.dll, appears twice in the image but only one of 621 # thme has a diz file next to it. 622 OTHER_DIZ_FILE="$($FIND $OTHER_DIR -name $DIZ_NAME | $SED 1q)" 623 if [ ! -f "$OTHER_DIZ_FILE" ]; then 624 # As a last resort, look for diz file in the whole build output 625 # dir. 626 OTHER_DIZ_FILE="$($FIND $OTHER -name $DIZ_NAME | $SED 1q)" 627 fi 628 fi 629 if [ -n "$OTHER_DIZ_FILE" ]; then 630 $MKDIR -p $FILE_WORK_DIR/other 631 (cd $FILE_WORK_DIR/other ; $UNARCHIVE -o $OTHER_DIZ_FILE) 632 export _NT_SYMBOL_PATH="$FILE_WORK_DIR/other" 633 fi 634 THIS_FILE_BASE=${THIS_FILE/.dll/} 635 THIS_FILE_BASE=${THIS_FILE_BASE/.exe/} 636 if [ -f "${THIS_FILE/.dll/}.diz" ]; then 637 THIS_DIZ_FILE=${THIS_FILE/.dll/}.diz 638 else 639 THIS_DIZ_FILE="$($FIND $THIS_DIR -name $DIZ_NAME | $SED 1q)" 640 if [ ! -f "$THIS_DIZ_FILE" ]; then 641 # As a last resort, look for diz file in the whole build output 642 # dir. 643 THIS_DIZ_FILE="$($FIND $THIS -name $DIZ_NAME | $SED 1q)" 644 fi 645 fi 646 if [ -n "$THIS_DIZ_FILE" ]; then 647 $MKDIR -p $FILE_WORK_DIR/this 648 (cd $FILE_WORK_DIR/this ; $UNARCHIVE -o $THIS_DIZ_FILE) 649 export _NT_SYMBOL_PATH="$_NT_SYMBOL_PATH;$FILE_WORK_DIR/this" 650 fi 651 fi 652 653 if [ -z "$SKIP_BIN_DIFF" ]; then 654 if cmp $OTHER_FILE $THIS_FILE > /dev/null; then 655 # The files were bytewise identical. 656 if [ -n "$VERBOSE" ]; then 657 echo " : : : : : : $BIN_FILE" 658 fi 659 return 0 660 fi 661 BIN_MSG=" diff " 662 if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then 663 DIFF_BIN=true 664 if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then 665 BIN_MSG="*$BIN_MSG*" 666 REGRESSIONS=true 667 else 668 BIN_MSG=" $BIN_MSG " 669 fi 670 else 671 BIN_MSG="($BIN_MSG)" 672 DIFF_BIN= 673 fi 674 fi 675 676 if [ -n "$STAT" ]; then 677 THIS_SIZE=$($STAT $STAT_PRINT_SIZE "$THIS_FILE") 678 OTHER_SIZE=$($STAT $STAT_PRINT_SIZE "$OTHER_FILE") 679 else 680 THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }') 681 OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }') 682 fi 683 if [ $THIS_SIZE -ne $OTHER_SIZE ]; then 684 DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE) 685 DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE) 686 SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM) 687 if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] \ 688 && [ "$DIFF_SIZE_REL" -lt 102 ]; then 689 SIZE_MSG="($SIZE_MSG)" 690 DIFF_SIZE= 691 elif [ "$OPENJDK_TARGET_OS" = "windows" ] \ 692 && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \ 693 && [ "$DIFF_SIZE_NUM" = 512 ]; then 694 # On windows, size of binaries increase in 512 increments. 695 SIZE_MSG="($SIZE_MSG)" 696 DIFF_SIZE= 697 elif [ "$OPENJDK_TARGET_OS" = "windows" ] \ 698 && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \ 699 && [ "$DIFF_SIZE_NUM" = -512 ]; then 700 # On windows, size of binaries increase in 512 increments. 701 SIZE_MSG="($SIZE_MSG)" 702 DIFF_SIZE= 703 else 704 if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then 705 DIFF_SIZE=true 706 if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then 707 SIZE_MSG="*$SIZE_MSG*" 708 REGRESSIONS=true 709 else 710 SIZE_MSG=" $SIZE_MSG " 711 fi 712 else 713 SIZE_MSG="($SIZE_MSG)" 714 DIFF_SIZE= 715 fi 716 fi 717 else 718 SIZE_MSG=" " 719 DIFF_SIZE= 720 if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then 721 SIZE_MSG=" ! " 722 fi 723 fi 724 725 if [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then 726 SYM_SORT_CMD="sort" 727 else 728 SYM_SORT_CMD="cat" 729 fi 730 731 # Check symbols 732 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then 733 # The output from dumpbin on windows differs depending on if the debug symbol 734 # files are still around at the location the binary is pointing too. Need 735 # to filter out that extra information. 736 $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 737 $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 738 elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then 739 # Some symbols get seemingly random 15 character prefixes. Filter them out. 740 $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 741 $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 742 else 743 $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 744 $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 745 fi 746 747 LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff 748 if [ -s $WORK_FILE_BASE.symbols.diff ]; then 749 SYM_MSG=" diff " 750 if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then 751 DIFF_SYM=true 752 if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then 753 SYM_MSG="*$SYM_MSG*" 754 REGRESSIONS=true 755 else 756 SYM_MSG=" $SYM_MSG " 757 fi 758 else 759 SYM_MSG="($SYM_MSG)" 760 DIFF_SYM= 761 fi 762 else 763 SYM_MSG=" " 764 DIFF_SYM= 765 if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then 766 SYM_MSG=" ! " 767 fi 768 fi 769 770 # Check dependencies 771 if [ -n "$LDD_CMD" ]; then 772 (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) 773 (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) 774 (cd $FILE_WORK_DIR && $RM -f $NAME) 775 776 LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff 777 LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq 778 779 if [ -s $WORK_FILE_BASE.deps.diff ]; then 780 if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then 781 DEP_MSG=" diff " 782 else 783 DEP_MSG=" redun " 784 fi 785 if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then 786 DIFF_DEP=true 787 if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then 788 DEP_MSG="*$DEP_MSG*" 789 REGRESSIONS=true 790 else 791 DEP_MSG=" $DEP_MSG " 792 fi 793 else 794 DEP_MSG="($DEP_MSG)" 795 DIFF_DEP= 796 fi 797 else 798 DEP_MSG=" " 799 DIFF_DEP= 800 if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then 801 DEP_MSG=" ! " 802 fi 803 fi 804 else 805 DEP_MSG=" - " 806 fi 807 808 # Compare fulldump output 809 if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then 810 if [ -z "$FULLDUMP_DIFF_FILTER" ]; then 811 FULLDUMP_DIFF_FILTER="$CAT" 812 fi 813 $FULLDUMP_CMD $OTHER_FILE | eval "$FULLDUMP_DIFF_FILTER" > $WORK_FILE_BASE.fulldump.other 2>&1 814 $FULLDUMP_CMD $THIS_FILE | eval "$FULLDUMP_DIFF_FILTER" > $WORK_FILE_BASE.fulldump.this 2>&1 815 816 LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff 817 818 if [ -s $WORK_FILE_BASE.fulldump.diff ]; then 819 ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}') 820 ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE) 821 if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then 822 DIFF_ELF=true 823 if [[ "$KNOWN_ELF_DIFF" != *"$BIN_FILE"* ]]; then 824 ELF_MSG="*$ELF_MSG*" 825 REGRESSIONS=true 826 else 827 ELF_MSG=" $ELF_MSG " 828 fi 829 else 830 ELF_MSG="($ELF_MSG)" 831 DIFF_ELF= 832 fi 833 else 834 ELF_MSG=" " 835 DIFF_ELF= 836 if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then 837 ELF_MSG=" ! " 838 fi 839 fi 840 fi 841 842 # Compare disassemble output 843 if [ -n "$DIS_CMD" ] && [ -z "$SKIP_DIS_DIFF" ]; then 844 # By default we filter out differences that include references to symbols. 845 # To get a raw diff with the complete disassembly, set 846 # DIS_DIFF_FILTER="$CAT" 847 if [ -z "$DIS_DIFF_FILTER" ]; then 848 DIS_DIFF_FILTER="$GREP -v ' # .* <.*>$'" 849 fi 850 $DIS_CMD $OTHER_FILE | $GREP -v $NAME | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.other 2>&1 851 $DIS_CMD $THIS_FILE | $GREP -v $NAME | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this 2>&1 852 853 LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff 854 855 if [ -s $WORK_FILE_BASE.dis.diff ]; then 856 DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}') 857 DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE) 858 if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then 859 DIFF_DIS=true 860 if [[ "$KNOWN_DIS_DIFF" != *"$BIN_FILE"* ]]; then 861 DIS_MSG="*$DIS_MSG*" 862 REGRESSIONS=true 863 else 864 DIS_MSG=" $DIS_MSG " 865 fi 866 else 867 DIS_MSG="($DIS_MSG)" 868 DIFF_DIS= 869 fi 870 else 871 DIS_MSG=" " 872 DIFF_DIS= 873 if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then 874 DIS_MSG=" ! " 875 fi 876 fi 877 fi 878 879 880 if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_ELF$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then 881 if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi 882 if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi 883 if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi 884 if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi 885 if [ -n "$ELF_MSG" ]; then echo -n "$ELF_MSG:"; fi 886 if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi 887 echo " $BIN_FILE" 888 if [ "$SHOW_DIFFS" = "true" ]; then 889 if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then 890 echo "Symbols diff:" 891 $CAT $WORK_FILE_BASE.symbols.diff 892 fi 893 if [ -s "$WORK_FILE_BASE.deps.diff" ]; then 894 echo "Deps diff:" 895 $CAT $WORK_FILE_BASE.deps.diff 896 fi 897 if [ -s "$WORK_FILE_BASE.fulldump.diff" ]; then 898 echo "Fulldump diff:" 899 $CAT $WORK_FILE_BASE.fulldump.diff 900 fi 901 if [ -s "$WORK_FILE_BASE.dis.diff" ]; then 902 echo "Disassembly diff:" 903 $CAT $WORK_FILE_BASE.dis.diff 904 fi 905 fi 906 return 1 907 fi 908 return 0 909} 910 911################################################################################ 912# Print binary diff header 913 914print_binary_diff_header() { 915 if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi 916 if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n " Size :"; fi 917 if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi 918 if [ -z "$SKIP_DEP_DIFF" ]; then echo -n " Deps :"; fi 919 if [ -z "$SKIP_FULLDUMP_DIFF" ]; then echo -n " Fulldump :"; fi 920 if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass :"; fi 921 echo 922} 923 924################################################################################ 925# Compare all libraries 926 927compare_all_libs() { 928 THIS_DIR=$1 929 OTHER_DIR=$2 930 WORK_DIR=$3 931 932 LIBS=$(cd $THIS_DIR && $FIND . -type f \( -name 'lib*.so' -o -name '*.dylib' \ 933 -o -name '*.dll' -o -name '*.obj' -o -name '*.o' \ 934 -o -name '*.cpl' \) | $SORT | $FILTER) 935 936 if [ -n "$LIBS" ]; then 937 echo Libraries... 938 print_binary_diff_header 939 for l in $LIBS; do 940 if [ -f "$OTHER_DIR/$l" ]; then 941 compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l 942 if [ "$?" != "0" ]; then 943 return_value=1 944 fi 945 fi 946 done 947 fi 948 949 return $return_value 950} 951 952################################################################################ 953# Compare all executables 954 955compare_all_execs() { 956 THIS_DIR=$1 957 OTHER_DIR=$2 958 WORK_DIR=$3 959 960 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then 961 EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER) 962 else 963 EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \ 964 \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' \ 965 -o -name '*.jar' -o -name '*.diz' -o -name 'jcontrol' -o -name '*.properties' \ 966 -o -name '*.data' -o -name '*.bfc' -o -name '*.src' -o -name '*.txt' \ 967 -o -name '*.cfg' -o -name 'meta-index' -o -name '*.properties.ja' \ 968 -o -name 'classlist' \) | $SORT | $FILTER) 969 fi 970 971 if [ -n "$EXECS" ]; then 972 echo Executables... 973 print_binary_diff_header 974 for e in $EXECS; do 975 if [ -f "$OTHER_DIR/$e" ]; then 976 compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e 977 if [ "$?" != "0" ]; then 978 return_value=1 979 fi 980 fi 981 done 982 fi 983 984 return $return_value 985} 986 987################################################################################ 988# Initiate configuration 989 990COMPARE_ROOT=/tmp/cimages.$USER 991$MKDIR -p $COMPARE_ROOT 992if [ "$OPENJDK_TARGET_OS" = "windows" ]; then 993 if [ "$(uname -o)" = "Cygwin" ]; then 994 COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT) 995 fi 996fi 997 998THIS="$( cd "$( dirname "$0" )" > /dev/null && pwd )" 999echo "$THIS" 1000THIS_SCRIPT="$0" 1001 1002if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then 1003 echo "bash ./compare.sh [OPTIONS] [FILTER]" 1004 echo "" 1005 echo "-all Compare all files in all known ways" 1006 echo "-names Compare the file names and directory structure" 1007 echo "-perms Compare the permission bits on all files and directories" 1008 echo "-types Compare the output of the file command on all files" 1009 echo "-general Compare the files not convered by the specialized comparisons" 1010 echo "-zips Compare the contents of all zip files" 1011 echo "-jars Compare the contents of all jar files" 1012 echo "-libs Compare all native libraries" 1013 echo "-execs Compare all executables" 1014 echo "-v Verbose output, does not hide known differences" 1015 echo "-vv More verbose output, shows diff output of all comparisons" 1016 echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory" 1017 echo "" 1018 echo "--strip Strip all binaries before comparing" 1019 echo "" 1020 echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs" 1021 echo "Example:" 1022 echo "bash ./common/bin/compareimages.sh CodePointIM.jar" 1023 echo "" 1024 echo "-2zips <file1> <file2> Compare two zip files only" 1025 echo "-2bins <file1> <file2> Compare two binary files only" 1026 echo "-2dirs <dir1> <dir2> Compare two directories as if they were images" 1027 echo "" 1028 exit 10 1029fi 1030 1031CMP_NAMES=false 1032CMP_PERMS=false 1033CMP_TYPES=false 1034CMP_GENERAL=false 1035CMP_ZIPS=false 1036CMP_JARS=false 1037CMP_LIBS=false 1038CMP_EXECS=false 1039 1040while [ -n "$1" ]; do 1041 case "$1" in 1042 -v) 1043 VERBOSE=true 1044 ;; 1045 -vv) 1046 VERBOSE=true 1047 SHOW_DIFFS=true 1048 ;; 1049 -o) 1050 OTHER="$2" 1051 shift 1052 ;; 1053 -all) 1054 CMP_NAMES=true 1055 if [ "$OPENJDK_TARGET_OS" != "windows" ]; then 1056 CMP_PERMS=true 1057 fi 1058 CMP_TYPES=true 1059 CMP_GENERAL=true 1060 CMP_ZIPS=true 1061 CMP_JARS=true 1062 CMP_LIBS=true 1063 CMP_EXECS=true 1064 ;; 1065 -names) 1066 CMP_NAMES=true 1067 ;; 1068 -perms) 1069 CMP_PERMS=true 1070 ;; 1071 -types) 1072 CMP_TYPES=true 1073 ;; 1074 -general) 1075 CMP_GENERAL=true 1076 ;; 1077 -zips) 1078 CMP_ZIPS=true 1079 ;; 1080 -jars) 1081 CMP_JARS=true 1082 ;; 1083 -libs) 1084 CMP_LIBS=true 1085 ;; 1086 -execs) 1087 CMP_EXECS=true 1088 ;; 1089 -2dirs) 1090 THIS="$(cd "$2" > /dev/null && pwd )" 1091 OTHER="$(cd "$3" > /dev/null && pwd )" 1092 THIS_BASE_DIR="$THIS" 1093 OTHER_BASE_DIR="$OTHER" 1094 SKIP_DEFAULT=true 1095 shift 1096 shift 1097 ;; 1098 -2zips) 1099 CMP_2_ZIPS=true 1100 THIS_FILE=$2 1101 OTHER_FILE=$3 1102 shift 1103 shift 1104 ;; 1105 -2bins) 1106 CMP_2_BINS=true 1107 THIS_FILE=$2 1108 OTHER_FILE=$3 1109 shift 1110 shift 1111 ;; 1112 --strip) 1113 STRIP_ALL=true 1114 ;; 1115 *) 1116 CMP_NAMES=false 1117 CMP_PERMS=false 1118 CMP_TYPES=false 1119 CMP_ZIPS=true 1120 CMP_JARS=true 1121 CMP_LIBS=true 1122 CMP_EXECS=true 1123 1124 if [ -z "$FILTER" ]; then 1125 FILTER="$GREP" 1126 fi 1127 FILTER="$FILTER -e $1" 1128 ;; 1129 esac 1130 shift 1131done 1132 1133if [ "$CMP_2_ZIPS" = "true" ]; then 1134 THIS_DIR="$(dirname $THIS_FILE)" 1135 THIS_DIR="$(cd "$THIS_DIR" > /dev/null && pwd )" 1136 OTHER_DIR="$(dirname $OTHER_FILE)" 1137 OTHER_DIR="$(cd "$OTHER_DIR" > /dev/null && pwd )" 1138 THIS_FILE_NAME="$(basename $THIS_FILE)" 1139 OTHER_FILE_NAME="$(basename $OTHER_FILE)" 1140 echo Comparing $THIS_DIR/$THIS_FILE_NAME and $OTHER_DIR/$OTHER_FILE_NAME 1141 compare_zip_file $THIS_DIR $OTHER_DIR $COMPARE_ROOT/2zips $THIS_FILE_NAME $OTHER_FILE_NAME 1142 exit 1143fi 1144 1145if [ "$CMP_2_BINS" = "true" ]; then 1146 THIS_DIR="$(dirname $THIS_FILE)" 1147 THIS_DIR="$(cd "$THIS_DIR" > /dev/null && pwd )" 1148 OTHER_DIR="$(dirname $OTHER_FILE)" 1149 OTHER_DIR="$(cd "$OTHER_DIR" > /dev/null && pwd )" 1150 THIS_FILE_NAME="$(basename $THIS_FILE)" 1151 OTHER_FILE_NAME="$(basename $OTHER_FILE)" 1152 echo Comparing $THIS_DIR/$THIS_FILE_NAME and $OTHER_DIR/$OTHER_FILE_NAME 1153 compare_bin_file $THIS_DIR $OTHER_DIR $COMPARE_ROOT/2bins $THIS_FILE_NAME $OTHER_FILE_NAME 1154 exit 1155fi 1156 1157if [ "$CMP_NAMES" = "false" ] && [ "$CMP_TYPES" = "false" ] && [ "$CMP_PERMS" = "false" ] && [ "$CMP_GENERAL" = "false" ] && [ "$CMP_ZIPS" = "false" ] && [ "$CMP_JARS" = "false" ] && [ "$CMP_LIBS" = "false" ] && [ "$CMP_EXECS" = "false" ]; then 1158 CMP_NAMES=true 1159 CMP_PERMS=true 1160 CMP_TYPES=true 1161 CMP_GENERAL=true 1162 CMP_ZIPS=true 1163 CMP_JARS=true 1164 CMP_LIBS=true 1165 CMP_EXECS=true 1166fi 1167 1168if [ -z "$FILTER" ]; then 1169 FILTER="$CAT" 1170fi 1171 1172if [ "$SKIP_DEFAULT" != "true" ]; then 1173 if [ -z "$OTHER" ]; then 1174 echo "Nothing to compare to, set with -o" 1175 exit 1 1176 else 1177 if [ ! -d "$OTHER" ]; then 1178 echo "Other build directory does not exist:" 1179 echo "$OTHER" 1180 exit 1 1181 fi 1182 OTHER="$( cd "$OTHER" > /dev/null && pwd )" 1183 echo "Comparing to:" 1184 echo "$OTHER" 1185 echo 1186 fi 1187 1188 1189 # Find the common images to compare, prioritizing later build stages 1190 if [ -d "$THIS/install/jdk" ] && [ -d "$OTHER/install/jdk" ]; then 1191 THIS_JDK="$THIS/install/jdk" 1192 THIS_JRE="$THIS/install/jre" 1193 OTHER_JDK="$OTHER/install/jdk" 1194 OTHER_JRE="$OTHER/install/jre" 1195 echo "Selecting install images for compare" 1196 elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/deploy/images/jdk" ]; then 1197 THIS_JDK="$THIS/images/jdk" 1198 THIS_JRE="$THIS/images/jre" 1199 OTHER_JDK="$OTHER/deploy/images/jdk" 1200 OTHER_JRE="$OTHER/deploy/images/jre" 1201 echo "Selecting deploy images for compare" 1202 elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then 1203 THIS_JDK="$THIS/images/jdk" 1204 THIS_JRE="$THIS/images/jre" 1205 OTHER_JDK="$OTHER/images/jdk" 1206 OTHER_JRE="$OTHER/images/jre" 1207 echo "Selecting jdk images for compare" 1208 else 1209 echo "No common images found." 1210 exit 1 1211 fi 1212 echo " $THIS_JDK" 1213 echo " $OTHER_JDK" 1214 1215 if [ -d "$THIS/images/jdk-bundle" -o -d "$THIS/deploy/images/jdk-bundle" ] \ 1216 && [ -d "$OTHER/images/jdk-bundle" -o -d "$OTHER/deploy/images/jdk-bundle" ]; then 1217 if [ -d "$THIS/deploy/images/jdk-bundle" ]; then 1218 THIS_JDK_BUNDLE="$THIS/deploy/images/jdk-bundle" 1219 THIS_JRE_BUNDLE="$THIS/deploy/images/jre-bundle" 1220 else 1221 THIS_JDK_BUNDLE="$THIS/images/jdk-bundle" 1222 THIS_JRE_BUNDLE="$THIS/images/jre-bundle" 1223 fi 1224 if [ -d "$OTHER/deploy/images/jdk-bundle" ]; then 1225 OTHER_JDK_BUNDLE="$OTHER/deploy/images/jdk-bundle" 1226 OTHER_JRE_BUNDLE="$OTHER/deploy/images/jre-bundle" 1227 else 1228 OTHER_JDK_BUNDLE="$OTHER/images/jdk-bundle" 1229 OTHER_JRE_BUNDLE="$OTHER/images/jre-bundle" 1230 fi 1231 echo "Also comparing macosx bundles" 1232 echo " $THIS_JDK_BUNDLE" 1233 echo " $OTHER_JDK_BUNDLE" 1234 fi 1235 1236 if [ -d "$THIS/deploy/bundles" -o -d "$THIS/deploy/images/bundles" ] \ 1237 && [ -d "$OTHER/deploy/bundles" -o -d "$OTHER/deploy/images/bundles" ]; then 1238 if [ -d "$THIS/deploy/images/bundles" ]; then 1239 THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/images/bundles" 1240 else 1241 THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/bundles" 1242 fi 1243 if [ -d "$OTHER/deploy/images/bundles" ]; then 1244 OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/images/bundles" 1245 else 1246 OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/bundles" 1247 fi 1248 echo "Also comparing deploy javadoc bundles" 1249 fi 1250 1251 if [ -d "$THIS/images/JavaAppletPlugin.plugin" ] \ 1252 && [ -d "$OTHER/images/JavaAppletPlugin.plugin" -o -d "$OTHER/deploy/images/JavaAppletPlugin.plugin" ]; then 1253 if [ -d "$THIS/images/JavaAppletPlugin.plugin" ]; then 1254 THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/images/JavaAppletPlugin.plugin" 1255 else 1256 THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/deploy/images/JavaAppletPlugin.plugin" 1257 fi 1258 if [ -d "$OTHER/images/JavaAppletPlugin.plugin" ]; then 1259 OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/images/JavaAppletPlugin.plugin" 1260 else 1261 OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/deploy/images/JavaAppletPlugin.plugin" 1262 fi 1263 echo "Also comparing deploy applet image" 1264 echo " $THIS_DEPLOY_APPLET_PLUGIN_DIR" 1265 echo " $OTHER_DEPLOY_APPLET_PLUGIN_DIR" 1266 fi 1267 1268 if [ -d "$OTHER/images" ]; then 1269 OTHER_SEC_DIR="$OTHER/images" 1270 else 1271 OTHER_SEC_DIR="$OTHER/tmp" 1272 fi 1273 OTHER_SEC_BIN="$OTHER_SEC_DIR/sec-bin.zip" 1274 THIS_SEC_DIR="$THIS/images" 1275 THIS_SEC_BIN="$THIS_SEC_DIR/sec-bin.zip" 1276 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then 1277 if [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then 1278 JGSS_WINDOWS_BIN="jgss-windows-x64-bin.zip" 1279 else 1280 JGSS_WINDOWS_BIN="jgss-windows-i586-bin.zip" 1281 fi 1282 OTHER_SEC_WINDOWS_BIN="$OTHER_SEC_DIR/sec-windows-bin.zip" 1283 OTHER_JGSS_WINDOWS_BIN="$OTHER_SEC_DIR/$JGSS_WINDOWS_BIN" 1284 THIS_SEC_WINDOWS_BIN="$THIS_SEC_DIR/sec-windows-bin.zip" 1285 THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN" 1286 fi 1287 1288 if [ -d "$THIS/docs" ] && [ -d "$OTHER/docs" ]; then 1289 THIS_DOCS="$THIS/docs" 1290 OTHER_DOCS="$OTHER/docs" 1291 echo "Also comparing docs" 1292 else 1293 echo "WARNING! Docs haven't been built and won't be compared." 1294 fi 1295fi 1296 1297################################################################################ 1298# Do the work 1299 1300if [ "$CMP_NAMES" = "true" ]; then 1301 if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then 1302 echo -n "JDK " 1303 compare_dirs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1304 echo -n "JRE " 1305 compare_dirs $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre 1306 1307 echo -n "JDK " 1308 compare_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1309 echo -n "JRE " 1310 compare_files $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre 1311 fi 1312 if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then 1313 echo -n "JDK Bundle " 1314 compare_dirs $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle 1315 echo -n "JRE Bundle " 1316 compare_dirs $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle 1317 1318 echo -n "JDK Bundle " 1319 compare_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle 1320 echo -n "JRE Bundle " 1321 compare_files $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle 1322 fi 1323 if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then 1324 echo -n "Docs " 1325 compare_dirs $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs 1326 echo -n "Docs " 1327 compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs 1328 fi 1329 if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then 1330 compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1331 compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1332 fi 1333 if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then 1334 echo -n "JavaAppletPlugin " 1335 compare_dirs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1336 echo -n "JavaAppletPlugin " 1337 compare_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1338 fi 1339fi 1340 1341if [ "$CMP_PERMS" = "true" ]; then 1342 if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then 1343 echo -n "JDK " 1344 compare_permissions $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1345 echo -n "JRE " 1346 compare_permissions $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre 1347 fi 1348 if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then 1349 compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1350 fi 1351 if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then 1352 echo -n "JavaAppletPlugin " 1353 compare_permissions $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1354 fi 1355fi 1356 1357if [ "$CMP_TYPES" = "true" ]; then 1358 if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then 1359 echo -n "JDK " 1360 compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1361 echo -n "JRE " 1362 compare_file_types $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre 1363 fi 1364 if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then 1365 echo -n "JDK Bundle " 1366 compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle 1367 echo -n "JRE Bundle " 1368 compare_file_types $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle 1369 fi 1370 if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then 1371 compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1372 fi 1373 if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then 1374 echo -n "JavaAppletPlugin " 1375 compare_file_types $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1376 fi 1377fi 1378 1379if [ "$CMP_GENERAL" = "true" ]; then 1380 if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then 1381 echo -n "JDK " 1382 compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1383 echo -n "JRE " 1384 compare_general_files $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre 1385 fi 1386 if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then 1387 echo -n "JDK Bundle " 1388 compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle 1389 echo -n "JRE Bundle " 1390 compare_general_files $THIS_JRE_BUNDLE $OTHER_JRE_BUNDLE $COMPARE_ROOT/jre-bundle 1391 fi 1392 if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then 1393 echo -n "Docs " 1394 compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs 1395 fi 1396 if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then 1397 compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1398 fi 1399 if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then 1400 echo -n "JavaAppletPlugin " 1401 compare_general_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1402 fi 1403fi 1404 1405if [ "$CMP_ZIPS" = "true" ]; then 1406 if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then 1407 compare_all_zip_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1408 fi 1409 if [ -n "$THIS_SEC_BIN" ] && [ -n "$OTHER_SEC_BIN" ]; then 1410 if [ -n "$(echo $THIS_SEC_BIN | $FILTER)" ]; then 1411 echo "sec-bin.zip..." 1412 compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-bin.zip 1413 fi 1414 fi 1415 if [ -n "$THIS_SEC_WINDOWS_BIN" ] && [ -n "$OTHER_SEC_WINDOWS_BIN" ]; then 1416 if [ -n "$(echo $THIS_SEC_WINDOWS_BIN | $FILTER)" ]; then 1417 echo "sec-windows-bin.zip..." 1418 compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-windows-bin.zip 1419 fi 1420 fi 1421 if [ -n "$THIS_JGSS_WINDOWS_BIN" ] && [ -n "$OTHER_JGSS_WINDOWS_BIN" ]; then 1422 if [ -n "$(echo $THIS_JGSS_WINDOWS_BIN | $FILTER)" ]; then 1423 echo "$JGSS_WINDOWS_BIN..." 1424 compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin $JGSS_WINDOWS_BIN 1425 fi 1426 fi 1427 if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then 1428 compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1429 fi 1430 if [ -n "$THIS_DEPLOY_BUNDLE_DIR" ] && [ -n "$OTHER_DEPLOY_BUNDLE_DIR" ]; then 1431 compare_all_zip_files $THIS_DEPLOY_BUNDLE_DIR $OTHER_DEPLOY_BUNDLE_DIR $COMPARE_ROOT/deploy-bundle 1432 fi 1433 if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then 1434 compare_all_zip_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1435 fi 1436fi 1437 1438if [ "$CMP_JARS" = "true" ]; then 1439 if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then 1440 compare_all_jar_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1441 fi 1442 if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then 1443 compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1444 fi 1445 if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then 1446 compare_all_jar_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1447 fi 1448fi 1449 1450if [ "$CMP_LIBS" = "true" ]; then 1451 if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then 1452 echo -n "JDK " 1453 compare_all_libs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1454 if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then 1455 echo -n "JRE " 1456 compare_all_libs $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre 1457 fi 1458 fi 1459 if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then 1460 compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1461 fi 1462 if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then 1463 echo -n "JavaAppletPlugin " 1464 compare_all_libs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1465 fi 1466fi 1467 1468if [ "$CMP_EXECS" = "true" ]; then 1469 if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then 1470 compare_all_execs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk 1471 if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then 1472 echo -n "JRE " 1473 compare_all_execs $THIS_JRE $OTHER_JRE $COMPARE_ROOT/jre 1474 fi 1475 fi 1476 if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then 1477 compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir 1478 fi 1479 if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then 1480 echo -n "JavaAppletPlugin " 1481 compare_all_execs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin 1482 fi 1483fi 1484 1485echo 1486 1487if [ -n "$REGRESSIONS" ]; then 1488 echo "REGRESSIONS FOUND!" 1489 echo 1490 exit 1 1491else 1492 echo "No regressions found" 1493 echo 1494 exit 0 1495fi 1496