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