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