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