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