< prev index next >

make/scripts/compare.sh

Print this page




 195                      -e '/[<>].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d')
 196         fi
 197     fi
 198     if test "x$SUFFIX" = "xproperties"; then
 199         # Filter out date string differences.
 200         TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
 201             $GREP '^[<>]' | \
 202             $SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d')
 203     fi
 204     if test "x$SUFFIX" = "xhtml"; then
 205         # Some javadoc versions do not put quotes around font size
 206         HTML_FILTER="$SED \
 207             -e 's/<font size=-1>/<font size=\"-1\">/g'"
 208         $CAT $THIS_FILE | eval "$HTML_FILTER" > $THIS_FILE.filtered
 209         $CAT $OTHER_FILE | eval "$HTML_FILTER" > $OTHER_FILE.filtered
 210         TMP=$(LC_ALL=C $DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \
 211             $GREP '^[<>]' | \
 212             $SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \
 213                  -e '/[<>] <meta name="date" content=".*">/d' )
 214     fi





 215     if test -n "$TMP"; then
 216         echo Files $OTHER_FILE and $THIS_FILE differ
 217         return 1
 218     fi
 219 
 220     return 0
 221 }
 222 
 223 ################################################################################
 224 # Compare directory structure
 225 
 226 compare_dirs() {
 227     THIS_DIR=$1
 228     OTHER_DIR=$2
 229     WORK_DIR=$3
 230 
 231     mkdir -p $WORK_DIR
 232 
 233     (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other)
 234     (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this)


 365     done
 366     if [ -z "$found" ]; then
 367         echo "Identical!"
 368     else
 369         REGRESSIONS=true
 370     fi
 371 }
 372 
 373 ################################################################################
 374 # Compare the rest of the files
 375 
 376 compare_general_files() {
 377     THIS_DIR=$1
 378     OTHER_DIR=$2
 379     WORK_DIR=$3
 380 
 381     GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" \
 382         ! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
 383         ! -name "modules" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
 384         ! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
 385         ! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" ! -name "*.jmod" \
 386         ! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
 387         ! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
 388         ! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \
 389         ! -name "finish_installation" ! -name "Sparkle" ! -name "*.tar.gz" \
 390         ! -name "classes.jsa" \
 391         | $GREP -v "./bin/"  | $SORT | $FILTER)
 392 
 393     echo Other files with binary differences...
 394     for f in $GENERAL_FILES
 395     do




 396         if [ -e $OTHER_DIR/$f ]; then
 397             SUFFIX="${f##*.}"
 398             if [ "$(basename $f)" = "release" ]; then
 399                 # In release file, ignore differences in change numbers and order
 400                 # of modules in list.
 401                 OTHER_FILE=$WORK_DIR/$f.other
 402                 THIS_FILE=$WORK_DIR/$f.this
 403                 $MKDIR -p $(dirname $OTHER_FILE)
 404                 $MKDIR -p $(dirname $THIS_FILE)
 405                 RELEASE_FILTER="$SED \
 406                     -e 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' \
 407                     -e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g' \
 408                     -e 's/^#.*/#COMMENT/g' \
 409                     -e 's/MODULES=/MODULES=\'$'\n/' \
 410                     -e 's/,/\'$'\n/g' \
 411                     | $SORT
 412                     "
 413                 $CAT $OTHER_DIR/$f | eval "$RELEASE_FILTER" > $OTHER_FILE
 414                 $CAT $THIS_DIR/$f  | eval "$RELEASE_FILTER" > $THIS_FILE
 415             elif [ "x$SUFFIX" = "xhtml" ]; then
 416                 # Ignore time stamps in docs files
 417                 OTHER_FILE=$WORK_DIR/$f.other
 418                 THIS_FILE=$WORK_DIR/$f.this
 419                 $MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
 420                 # Older versions of compare might have left soft links with
 421                 # these names.
 422                 $RM $OTHER_FILE $THIS_FILE
 423                 #Note that | doesn't work on mac sed.
 424                 HTML_FILTER="$SED \
 425                     -e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6,7\}/<DATE>/g' \
 426                     -e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}/<DATE>/g' \
 427                     -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
 428                     -e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [0-9]\{4\} [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/<DATE>/' \
 429                     -e 's/from .*\.idl/\.idl/' \
 430                     "
 431                 $CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE &
 432                 $CAT $THIS_DIR/$f  | eval "$HTML_FILTER" > $THIS_FILE &
 433                 wait
 434             elif [[ "$f" = *"/lib/classlist" ]]; then
 435                 # The classlist files may have some lines in random order
 436                 OTHER_FILE=$WORK_DIR/$f.other
 437                 THIS_FILE=$WORK_DIR/$f.this
 438                 $MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
 439                 $RM $OTHER_FILE $THIS_FILE
 440                 $CAT $OTHER_DIR/$f | $SORT > $OTHER_FILE
 441                 $CAT $THIS_DIR/$f  | $SORT > $THIS_FILE
 442             else
 443                 OTHER_FILE=$OTHER_DIR/$f
 444                 THIS_FILE=$THIS_DIR/$f
 445             fi
 446             DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1)
 447             if [ -n "$DIFF_OUT" ]; then
 448                 echo $f
 449                 REGRESSIONS=true
 450                 if [ "$SHOW_DIFFS" = "true" ]; then
 451                     echo "$DIFF_OUT"
 452                 fi
 453             fi
 454         fi


 775         $STRIP $OTHER_STRIPPED_FILE
 776         THIS_FILE="$THIS_STRIPPED_FILE"
 777         OTHER_FILE="$OTHER_STRIPPED_FILE"
 778     fi
 779 
 780     if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
 781         unset _NT_SYMBOL_PATH
 782         if [ "$(uname -o)" = "Cygwin" ]; then
 783             THIS=$(cygpath -msa $THIS)
 784             OTHER=$(cygpath -msa $OTHER)
 785         fi
 786         # Build an _NT_SYMBOL_PATH that contains all known locations for
 787         # pdb files.
 788         PDB_DIRS="$(ls -d \
 789             {$OTHER,$THIS}/support/modules_{cmds,libs}/{*,*/*} \
 790             {$OTHER,$THIS}/support/native/java.base/java_objs \
 791             )"
 792         export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')"
 793     fi
 794 
 795     if [ -z "$SKIP_BIN_DIFF" ]; then
 796         if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
 797         # The files were bytewise identical.
 798             if [ -n "$VERBOSE" ]; then
 799                 echo "        :           :         :         :          :          : $BIN_FILE"
 800             fi
 801             return 0
 802         fi

 803         BIN_MSG=" diff "
 804         if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then
 805             DIFF_BIN=true
 806             if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then
 807                 BIN_MSG="*$BIN_MSG*"
 808                 REGRESSIONS=true
 809             else
 810                 BIN_MSG=" $BIN_MSG "
 811             fi
 812         else
 813             BIN_MSG="($BIN_MSG)"
 814             DIFF_BIN=
 815         fi
 816     fi
 817 
 818     if [ -n "$STAT" ]; then
 819         THIS_SIZE=$($STAT $STAT_PRINT_SIZE "$THIS_FILE")
 820         OTHER_SIZE=$($STAT $STAT_PRINT_SIZE "$OTHER_FILE")
 821     else
 822         THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }')
 823         OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }')
 824     fi
 825     if [ $THIS_SIZE -ne $OTHER_SIZE ]; then
 826         DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE)
 827         DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE)
 828         SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM)
 829         if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] \

 830             && [ "$DIFF_SIZE_REL" -lt 102 ]; then
 831             SIZE_MSG="($SIZE_MSG)"
 832             DIFF_SIZE=
 833         elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
 834             && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
 835             && [ "$DIFF_SIZE_NUM" = 512 ]; then
 836             # On windows, size of binaries increase in 512 increments.
 837             SIZE_MSG="($SIZE_MSG)"
 838             DIFF_SIZE=
 839         elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
 840             && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
 841             && [ "$DIFF_SIZE_NUM" = -512 ]; then
 842             # On windows, size of binaries increase in 512 increments.
 843             SIZE_MSG="($SIZE_MSG)"
 844             DIFF_SIZE=
 845         else
 846             if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
 847                 DIFF_SIZE=true
 848                 if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
 849                     SIZE_MSG="*$SIZE_MSG*"


1423 if [ -z "$FILTER" ]; then
1424     FILTER="$CAT"
1425 fi
1426 
1427 if [ "$SKIP_DEFAULT" != "true" ]; then
1428     if [ -z "$OTHER" ]; then
1429         echo "Nothing to compare to, set with -o"
1430         exit 1
1431     else
1432         if [ ! -d "$OTHER" ]; then
1433             echo "Other build directory does not exist:"
1434             echo "$OTHER"
1435             exit 1
1436         fi
1437         OTHER="$( cd "$OTHER" > /dev/null && pwd )"
1438         echo "Comparing to:"
1439         echo "$OTHER"
1440         echo
1441     fi
1442 
1443 
1444     # Find the common images to compare, prioritizing later build stages
1445     if [ -d "$THIS/install/jdk" ] && [ -d "$OTHER/install/jdk" ]; then
1446         THIS_JDK="$THIS/install/jdk"
1447         OTHER_JDK="$OTHER/install/jdk"
1448         echo "Selecting install images for JDK compare"
1449     elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then
1450         THIS_JDK="$THIS/images/jdk"
1451         OTHER_JDK="$OTHER/images/jdk"
1452         echo "Selecting normal images for JDK compare"
1453     elif [ -d "$(ls -d $THIS/licensee-src/build/*/images/jdk 2> /dev/null)" ] \
1454         && [ -d "$(ls -d $OTHER/licensee-src/build/*/images/jdk 2> /dev/null)" ]
1455     then
1456         echo "Selecting licensee images for compare"
1457         # Simply override the THIS and OTHER dir with the build dir from
1458         # the nested licensee source build for the rest of the script
1459         # execution.
1460         OLD_THIS="$THIS"
1461         OLD_OTHER="$OTHER"
1462         THIS="$(ls -d $THIS/licensee-src/build/*)"
1463         OTHER="$(ls -d $OTHER/licensee-src/build/*)"
1464         THIS_JDK="$THIS/images/jdk"
1465         OTHER_JDK="$OTHER/images/jdk"
1466         # Rewrite the path to tools that are used from the build
1467         JIMAGE="$(echo "$JIMAGE" | $SED "s|$OLD_THIS|$THIS|g")"
1468         JMOD="$(echo "$JMOD" | $SED "s|$OLD_THIS|$THIS|g")"
1469         JAVAP="$(echo "$JAVAP" | $SED "s|$OLD_THIS|$THIS|g")"


1474     echo "  $THIS_JDK"
1475     echo "  $OTHER_JDK"
1476 
1477     if [ -d "$THIS/images/jdk-bundle" -o -d "$THIS/deploy/images/jdk-bundle" ] \
1478              && [ -d "$OTHER/images/jdk-bundle" -o -d "$OTHER/deploy/images/jdk-bundle" ]; then
1479         if [ -d "$THIS/deploy/images/jdk-bundle" ]; then
1480             THIS_JDK_BUNDLE="$THIS/deploy/images/jdk-bundle"
1481         else
1482             THIS_JDK_BUNDLE="$THIS/images/jdk-bundle"
1483         fi
1484         if [ -d "$OTHER/deploy/images/jdk-bundle" ]; then
1485             OTHER_JDK_BUNDLE="$OTHER/deploy/images/jdk-bundle"
1486         else
1487             OTHER_JDK_BUNDLE="$OTHER/images/jdk-bundle"
1488         fi
1489         echo "Also comparing jdk macosx bundles"
1490         echo "  $THIS_JDK_BUNDLE"
1491         echo "  $OTHER_JDK_BUNDLE"
1492     fi
1493 
1494     if [ -d "$THIS/deploy/bundles" -o -d "$THIS/deploy/images/bundles" ] \
1495              && [ -d "$OTHER/deploy/bundles" -o -d "$OTHER/deploy/images/bundles" ]; then
1496         if [ -d "$THIS/deploy/images/bundles" ]; then
1497             THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/images/bundles"
1498         else
1499             THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/bundles"
1500         fi
1501         if [ -d "$OTHER/deploy/images/bundles" ]; then
1502             OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/images/bundles"
1503         else
1504             OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/bundles"
1505         fi
1506         echo "Also comparing deploy javadoc bundles"
1507     fi
1508 
1509     if [ -d "$THIS/images/JavaAppletPlugin.plugin" ] \
1510              && [ -d "$OTHER/images/JavaAppletPlugin.plugin" -o -d "$OTHER/deploy/images/JavaAppletPlugin.plugin" ]; then
1511         if [ -d "$THIS/images/JavaAppletPlugin.plugin" ]; then
1512             THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/images/JavaAppletPlugin.plugin"
1513         else
1514             THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/deploy/images/JavaAppletPlugin.plugin"
1515         fi
1516         if [ -d "$OTHER/images/JavaAppletPlugin.plugin" ]; then
1517             OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/images/JavaAppletPlugin.plugin"
1518         else
1519             OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/deploy/images/JavaAppletPlugin.plugin"
1520         fi
1521         echo "Also comparing deploy applet image"
1522         echo "  $THIS_DEPLOY_APPLET_PLUGIN_DIR"
1523         echo "  $OTHER_DEPLOY_APPLET_PLUGIN_DIR"
1524     fi
1525 
1526     if [ -d "$THIS/install/sparkle/Sparkle.framework" ] \
1527            && [ -d "$OTHER/install/sparkle/Sparkle.framework" ]; then
1528         THIS_SPARKLE_DIR="$THIS/install/sparkle/Sparkle.framework"
1529         OTHER_SPARKLE_DIR="$OTHER/install/sparkle/Sparkle.framework"
1530         echo "Also comparing install sparkle framework"
1531         echo "  $THIS_SPARKLE_DIR"
1532         echo "  $OTHER_SPARKLE_DIR"
1533     fi
1534 
1535     THIS_SEC_DIR="$THIS/images"
1536     OTHER_SEC_DIR="$OTHER/images"
1537     if [ -f "$THIS_SEC_DIR/sec-bin.zip" ] && [ -f "$OTHER_SEC_DIR/sec-bin.zip" ]; then
1538         OTHER_SEC_BIN="$OTHER_SEC_DIR/sec-bin.zip"
1539         THIS_SEC_BIN="$THIS_SEC_DIR/sec-bin.zip"
1540         if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
1541             if [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
1542                 JGSS_WINDOWS_BIN="jgss-windows-x64-bin.zip"
1543             else
1544                 JGSS_WINDOWS_BIN="jgss-windows-i586-bin.zip"
1545             fi
1546             OTHER_SEC_WINDOWS_BIN="$OTHER_SEC_DIR/sec-windows-bin.zip"
1547             OTHER_JGSS_WINDOWS_BIN="$OTHER_SEC_DIR/$JGSS_WINDOWS_BIN"
1548             THIS_SEC_WINDOWS_BIN="$THIS_SEC_DIR/sec-windows-bin.zip"
1549             THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
1550         fi
1551     fi
1552 
1553     if [ -d "$THIS/images/docs" ] && [ -d "$OTHER/images/docs" ]; then
1554         THIS_DOCS="$THIS/images/docs"
1555         OTHER_DOCS="$OTHER/images/docs"
1556         echo "Also comparing docs"
1557     else
1558         echo "WARNING! Docs haven't been built and won't be compared."
1559     fi








1560 fi
1561 
1562 ################################################################################
1563 # Do the work
1564 
1565 if [ "$CMP_NAMES" = "true" ]; then
1566     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1567         echo -n "JDK "
1568         compare_dirs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1569         echo -n "JDK "
1570         compare_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1571     fi
1572     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
1573         echo -n "JDK Bundle "
1574         compare_dirs $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
1575 
1576         echo -n "JDK Bundle "
1577         compare_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
1578     fi
1579     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
1580         echo -n "Docs "
1581         compare_dirs $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
1582         echo -n "Docs "
1583         compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
1584     fi






1585     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1586         compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1587         compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1588     fi
1589     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
1590         echo -n "JavaAppletPlugin "
1591         compare_dirs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1592         echo -n "JavaAppletPlugin "
1593         compare_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1594     fi
1595     if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
1596         echo -n "Sparkle.framework "
1597         compare_dirs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
1598         echo -n "Sparkle.framework "
1599         compare_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
1600     fi
1601 fi
1602 
1603 if [ "$CMP_LIBS" = "true" ]; then
1604     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1605         echo -n "JDK "
1606         compare_all_libs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1607     fi












1608     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1609         compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1610     fi
1611     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
1612         echo -n "JavaAppletPlugin "
1613         compare_all_libs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1614     fi
1615     if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
1616         echo -n "Sparkle.framework "
1617         compare_all_libs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
1618     fi
1619 fi
1620 
1621 if [ "$CMP_EXECS" = "true" ]; then
1622     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then

1623         compare_all_execs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1624     fi







1625     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1626         compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1627     fi
1628     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
1629         echo -n "JavaAppletPlugin "
1630         compare_all_execs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1631     fi
1632     if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
1633         echo -n "Sparkle.framework "
1634         compare_all_execs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
1635     fi
1636 fi
1637 
1638 if [ "$CMP_GENERAL" = "true" ]; then
1639     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1640         echo -n "JDK "
1641         compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1642     fi
1643     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
1644         echo -n "JDK Bundle "
1645         compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
1646     fi
1647     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
1648         echo -n "Docs "
1649         compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
1650     fi




1651     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1652         compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1653     fi
1654     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
1655         echo -n "JavaAppletPlugin "
1656         compare_general_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1657     fi
1658     if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
1659         echo -n "Sparkle.framework "
1660         compare_general_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
1661     fi
1662 fi
1663 
1664 if [ "$CMP_ZIPS" = "true" ]; then
1665     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then

1666         compare_all_zip_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1667     fi




1668     if [ -n "$THIS_SEC_BIN" ] && [ -n "$OTHER_SEC_BIN" ]; then
1669         if [ -n "$(echo $THIS_SEC_BIN | $FILTER)" ]; then
1670             echo "sec-bin.zip..."
1671             compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-bin.zip
1672         fi
1673     fi
1674     if [ -n "$THIS_SEC_WINDOWS_BIN" ] && [ -n "$OTHER_SEC_WINDOWS_BIN" ]; then
1675         if [ -n "$(echo $THIS_SEC_WINDOWS_BIN | $FILTER)" ]; then
1676             echo "sec-windows-bin.zip..."
1677             compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-windows-bin.zip
1678         fi
1679     fi
1680     if [ -n "$THIS_JGSS_WINDOWS_BIN" ] && [ -n "$OTHER_JGSS_WINDOWS_BIN" ]; then
1681         if [ -n "$(echo $THIS_JGSS_WINDOWS_BIN | $FILTER)" ]; then
1682             echo "$JGSS_WINDOWS_BIN..."
1683             compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin $JGSS_WINDOWS_BIN
1684         fi
1685     fi
1686     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1687         compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1688     fi
1689     if [ -n "$THIS_DEPLOY_BUNDLE_DIR" ] && [ -n "$OTHER_DEPLOY_BUNDLE_DIR" ]; then
1690         compare_all_zip_files $THIS_DEPLOY_BUNDLE_DIR $OTHER_DEPLOY_BUNDLE_DIR $COMPARE_ROOT/deploy-bundle
1691     fi
1692     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
1693         compare_all_zip_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1694     fi
1695 fi
1696 
1697 if [ "$CMP_JARS" = "true" ]; then
1698     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then

1699         compare_all_jar_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1700     fi




1701     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1702         compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1703     fi
1704     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
1705         compare_all_jar_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1706     fi
1707 fi
1708 
1709 if [ "$CMP_JMODS" = "true" ]; then
1710     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1711         compare_all_jmod_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1712     fi
1713     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1714         compare_all_jmod_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1715     fi
1716 fi
1717 
1718 if [ "$CMP_PERMS" = "true" ]; then
1719     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1720         echo -n "JDK "
1721         compare_permissions $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1722     fi
1723     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1724         compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1725     fi
1726     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
1727         echo -n "JavaAppletPlugin "
1728         compare_permissions $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1729     fi
1730     if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
1731         echo -n "Sparkle.framework "
1732         compare_permissions $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
1733     fi
1734 fi
1735 
1736 if [ "$CMP_TYPES" = "true" ]; then
1737     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1738         echo -n "JDK "
1739         compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1740     fi
1741     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
1742         echo -n "JDK Bundle "
1743         compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
1744     fi




1745     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1746         compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1747     fi
1748     if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
1749         echo -n "JavaAppletPlugin "
1750         compare_file_types $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
1751     fi
1752     if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
1753         echo -n "Sparkle.framework "
1754         compare_file_types $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
1755     fi
1756 fi
1757 
1758 echo
1759 
1760 if [ -n "$REGRESSIONS" ]; then
1761     echo "REGRESSIONS FOUND!"
1762     echo
1763     exit 1
1764 else
1765     echo "No regressions found"
1766     echo
1767     exit 0
1768 fi


 195                      -e '/[<>].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d')
 196         fi
 197     fi
 198     if test "x$SUFFIX" = "xproperties"; then
 199         # Filter out date string differences.
 200         TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
 201             $GREP '^[<>]' | \
 202             $SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d')
 203     fi
 204     if test "x$SUFFIX" = "xhtml"; then
 205         # Some javadoc versions do not put quotes around font size
 206         HTML_FILTER="$SED \
 207             -e 's/<font size=-1>/<font size=\"-1\">/g'"
 208         $CAT $THIS_FILE | eval "$HTML_FILTER" > $THIS_FILE.filtered
 209         $CAT $OTHER_FILE | eval "$HTML_FILTER" > $OTHER_FILE.filtered
 210         TMP=$(LC_ALL=C $DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \
 211             $GREP '^[<>]' | \
 212             $SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \
 213                  -e '/[<>] <meta name="date" content=".*">/d' )
 214     fi
 215     if test "$NAME" = "BenchmarkList"; then
 216         $SORT $THIS_FILE > $THIS_FILE.sorted
 217         $SORT $OTHER_FILE > $OTHER_FILE.sorted
 218         TMP=$($DIFF $THIS_FILE.sorted $OTHER_FILE.sorted)
 219     fi
 220     if test -n "$TMP"; then
 221         echo Files $OTHER_FILE and $THIS_FILE differ
 222         return 1
 223     fi
 224 
 225     return 0
 226 }
 227 
 228 ################################################################################
 229 # Compare directory structure
 230 
 231 compare_dirs() {
 232     THIS_DIR=$1
 233     OTHER_DIR=$2
 234     WORK_DIR=$3
 235 
 236     mkdir -p $WORK_DIR
 237 
 238     (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other)
 239     (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this)


 370     done
 371     if [ -z "$found" ]; then
 372         echo "Identical!"
 373     else
 374         REGRESSIONS=true
 375     fi
 376 }
 377 
 378 ################################################################################
 379 # Compare the rest of the files
 380 
 381 compare_general_files() {
 382     THIS_DIR=$1
 383     OTHER_DIR=$2
 384     WORK_DIR=$3
 385 
 386     GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" \
 387         ! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
 388         ! -name "modules" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
 389         ! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
 390         ! -name "*.lib" ! -name "*.war" ! -name "*.jmod" ! -name "*.exe" \
 391         ! -name "*.obj" ! -name "*.o" ! -name "jspawnhelper" ! -name "*.a" \
 392         ! -name "*.tar.gz" ! -name "classes.jsa" ! -name "gtestLauncher" \
 393         ! -name "*.map" \


 394         | $GREP -v "./bin/"  | $SORT | $FILTER)
 395 
 396     echo Other files with binary differences...
 397     for f in $GENERAL_FILES
 398     do
 399         # Skip all files in test/*/native
 400         if [[ "$f" == */native/* ]]; then
 401             continue
 402         fi
 403         if [ -e $OTHER_DIR/$f ]; then
 404             SUFFIX="${f##*.}"
 405             if [ "$(basename $f)" = "release" ]; then
 406                 # In release file, ignore differences in change numbers and order
 407                 # of modules in list.
 408                 OTHER_FILE=$WORK_DIR/$f.other
 409                 THIS_FILE=$WORK_DIR/$f.this
 410                 $MKDIR -p $(dirname $OTHER_FILE)
 411                 $MKDIR -p $(dirname $THIS_FILE)
 412                 RELEASE_FILTER="$SED \
 413                     -e 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' \
 414                     -e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g' \
 415                     -e 's/^#.*/#COMMENT/g' \
 416                     -e 's/MODULES=/MODULES=\'$'\n/' \
 417                     -e 's/,/\'$'\n/g' \
 418                     | $SORT
 419                     "
 420                 $CAT $OTHER_DIR/$f | eval "$RELEASE_FILTER" > $OTHER_FILE
 421                 $CAT $THIS_DIR/$f  | eval "$RELEASE_FILTER" > $THIS_FILE
 422             elif [ "x$SUFFIX" = "xhtml" ]; then
 423                 # Ignore time stamps in docs files
 424                 OTHER_FILE=$WORK_DIR/$f.other
 425                 THIS_FILE=$WORK_DIR/$f.this
 426                 $MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
 427                 # Older versions of compare might have left soft links with
 428                 # these names.
 429                 $RM $OTHER_FILE $THIS_FILE
 430                 #Note that | doesn't work on mac sed.
 431                 HTML_FILTER="$SED \
 432                     -e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6,7\}/<DATE>/g' \
 433                     -e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}/<DATE>/g' \
 434                     -e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
 435                     -e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [0-9]\{4\} [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/<DATE>/' \
 436                     -e 's/from .*\.idl/\.idl/' \
 437                     "
 438                 $CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE &
 439                 $CAT $THIS_DIR/$f  | eval "$HTML_FILTER" > $THIS_FILE &
 440                 wait
 441             elif [[ "$f" = *"/lib/classlist" ]] || [ "$SUFFIX" = "jar_contents" ]; then
 442                 # The classlist files may have some lines in random order
 443                 OTHER_FILE=$WORK_DIR/$f.other
 444                 THIS_FILE=$WORK_DIR/$f.this
 445                 $MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
 446                 $RM $OTHER_FILE $THIS_FILE
 447                 $CAT $OTHER_DIR/$f | $SORT > $OTHER_FILE
 448                 $CAT $THIS_DIR/$f  | $SORT > $THIS_FILE
 449             else
 450                 OTHER_FILE=$OTHER_DIR/$f
 451                 THIS_FILE=$THIS_DIR/$f
 452             fi
 453             DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1)
 454             if [ -n "$DIFF_OUT" ]; then
 455                 echo $f
 456                 REGRESSIONS=true
 457                 if [ "$SHOW_DIFFS" = "true" ]; then
 458                     echo "$DIFF_OUT"
 459                 fi
 460             fi
 461         fi


 782         $STRIP $OTHER_STRIPPED_FILE
 783         THIS_FILE="$THIS_STRIPPED_FILE"
 784         OTHER_FILE="$OTHER_STRIPPED_FILE"
 785     fi
 786 
 787     if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
 788         unset _NT_SYMBOL_PATH
 789         if [ "$(uname -o)" = "Cygwin" ]; then
 790             THIS=$(cygpath -msa $THIS)
 791             OTHER=$(cygpath -msa $OTHER)
 792         fi
 793         # Build an _NT_SYMBOL_PATH that contains all known locations for
 794         # pdb files.
 795         PDB_DIRS="$(ls -d \
 796             {$OTHER,$THIS}/support/modules_{cmds,libs}/{*,*/*} \
 797             {$OTHER,$THIS}/support/native/java.base/java_objs \
 798             )"
 799         export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')"
 800     fi
 801 

 802     if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
 803         # The files were bytewise identical.
 804         if [ -n "$VERBOSE" ]; then
 805             echo "        :           :         :         :          :          : $BIN_FILE"
 806         fi
 807         return 0
 808     fi
 809     if [ -z "$SKIP_BIN_DIFF" ]; then
 810         BIN_MSG=" diff "
 811         if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then
 812             DIFF_BIN=true
 813             if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then
 814                 BIN_MSG="*$BIN_MSG*"
 815                 REGRESSIONS=true
 816             else
 817                 BIN_MSG=" $BIN_MSG "
 818             fi
 819         else
 820             BIN_MSG="($BIN_MSG)"
 821             DIFF_BIN=
 822         fi
 823     fi
 824 
 825     if [ -n "$STAT" ]; then
 826         THIS_SIZE=$($STAT $STAT_PRINT_SIZE "$THIS_FILE")
 827         OTHER_SIZE=$($STAT $STAT_PRINT_SIZE "$OTHER_FILE")
 828     else
 829         THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }')
 830         OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }')
 831     fi
 832     if [ $THIS_SIZE -ne $OTHER_SIZE ]; then
 833         DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE)
 834         DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE)
 835         SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM)
 836         if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* || "$ACCEPTED_SMALL_SIZE_DIFF" = "true" ]] \
 837             && [ "$DIFF_SIZE_REL" -gt 98 ] \
 838             && [ "$DIFF_SIZE_REL" -lt 102 ]; then
 839             SIZE_MSG="($SIZE_MSG)"
 840             DIFF_SIZE=
 841         elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
 842             && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
 843             && [ "$DIFF_SIZE_NUM" = 512 ]; then
 844             # On windows, size of binaries increase in 512 increments.
 845             SIZE_MSG="($SIZE_MSG)"
 846             DIFF_SIZE=
 847         elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
 848             && [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
 849             && [ "$DIFF_SIZE_NUM" = -512 ]; then
 850             # On windows, size of binaries increase in 512 increments.
 851             SIZE_MSG="($SIZE_MSG)"
 852             DIFF_SIZE=
 853         else
 854             if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
 855                 DIFF_SIZE=true
 856                 if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
 857                     SIZE_MSG="*$SIZE_MSG*"


1431 if [ -z "$FILTER" ]; then
1432     FILTER="$CAT"
1433 fi
1434 
1435 if [ "$SKIP_DEFAULT" != "true" ]; then
1436     if [ -z "$OTHER" ]; then
1437         echo "Nothing to compare to, set with -o"
1438         exit 1
1439     else
1440         if [ ! -d "$OTHER" ]; then
1441             echo "Other build directory does not exist:"
1442             echo "$OTHER"
1443             exit 1
1444         fi
1445         OTHER="$( cd "$OTHER" > /dev/null && pwd )"
1446         echo "Comparing to:"
1447         echo "$OTHER"
1448         echo
1449     fi
1450 

1451     # Find the common images to compare, prioritizing later build stages
1452     if [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then




1453         THIS_JDK="$THIS/images/jdk"
1454         OTHER_JDK="$OTHER/images/jdk"
1455         echo "Selecting normal images for JDK compare"
1456     elif [ -d "$(ls -d $THIS/licensee-src/build/*/images/jdk 2> /dev/null)" ] \
1457         && [ -d "$(ls -d $OTHER/licensee-src/build/*/images/jdk 2> /dev/null)" ]
1458     then
1459         echo "Selecting licensee images for compare"
1460         # Simply override the THIS and OTHER dir with the build dir from
1461         # the nested licensee source build for the rest of the script
1462         # execution.
1463         OLD_THIS="$THIS"
1464         OLD_OTHER="$OTHER"
1465         THIS="$(ls -d $THIS/licensee-src/build/*)"
1466         OTHER="$(ls -d $OTHER/licensee-src/build/*)"
1467         THIS_JDK="$THIS/images/jdk"
1468         OTHER_JDK="$OTHER/images/jdk"
1469         # Rewrite the path to tools that are used from the build
1470         JIMAGE="$(echo "$JIMAGE" | $SED "s|$OLD_THIS|$THIS|g")"
1471         JMOD="$(echo "$JMOD" | $SED "s|$OLD_THIS|$THIS|g")"
1472         JAVAP="$(echo "$JAVAP" | $SED "s|$OLD_THIS|$THIS|g")"


1477     echo "  $THIS_JDK"
1478     echo "  $OTHER_JDK"
1479 
1480     if [ -d "$THIS/images/jdk-bundle" -o -d "$THIS/deploy/images/jdk-bundle" ] \
1481              && [ -d "$OTHER/images/jdk-bundle" -o -d "$OTHER/deploy/images/jdk-bundle" ]; then
1482         if [ -d "$THIS/deploy/images/jdk-bundle" ]; then
1483             THIS_JDK_BUNDLE="$THIS/deploy/images/jdk-bundle"
1484         else
1485             THIS_JDK_BUNDLE="$THIS/images/jdk-bundle"
1486         fi
1487         if [ -d "$OTHER/deploy/images/jdk-bundle" ]; then
1488             OTHER_JDK_BUNDLE="$OTHER/deploy/images/jdk-bundle"
1489         else
1490             OTHER_JDK_BUNDLE="$OTHER/images/jdk-bundle"
1491         fi
1492         echo "Also comparing jdk macosx bundles"
1493         echo "  $THIS_JDK_BUNDLE"
1494         echo "  $OTHER_JDK_BUNDLE"
1495     fi
1496 









































1497     THIS_SEC_DIR="$THIS/images"
1498     OTHER_SEC_DIR="$OTHER/images"
1499     if [ -f "$THIS_SEC_DIR/sec-bin.zip" ] && [ -f "$OTHER_SEC_DIR/sec-bin.zip" ]; then
1500         OTHER_SEC_BIN="$OTHER_SEC_DIR/sec-bin.zip"
1501         THIS_SEC_BIN="$THIS_SEC_DIR/sec-bin.zip"
1502         if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
1503             if [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
1504                 JGSS_WINDOWS_BIN="jgss-windows-x64-bin.zip"
1505             else
1506                 JGSS_WINDOWS_BIN="jgss-windows-i586-bin.zip"
1507             fi
1508             OTHER_SEC_WINDOWS_BIN="$OTHER_SEC_DIR/sec-windows-bin.zip"
1509             OTHER_JGSS_WINDOWS_BIN="$OTHER_SEC_DIR/$JGSS_WINDOWS_BIN"
1510             THIS_SEC_WINDOWS_BIN="$THIS_SEC_DIR/sec-windows-bin.zip"
1511             THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
1512         fi
1513     fi
1514 
1515     if [ -d "$THIS/images/docs" ] && [ -d "$OTHER/images/docs" ]; then
1516         THIS_DOCS="$THIS/images/docs"
1517         OTHER_DOCS="$OTHER/images/docs"
1518         echo "Also comparing docs"
1519     else
1520         echo "WARNING! Docs haven't been built and won't be compared."
1521     fi
1522 
1523     if [ -d "$THIS/images/test" ] && [ -d "$OTHER/images/test" ]; then
1524         THIS_TEST="$THIS/images/test"
1525         OTHER_TEST="$OTHER/images/test"
1526         echo "Also comparing test image"
1527     else
1528         echo "WARNING! Test haven't been built and won't be compared."
1529     fi
1530 fi
1531 
1532 ################################################################################
1533 # Do the work
1534 
1535 if [ "$CMP_NAMES" = "true" ]; then
1536     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1537         echo -n "JDK "
1538         compare_dirs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1539         echo -n "JDK "
1540         compare_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1541     fi
1542     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
1543         echo -n "JDK Bundle "
1544         compare_dirs $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
1545 
1546         echo -n "JDK Bundle "
1547         compare_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
1548     fi
1549     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
1550         echo -n "Docs "
1551         compare_dirs $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
1552         echo -n "Docs "
1553         compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
1554     fi
1555     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
1556         echo -n "Test "
1557         compare_dirs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
1558         echo -n "Test "
1559         compare_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
1560     fi
1561     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1562         compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1563         compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1564     fi












1565 fi
1566 
1567 if [ "$CMP_LIBS" = "true" ]; then
1568     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1569         echo -n "JDK "
1570         compare_all_libs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1571     fi
1572     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
1573         echo -n "Test "
1574         # Test native libs are never stripped so will not compare well.
1575         SKIP_BIN_DIFF="true"
1576         ACCEPTED_SMALL_SIZE_DIFF_bak="$ACCEPTED_SMALL_SIZE_DIFF"
1577         if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
1578             ACCEPTED_SMALL_SIZE_DIFF="true"
1579         fi
1580         compare_all_libs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
1581         SKIP_BIN_DIFF="false"
1582         ACCEPTED_SMALL_SIZE_DIFF="$ACCEPTED_SMALL_SIZE_DIFF_bak"
1583     fi
1584     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1585         compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1586     fi








1587 fi
1588 
1589 if [ "$CMP_EXECS" = "true" ]; then
1590     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1591         echo -n "JDK "
1592         compare_all_execs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1593     fi
1594     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
1595         echo -n "Test "
1596         # Test native executables are never stripped so will not compare well.
1597         SKIP_BIN_DIFF="true"
1598         compare_all_execs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
1599         SKIP_BIN_DIFF="false"
1600     fi
1601     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1602         compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1603     fi








1604 fi
1605 
1606 if [ "$CMP_GENERAL" = "true" ]; then
1607     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1608         echo -n "JDK "
1609         compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1610     fi
1611     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
1612         echo -n "JDK Bundle "
1613         compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
1614     fi
1615     if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
1616         echo -n "Docs "
1617         compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
1618     fi
1619     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
1620         echo -n "Test "
1621         compare_general_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
1622     fi
1623     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1624         compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1625     fi








1626 fi
1627 
1628 if [ "$CMP_ZIPS" = "true" ]; then
1629     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1630         echo -n "JDK "
1631         compare_all_zip_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1632     fi
1633     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
1634         echo -n "Test "
1635         compare_all_zip_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
1636     fi
1637     if [ -n "$THIS_SEC_BIN" ] && [ -n "$OTHER_SEC_BIN" ]; then
1638         if [ -n "$(echo $THIS_SEC_BIN | $FILTER)" ]; then
1639             echo "sec-bin.zip..."
1640             compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-bin.zip
1641         fi
1642     fi
1643     if [ -n "$THIS_SEC_WINDOWS_BIN" ] && [ -n "$OTHER_SEC_WINDOWS_BIN" ]; then
1644         if [ -n "$(echo $THIS_SEC_WINDOWS_BIN | $FILTER)" ]; then
1645             echo "sec-windows-bin.zip..."
1646             compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-windows-bin.zip
1647         fi
1648     fi
1649     if [ -n "$THIS_JGSS_WINDOWS_BIN" ] && [ -n "$OTHER_JGSS_WINDOWS_BIN" ]; then
1650         if [ -n "$(echo $THIS_JGSS_WINDOWS_BIN | $FILTER)" ]; then
1651             echo "$JGSS_WINDOWS_BIN..."
1652             compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin $JGSS_WINDOWS_BIN
1653         fi
1654     fi
1655     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1656         compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1657     fi






1658 fi
1659 
1660 if [ "$CMP_JARS" = "true" ]; then
1661     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1662         echo -n "JDK "
1663         compare_all_jar_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1664     fi
1665     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
1666         echo -n "Test "
1667         compare_all_jar_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
1668     fi
1669     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1670         compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1671     fi



1672 fi
1673 
1674 if [ "$CMP_JMODS" = "true" ]; then
1675     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1676         compare_all_jmod_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1677     fi
1678     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1679         compare_all_jmod_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1680     fi
1681 fi
1682 
1683 if [ "$CMP_PERMS" = "true" ]; then
1684     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1685         echo -n "JDK "
1686         compare_permissions $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1687     fi
1688     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1689         compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
1690     fi








1691 fi
1692 
1693 if [ "$CMP_TYPES" = "true" ]; then
1694     if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
1695         echo -n "JDK "
1696         compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1697     fi
1698     if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
1699         echo -n "JDK Bundle "
1700         compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
1701     fi
1702     if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
1703         echo -n "Test "
1704         compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
1705     fi
1706     if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
1707         compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir








1708     fi
1709 fi
1710 
1711 echo
1712 
1713 if [ -n "$REGRESSIONS" ]; then
1714     echo "REGRESSIONS FOUND!"
1715     echo
1716     exit 1
1717 else
1718     echo "No regressions found"
1719     echo
1720     exit 0
1721 fi
< prev index next >