2012-10-27 01:29:57 +04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2021-09-28 11:10:08 +03:00
|
|
|
# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
|
2012-10-27 01:29:57 +04:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
2015-01-15 17:09:37 +03:00
|
|
|
# This script is processed by configure before it's usable. It is run from
|
2012-10-27 01:29:57 +04:00
|
|
|
# the root of the build directory.
|
|
|
|
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
|
|
|
|
# Check that we are run via the wrapper generated by configure
|
2017-09-25 11:21:23 +03:00
|
|
|
if [ -z "$TOPDIR" ]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
echo "Error: You must run this script using build/[conf]/compare.sh"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-12-29 13:34:07 +03:00
|
|
|
# Make sure all shell commands are executed with the C locale
|
|
|
|
export LC_ALL=C
|
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
FULLDUMP_CMD="$OTOOL -v -V -h -X -d"
|
2012-10-27 01:29:57 +04:00
|
|
|
LDD_CMD="$OTOOL -L"
|
2015-12-15 13:02:03 +03:00
|
|
|
DIS_CMD="$OTOOL -v -V -t"
|
2012-10-27 01:29:57 +04:00
|
|
|
STAT_PRINT_SIZE="-f %z"
|
2024-07-18 11:06:18 +03:00
|
|
|
STRIP="$STRIP -no_code_signature_warning"
|
2012-10-27 01:29:57 +04:00
|
|
|
elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
|
|
|
FULLDUMP_CMD="$DUMPBIN -all"
|
2016-04-14 17:42:21 +03:00
|
|
|
LDD_CMD="$DUMPBIN -dependents"
|
2012-10-27 01:29:57 +04:00
|
|
|
DIS_CMD="$DUMPBIN -disasm:nobytes"
|
|
|
|
STAT_PRINT_SIZE="-c %s"
|
2015-12-15 13:02:03 +03:00
|
|
|
elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
|
|
|
|
FULLDUMP_CMD="dump -h -r -t -n -X64"
|
|
|
|
LDD_CMD="$LDD"
|
|
|
|
DIS_CMD="$OBJDUMP -d"
|
|
|
|
STAT_PRINT_SIZE="-c %s"
|
2012-10-27 01:29:57 +04:00
|
|
|
else
|
|
|
|
FULLDUMP_CMD="$READELF -a"
|
|
|
|
LDD_CMD="$LDD"
|
|
|
|
DIS_CMD="$OBJDUMP -d"
|
|
|
|
STAT_PRINT_SIZE="-c %s"
|
|
|
|
fi
|
|
|
|
|
2017-09-25 11:21:23 +03:00
|
|
|
COMPARE_EXCEPTIONS_INCLUDE="$TOPDIR/make/scripts/compare_exceptions.sh.incl"
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ ! -e "$COMPARE_EXCEPTIONS_INCLUDE" ]; then
|
|
|
|
echo "Error: Cannot locate the exceptions file, it should have been here: $COMPARE_EXCEPTIONS_INCLUDE"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
# Include exception definitions
|
|
|
|
. "$COMPARE_EXCEPTIONS_INCLUDE"
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare text files and ignore specific differences:
|
|
|
|
#
|
|
|
|
# * Timestamps in Java sources generated by idl2java
|
|
|
|
# * Sorting order and cleanup style in .properties files
|
|
|
|
|
|
|
|
diff_text() {
|
|
|
|
OTHER_FILE=$1
|
|
|
|
THIS_FILE=$2
|
|
|
|
|
|
|
|
SUFFIX="${THIS_FILE##*.}"
|
2016-04-06 12:16:37 +03:00
|
|
|
NAME="${THIS_FILE##*/}"
|
2012-10-27 01:29:57 +04:00
|
|
|
|
|
|
|
TMP=1
|
|
|
|
|
|
|
|
if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then
|
2015-01-15 17:09:37 +03:00
|
|
|
# Filter out date string, ant version and java version differences.
|
2021-12-29 13:34:07 +03:00
|
|
|
TMP=$($DIFF $OTHER_FILE $THIS_FILE | \
|
2012-10-27 01:29:57 +04:00
|
|
|
$GREP '^[<>]' | \
|
|
|
|
$SED -e '/[<>] Ant-Version: Apache Ant .*/d' \
|
2015-01-15 17:09:37 +03:00
|
|
|
-e '/[<>] Created-By: .* (Oracle [Corpatin)]*/d' \
|
|
|
|
-e '/[<>] [Corpatin]*)/d' \
|
|
|
|
-e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d')
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
if test "x$SUFFIX" = "xjava"; then
|
2021-12-29 13:34:07 +03:00
|
|
|
TMP=$($DIFF $OTHER_FILE $THIS_FILE | \
|
2012-10-27 01:29:57 +04:00
|
|
|
$GREP '^[<>]' | \
|
|
|
|
$SED -e '/[<>] \* from.*\.idl/d' \
|
2015-09-25 09:58:49 +03:00
|
|
|
-e '/[<>] .*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
|
2016-04-06 12:16:37 +03:00
|
|
|
-e '/[<>] .*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d' \
|
2018-02-19 12:57:05 +03:00
|
|
|
-e '/[<>] \*.*[0-9]\{4\} \(at \)*[0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \
|
2012-10-27 01:29:57 +04:00
|
|
|
-e '/\/\/ Generated from input file.*/d' \
|
|
|
|
-e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \
|
|
|
|
-e '/\/\/ java GenerateCharacter.*/d')
|
|
|
|
fi
|
|
|
|
# Ignore date strings in class files.
|
2014-08-17 18:51:37 +04:00
|
|
|
# Anonymous lambda classes get randomly assigned counters in their names.
|
2012-10-27 01:29:57 +04:00
|
|
|
if test "x$SUFFIX" = "xclass"; then
|
2018-02-19 12:57:05 +03:00
|
|
|
if [ "$NAME" = "SystemModules\$all.class" ] \
|
|
|
|
|| [ "$NAME" = "SystemModules\$default.class" ]; then
|
|
|
|
# The SystemModules\$*.classes are not comparable as they contain the
|
|
|
|
# module hashes which would require a whole other level of
|
|
|
|
# reproducible builds to get reproducible. There is also random
|
|
|
|
# order of map initialization.
|
2016-07-01 19:29:24 +03:00
|
|
|
TMP=""
|
|
|
|
elif [ "$NAME" = "module-info.class" ]; then
|
|
|
|
# The module-info.class have several issues with random ordering of
|
|
|
|
# elements in HashSets.
|
2016-04-06 12:16:37 +03:00
|
|
|
MODULES_CLASS_FILTER="$SED \
|
|
|
|
-e 's/,$//' \
|
|
|
|
-e 's/;$//' \
|
|
|
|
-e 's/^ *[0-9]*://' \
|
|
|
|
-e 's/#[0-9]* */#/' \
|
|
|
|
-e 's/ *\/\// \/\//' \
|
|
|
|
-e 's/aload *[0-9]*/aload X/' \
|
|
|
|
-e 's/ldc_w/ldc /' \
|
|
|
|
| $SORT \
|
|
|
|
"
|
|
|
|
$JAVAP -c -constants -l -p "${OTHER_FILE}" \
|
|
|
|
| eval "$MODULES_CLASS_FILTER" > ${OTHER_FILE}.javap &
|
|
|
|
$JAVAP -c -constants -l -p "${THIS_FILE}" \
|
|
|
|
| eval "$MODULES_CLASS_FILTER" > ${THIS_FILE}.javap &
|
|
|
|
wait
|
|
|
|
TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap)
|
2012-10-27 01:29:57 +04:00
|
|
|
# To improve performance when large diffs are found, do a rough filtering of classes
|
|
|
|
# elibeble for these exceptions
|
2016-04-06 12:16:37 +03:00
|
|
|
elif $GREP -R -e '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}' \
|
|
|
|
-e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null
|
|
|
|
then
|
|
|
|
$JAVAP -c -constants -l -p "${OTHER_FILE}" > ${OTHER_FILE}.javap &
|
|
|
|
$JAVAP -c -constants -l -p "${THIS_FILE}" > ${THIS_FILE}.javap &
|
|
|
|
wait
|
2012-10-27 01:29:57 +04:00
|
|
|
TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
|
|
|
|
$GREP '^[<>]' | \
|
2016-02-11 13:54:00 +03:00
|
|
|
$SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d' \
|
2014-08-17 18:51:37 +04:00
|
|
|
-e '/[<>].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d')
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x$SUFFIX" = "xproperties"; then
|
2014-08-17 18:51:37 +04:00
|
|
|
# Filter out date string differences.
|
2021-12-29 13:34:07 +03:00
|
|
|
TMP=$($DIFF $OTHER_FILE $THIS_FILE | \
|
2014-08-17 18:51:37 +04:00
|
|
|
$GREP '^[<>]' | \
|
2016-02-11 13:54:00 +03:00
|
|
|
$SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d')
|
2014-08-17 18:51:37 +04:00
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if test "x$SUFFIX" = "xhtml"; then
|
2015-02-27 19:27:11 +03:00
|
|
|
# Some javadoc versions do not put quotes around font size
|
|
|
|
HTML_FILTER="$SED \
|
|
|
|
-e 's/<font size=-1>/<font size=\"-1\">/g'"
|
|
|
|
$CAT $THIS_FILE | eval "$HTML_FILTER" > $THIS_FILE.filtered
|
|
|
|
$CAT $OTHER_FILE | eval "$HTML_FILTER" > $OTHER_FILE.filtered
|
2021-12-29 13:34:07 +03:00
|
|
|
TMP=$($DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \
|
2014-08-17 18:51:37 +04:00
|
|
|
$GREP '^[<>]' | \
|
2015-02-27 19:27:11 +03:00
|
|
|
$SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \
|
|
|
|
-e '/[<>] <meta name="date" content=".*">/d' )
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
if test -n "$TMP"; then
|
|
|
|
echo Files $OTHER_FILE and $THIS_FILE differ
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare directory structure
|
|
|
|
|
|
|
|
compare_dirs() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
|
|
|
|
mkdir -p $WORK_DIR
|
|
|
|
|
|
|
|
(cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other)
|
|
|
|
(cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this)
|
|
|
|
|
2014-08-17 18:51:37 +04:00
|
|
|
$DIFF $WORK_DIR/dirs_other $WORK_DIR/dirs_this > $WORK_DIR/dirs_diff
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
echo -n Directory structure...
|
|
|
|
if [ -s $WORK_DIR/dirs_diff ]; then
|
|
|
|
echo Differences found.
|
|
|
|
REGRESSIONS=true
|
|
|
|
# Differences in directories found.
|
|
|
|
ONLY_OTHER=$($GREP '<' $WORK_DIR/dirs_diff)
|
|
|
|
if [ "$ONLY_OTHER" ]; then
|
|
|
|
echo Only in $OTHER
|
|
|
|
$GREP '<' $WORK_DIR/dirs_diff | $SED 's|< ./| |g'
|
|
|
|
fi
|
|
|
|
ONLY_THIS=$($GREP '>' $WORK_DIR/dirs_diff)
|
|
|
|
if [ "$ONLY_THIS" ]; then
|
|
|
|
echo Only in $THIS
|
|
|
|
$GREP '>' $WORK_DIR/dirs_diff | $SED 's|> ./| |g'
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo Identical!
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare file structure
|
|
|
|
|
|
|
|
compare_files() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
|
|
|
|
$MKDIR -p $WORK_DIR
|
|
|
|
|
|
|
|
(cd $OTHER_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_other)
|
|
|
|
(cd $THIS_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_this)
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
$DIFF $WORK_DIR/files_other $WORK_DIR/files_this > $WORK_DIR/files_diff
|
|
|
|
|
|
|
|
echo -n File names...
|
|
|
|
if [ -s $WORK_DIR/files_diff ]; then
|
|
|
|
echo Differences found.
|
|
|
|
REGRESSIONS=true
|
|
|
|
# Differences in files found.
|
|
|
|
ONLY_OTHER=$($GREP '<' $WORK_DIR/files_diff)
|
|
|
|
if [ "$ONLY_OTHER" ]; then
|
|
|
|
echo Only in $OTHER
|
|
|
|
$GREP '<' $WORK_DIR/files_diff | $SED 's|< ./| |g'
|
|
|
|
fi
|
|
|
|
ONLY_THIS=$($GREP '>' $WORK_DIR/files_diff)
|
|
|
|
if [ "$ONLY_THIS" ]; then
|
|
|
|
echo Only in $THIS
|
|
|
|
$GREP '>' $WORK_DIR/files_diff | $SED 's|> ./| |g'
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo Identical!
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare permissions
|
|
|
|
|
|
|
|
compare_permissions() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
|
|
|
|
mkdir -p $WORK_DIR
|
|
|
|
|
|
|
|
echo -n Permissions...
|
|
|
|
found=""
|
|
|
|
for f in `cd $OTHER_DIR && $FIND . -type f`
|
|
|
|
do
|
|
|
|
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
|
|
|
|
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
|
|
|
|
OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
|
|
|
|
TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
|
|
|
|
if [ "$OP" != "$TP" ]
|
|
|
|
then
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -z "$found" ]; then echo ; found="yes"; fi
|
|
|
|
$PRINTF "\tother: ${OP} this: ${TP}\t$f\n"
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
done
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -z "$found" ]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
echo "Identical!"
|
|
|
|
else
|
|
|
|
REGRESSIONS=true
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare file command output
|
|
|
|
|
|
|
|
compare_file_types() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
|
|
|
|
$MKDIR -p $WORK_DIR
|
|
|
|
|
2016-05-04 16:29:01 +03:00
|
|
|
FILE_TYPES_FILTER="$SED \
|
|
|
|
-e 's/BuildID[^,]*//' \
|
|
|
|
-e 's/last modified: .*//' \
|
|
|
|
"
|
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
echo -n File types...
|
|
|
|
found=""
|
|
|
|
for f in `cd $OTHER_DIR && $FIND . ! -type d`
|
|
|
|
do
|
|
|
|
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
|
|
|
|
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
|
2016-05-04 16:29:01 +03:00
|
|
|
OF=$(cd ${OTHER_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER)
|
|
|
|
TF=$(cd ${THIS_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER)
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ "$OF" != "$TF" ]
|
|
|
|
then
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ "`echo $OF | $GREP -c 'Zip archive data'`" -gt 0 ] \
|
|
|
|
&& [ "`echo $TF | $GREP -c 'Zip archive data'`" -gt 0 ]
|
|
|
|
then
|
|
|
|
# the way we produce zip-files make it so that directories are stored in
|
|
|
|
# old file but not in new (only files with full-path) this makes file
|
|
|
|
# report them as different
|
|
|
|
continue
|
|
|
|
else
|
|
|
|
if [ -z "$found" ]; then echo ; found="yes"; fi
|
|
|
|
$PRINTF "\tother: ${OF}\n\tthis : ${TF}\n"
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
done
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -z "$found" ]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
echo "Identical!"
|
|
|
|
else
|
|
|
|
REGRESSIONS=true
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare the rest of the files
|
|
|
|
|
|
|
|
compare_general_files() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" \
|
|
|
|
! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
|
2016-03-17 22:03:53 +03:00
|
|
|
! -name "modules" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
|
2015-02-27 19:27:11 +03:00
|
|
|
! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
|
2016-03-17 22:03:53 +03:00
|
|
|
! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" ! -name "*.jmod" \
|
2015-02-27 19:27:11 +03:00
|
|
|
! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
|
|
|
|
! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
|
2016-02-11 13:54:00 +03:00
|
|
|
! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \
|
2016-05-04 16:29:01 +03:00
|
|
|
! -name "finish_installation" ! -name "Sparkle" ! -name "*.tar.gz" \
|
2012-10-27 01:29:57 +04:00
|
|
|
| $GREP -v "./bin/" | $SORT | $FILTER)
|
|
|
|
|
2015-09-25 09:58:49 +03:00
|
|
|
echo Other files with binary differences...
|
2012-10-27 01:29:57 +04:00
|
|
|
for f in $GENERAL_FILES
|
|
|
|
do
|
|
|
|
if [ -e $OTHER_DIR/$f ]; then
|
2012-11-28 16:40:17 +04:00
|
|
|
SUFFIX="${f##*.}"
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ "$(basename $f)" = "release" ]; then
|
2016-04-06 12:16:37 +03:00
|
|
|
# In release file, ignore differences in change numbers and order
|
|
|
|
# of modules in list.
|
2012-10-27 01:29:57 +04:00
|
|
|
OTHER_FILE=$WORK_DIR/$f.other
|
|
|
|
THIS_FILE=$WORK_DIR/$f.this
|
|
|
|
$MKDIR -p $(dirname $OTHER_FILE)
|
|
|
|
$MKDIR -p $(dirname $THIS_FILE)
|
2016-02-11 13:54:00 +03:00
|
|
|
RELEASE_FILTER="$SED \
|
|
|
|
-e 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' \
|
2016-04-06 12:16:37 +03:00
|
|
|
-e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g' \
|
|
|
|
-e 's/^#.*/#COMMENT/g' \
|
|
|
|
-e 's/MODULES=/MODULES=\'$'\n/' \
|
|
|
|
-e 's/,/\'$'\n/g' \
|
|
|
|
| $SORT
|
2016-02-11 13:54:00 +03:00
|
|
|
"
|
|
|
|
$CAT $OTHER_DIR/$f | eval "$RELEASE_FILTER" > $OTHER_FILE
|
|
|
|
$CAT $THIS_DIR/$f | eval "$RELEASE_FILTER" > $THIS_FILE
|
2012-11-28 16:40:17 +04:00
|
|
|
elif [ "x$SUFFIX" = "xhtml" ]; then
|
|
|
|
# Ignore time stamps in docs files
|
|
|
|
OTHER_FILE=$WORK_DIR/$f.other
|
|
|
|
THIS_FILE=$WORK_DIR/$f.this
|
2016-02-11 13:54:00 +03:00
|
|
|
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
|
|
|
|
# Older versions of compare might have left soft links with
|
|
|
|
# these names.
|
|
|
|
$RM $OTHER_FILE $THIS_FILE
|
2013-01-03 23:54:38 +04:00
|
|
|
#Note that | doesn't work on mac sed.
|
2016-02-11 13:54:00 +03:00
|
|
|
HTML_FILTER="$SED \
|
2017-09-12 20:03:56 +03:00
|
|
|
-e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6,7\}/<DATE>/g' \
|
2016-06-21 21:28:12 +03:00
|
|
|
-e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}/<DATE>/g' \
|
2016-02-11 13:54:00 +03:00
|
|
|
-e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
|
2016-06-21 21:28:12 +03:00
|
|
|
-e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [0-9]\{4\} [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/<DATE>/' \
|
|
|
|
-e 's/from .*\.idl/\.idl/' \
|
2016-02-11 13:54:00 +03:00
|
|
|
"
|
2016-04-06 12:16:37 +03:00
|
|
|
$CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE &
|
|
|
|
$CAT $THIS_DIR/$f | eval "$HTML_FILTER" > $THIS_FILE &
|
|
|
|
wait
|
2016-11-15 12:00:00 +03:00
|
|
|
elif [[ "$f" = *"/lib/classlist" ]]; then
|
2016-07-01 19:29:24 +03:00
|
|
|
# The classlist files may have some lines in random order
|
|
|
|
OTHER_FILE=$WORK_DIR/$f.other
|
|
|
|
THIS_FILE=$WORK_DIR/$f.this
|
|
|
|
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE)
|
|
|
|
$RM $OTHER_FILE $THIS_FILE
|
|
|
|
$CAT $OTHER_DIR/$f | $SORT > $OTHER_FILE
|
|
|
|
$CAT $THIS_DIR/$f | $SORT > $THIS_FILE
|
2012-10-27 01:29:57 +04:00
|
|
|
else
|
|
|
|
OTHER_FILE=$OTHER_DIR/$f
|
|
|
|
THIS_FILE=$THIS_DIR/$f
|
|
|
|
fi
|
|
|
|
DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1)
|
|
|
|
if [ -n "$DIFF_OUT" ]; then
|
|
|
|
echo $f
|
|
|
|
REGRESSIONS=true
|
|
|
|
if [ "$SHOW_DIFFS" = "true" ]; then
|
|
|
|
echo "$DIFF_OUT"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare zip file
|
|
|
|
|
|
|
|
compare_zip_file() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
ZIP_FILE=$4
|
2013-01-23 14:41:06 +04:00
|
|
|
# Optionally provide different name for other zipfile
|
|
|
|
OTHER_ZIP_FILE=$5
|
2012-10-27 01:29:57 +04:00
|
|
|
|
|
|
|
THIS_ZIP=$THIS_DIR/$ZIP_FILE
|
2013-01-23 14:41:06 +04:00
|
|
|
if [ -n "$OTHER_ZIP_FILE" ]; then
|
|
|
|
OTHER_ZIP=$OTHER_DIR/$OTHER_ZIP_FILE
|
|
|
|
else
|
|
|
|
OTHER_ZIP=$OTHER_DIR/$ZIP_FILE
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
|
|
|
|
THIS_SUFFIX="${THIS_ZIP##*.}"
|
|
|
|
OTHER_SUFFIX="${OTHER_ZIP##*.}"
|
|
|
|
if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then
|
2015-01-15 17:09:37 +03:00
|
|
|
echo "The files do not have the same suffix type! ($THIS_SUFFIX != $OTHER_SUFFIX)"
|
2012-10-27 01:29:57 +04:00
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
TYPE="$THIS_SUFFIX"
|
|
|
|
|
|
|
|
if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null
|
|
|
|
then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
# Not quite identical, the might still contain the same data.
|
|
|
|
# Unpack the jar/zip files in temp dirs
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this
|
|
|
|
OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other
|
|
|
|
$RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
|
|
|
|
$MKDIR -p $THIS_UNZIPDIR
|
|
|
|
$MKDIR -p $OTHER_UNZIPDIR
|
2016-04-06 12:16:37 +03:00
|
|
|
if [ "$TYPE" = "jar" -o "$TYPE" = "war" -o "$TYPE" = "zip" -o "$TYPE" = "jmod" ]
|
2014-12-03 17:20:21 +03:00
|
|
|
then
|
|
|
|
(cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
|
|
|
|
(cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
|
2016-05-04 16:29:01 +03:00
|
|
|
elif [ "$TYPE" = "gz" ]
|
|
|
|
then
|
|
|
|
(cd $THIS_UNZIPDIR && $GUNZIP -c $THIS_ZIP | $TAR xf -)
|
|
|
|
(cd $OTHER_UNZIPDIR && $GUNZIP -c $OTHER_ZIP | $TAR xf -)
|
2016-03-17 22:03:53 +03:00
|
|
|
else
|
|
|
|
(cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
|
|
|
|
(cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
|
2014-12-03 17:20:21 +03:00
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
|
2012-11-04 03:28:14 +04:00
|
|
|
# Find all archives inside and unzip them as well to compare the contents rather than
|
2013-01-03 23:54:38 +04:00
|
|
|
# the archives. pie.jar.pack.gz i app3.war is corrupt, skip it.
|
2017-09-12 20:03:56 +03:00
|
|
|
EXCEPTIONS="pie.jar.pack.gz jdk.pack"
|
|
|
|
for pack in $($FIND $THIS_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a \
|
|
|
|
! -name pie.jar.pack.gz -a ! -name jdk.pack); do
|
2012-11-04 03:28:14 +04:00
|
|
|
($UNPACK200 $pack $pack.jar)
|
|
|
|
# Filter out the unzipped archives from the diff below.
|
|
|
|
EXCEPTIONS="$EXCEPTIONS $pack $pack.jar"
|
|
|
|
done
|
2017-09-12 20:03:56 +03:00
|
|
|
for pack in $($FIND $OTHER_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a \
|
|
|
|
! -name pie.jar.pack.gz -a ! -name jdk.pack); do
|
2012-11-04 03:28:14 +04:00
|
|
|
($UNPACK200 $pack $pack.jar)
|
|
|
|
EXCEPTIONS="$EXCEPTIONS $pack $pack.jar"
|
|
|
|
done
|
|
|
|
for zip in $($FIND $THIS_UNZIPDIR -name "*.jar" -o -name "*.zip"); do
|
|
|
|
$MKDIR $zip.unzip
|
|
|
|
(cd $zip.unzip && $UNARCHIVE $zip)
|
|
|
|
EXCEPTIONS="$EXCEPTIONS $zip"
|
|
|
|
done
|
|
|
|
for zip in $($FIND $OTHER_UNZIPDIR -name "*.jar" -o -name "*.zip"); do
|
|
|
|
$MKDIR $zip.unzip
|
|
|
|
(cd $zip.unzip && $UNARCHIVE $zip)
|
|
|
|
EXCEPTIONS="$EXCEPTIONS $zip"
|
|
|
|
done
|
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff
|
|
|
|
# On solaris, there is no -q option.
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \
|
2012-10-27 01:29:57 +04:00
|
|
|
| $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \
|
|
|
|
> $CONTENTS_DIFF_FILE
|
|
|
|
else
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE)
|
|
|
|
ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE)
|
|
|
|
|
|
|
|
return_value=0
|
|
|
|
|
|
|
|
if [ -n "$ONLY_OTHER" ]; then
|
|
|
|
echo " Only OTHER $ZIP_FILE contains:"
|
|
|
|
echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g'
|
|
|
|
return_value=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$ONLY_THIS" ]; then
|
|
|
|
echo " Only THIS $ZIP_FILE contains:"
|
|
|
|
echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g'
|
|
|
|
return_value=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
DIFFING_FILES=$($GREP -e 'differ$' -e '^diff ' $CONTENTS_DIFF_FILE \
|
|
|
|
| $SED -e 's/^Files //g' -e 's/diff -r //g' | $CUT -f 1 -d ' ' \
|
|
|
|
| $SED "s|$OTHER_UNZIPDIR/||g")
|
2012-10-27 01:29:57 +04:00
|
|
|
else
|
|
|
|
DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \
|
|
|
|
| $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
|
|
|
|
fi
|
|
|
|
|
2016-12-13 14:31:43 +03:00
|
|
|
if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then
|
|
|
|
$RM -f $WORK_DIR/$ZIP_FILE.diffs
|
|
|
|
for file in $DIFFING_FILES; do
|
|
|
|
if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then
|
|
|
|
diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs
|
|
|
|
fi
|
|
|
|
done
|
2012-10-27 01:29:57 +04:00
|
|
|
|
2016-12-13 14:31:43 +03:00
|
|
|
if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then
|
|
|
|
return_value=1
|
|
|
|
echo " Differing files in $ZIP_FILE"
|
|
|
|
$CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP 'differ$' | cut -f 2 -d ' ' | \
|
|
|
|
$SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist
|
|
|
|
$CAT $WORK_DIR/$ZIP_FILE.difflist
|
|
|
|
|
|
|
|
if [ -n "$SHOW_DIFFS" ]; then
|
|
|
|
for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do
|
|
|
|
if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
|
2016-12-13 14:31:43 +03:00
|
|
|
elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
|
2016-12-13 14:31:43 +03:00
|
|
|
else
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
|
2016-12-13 14:31:43 +03:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
return $return_value
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare all zip files
|
|
|
|
|
|
|
|
compare_all_zip_files() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
|
2016-05-04 16:29:01 +03:00
|
|
|
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" -o -name "*.tar.gz" \
|
|
|
|
| $SORT | $FILTER )
|
2012-10-27 01:29:57 +04:00
|
|
|
|
|
|
|
if [ -n "$ZIPS" ]; then
|
2016-05-04 16:29:01 +03:00
|
|
|
echo Zip/tar.gz files...
|
2012-10-27 01:29:57 +04:00
|
|
|
|
|
|
|
return_value=0
|
|
|
|
for f in $ZIPS; do
|
|
|
|
if [ -f "$OTHER_DIR/$f" ]; then
|
|
|
|
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
|
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
return_value=1
|
|
|
|
REGRESSIONS=true
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
return $return_value
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare all jar files
|
|
|
|
|
|
|
|
compare_all_jar_files() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
|
|
|
|
# TODO filter?
|
2014-08-17 18:51:37 +04:00
|
|
|
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \
|
2016-04-06 12:16:37 +03:00
|
|
|
-o -name "modules" | $SORT | $FILTER)
|
2012-10-27 01:29:57 +04:00
|
|
|
|
|
|
|
if [ -n "$ZIPS" ]; then
|
|
|
|
echo Jar files...
|
|
|
|
|
|
|
|
return_value=0
|
|
|
|
for f in $ZIPS; do
|
|
|
|
if [ -f "$OTHER_DIR/$f" ]; then
|
|
|
|
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
|
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
return_value=1
|
|
|
|
REGRESSIONS=true
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
return $return_value
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare binary (executable/library) file
|
|
|
|
|
|
|
|
compare_bin_file() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
BIN_FILE=$4
|
2014-08-17 18:51:37 +04:00
|
|
|
OTHER_BIN_FILE=$5
|
2012-10-27 01:29:57 +04:00
|
|
|
|
|
|
|
THIS_FILE=$THIS_DIR/$BIN_FILE
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$OTHER_BIN_FILE" ]; then
|
|
|
|
OTHER_FILE=$OTHER_DIR/$OTHER_BIN_FILE
|
|
|
|
else
|
|
|
|
OTHER_FILE=$OTHER_DIR/$BIN_FILE
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
NAME=$(basename $BIN_FILE)
|
|
|
|
WORK_FILE_BASE=$WORK_DIR/$BIN_FILE
|
|
|
|
FILE_WORK_DIR=$(dirname $WORK_FILE_BASE)
|
|
|
|
|
|
|
|
$MKDIR -p $FILE_WORK_DIR
|
|
|
|
|
2015-01-15 17:09:37 +03:00
|
|
|
# Make soft links to original files from work dir to facilitate debugging
|
|
|
|
$LN -f -s $THIS_FILE $WORK_FILE_BASE.this
|
|
|
|
$LN -f -s $OTHER_FILE $WORK_FILE_BASE.other
|
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
ORIG_THIS_FILE="$THIS_FILE"
|
|
|
|
ORIG_OTHER_FILE="$OTHER_FILE"
|
|
|
|
|
2024-07-18 11:06:18 +03:00
|
|
|
if [ "$STRIP_ALL" = "true" ] || [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]] \
|
|
|
|
|| [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME
|
|
|
|
OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME
|
|
|
|
$MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other
|
|
|
|
$CP $THIS_FILE $THIS_STRIPPED_FILE
|
|
|
|
$CP $OTHER_FILE $OTHER_STRIPPED_FILE
|
2024-07-18 11:06:18 +03:00
|
|
|
if [ "$STRIP_ALL" = "true" ] || [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then
|
|
|
|
$STRIP $THIS_STRIPPED_FILE
|
|
|
|
$STRIP $OTHER_STRIPPED_FILE
|
|
|
|
fi
|
|
|
|
# On macosx, always remove any signature before comparing
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
|
|
|
$CODESIGN --remove-signature $THIS_STRIPPED_FILE
|
|
|
|
$CODESIGN --remove-signature $OTHER_STRIPPED_FILE
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
THIS_FILE="$THIS_STRIPPED_FILE"
|
|
|
|
OTHER_FILE="$OTHER_STRIPPED_FILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
2015-01-15 17:09:37 +03:00
|
|
|
unset _NT_SYMBOL_PATH
|
2016-11-15 12:00:00 +03:00
|
|
|
if [ "$(uname -o)" = "Cygwin" ]; then
|
|
|
|
THIS=$(cygpath -msa $THIS)
|
|
|
|
OTHER=$(cygpath -msa $OTHER)
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
2016-11-15 12:00:00 +03:00
|
|
|
# Build an _NT_SYMBOL_PATH that contains all known locations for
|
|
|
|
# pdb files.
|
|
|
|
PDB_DIRS="$(ls -d \
|
|
|
|
{$OTHER,$THIS}/support/modules_{cmds,libs}/{*,*/*} \
|
|
|
|
)"
|
|
|
|
export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')"
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$SKIP_BIN_DIFF" ]; then
|
|
|
|
if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
|
|
|
|
# The files were bytewise identical.
|
|
|
|
if [ -n "$VERBOSE" ]; then
|
2014-12-03 17:20:21 +03:00
|
|
|
echo " : : : : : : $BIN_FILE"
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
BIN_MSG=" diff "
|
|
|
|
if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
DIFF_BIN=true
|
|
|
|
if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
BIN_MSG="*$BIN_MSG*"
|
|
|
|
REGRESSIONS=true
|
|
|
|
else
|
|
|
|
BIN_MSG=" $BIN_MSG "
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
BIN_MSG="($BIN_MSG)"
|
|
|
|
DIFF_BIN=
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$STAT" ]; then
|
|
|
|
THIS_SIZE=$($STAT $STAT_PRINT_SIZE "$THIS_FILE")
|
|
|
|
OTHER_SIZE=$($STAT $STAT_PRINT_SIZE "$OTHER_FILE")
|
|
|
|
else
|
|
|
|
THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }')
|
|
|
|
OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }')
|
|
|
|
fi
|
|
|
|
if [ $THIS_SIZE -ne $OTHER_SIZE ]; then
|
|
|
|
DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE)
|
|
|
|
DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE)
|
|
|
|
SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM)
|
2012-11-14 22:05:49 +04:00
|
|
|
if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] \
|
2015-01-15 17:09:37 +03:00
|
|
|
&& [ "$DIFF_SIZE_REL" -lt 102 ]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
SIZE_MSG="($SIZE_MSG)"
|
|
|
|
DIFF_SIZE=
|
2012-11-14 22:05:49 +04:00
|
|
|
elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
|
2015-01-15 17:09:37 +03:00
|
|
|
&& [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
|
|
|
|
&& [ "$DIFF_SIZE_NUM" = 512 ]; then
|
|
|
|
# On windows, size of binaries increase in 512 increments.
|
2012-11-14 22:05:49 +04:00
|
|
|
SIZE_MSG="($SIZE_MSG)"
|
|
|
|
DIFF_SIZE=
|
|
|
|
elif [ "$OPENJDK_TARGET_OS" = "windows" ] \
|
2015-01-15 17:09:37 +03:00
|
|
|
&& [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \
|
|
|
|
&& [ "$DIFF_SIZE_NUM" = -512 ]; then
|
|
|
|
# On windows, size of binaries increase in 512 increments.
|
2012-10-27 01:29:57 +04:00
|
|
|
SIZE_MSG="($SIZE_MSG)"
|
|
|
|
DIFF_SIZE=
|
|
|
|
else
|
|
|
|
if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
DIFF_SIZE=true
|
|
|
|
if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
SIZE_MSG="*$SIZE_MSG*"
|
|
|
|
REGRESSIONS=true
|
|
|
|
else
|
|
|
|
SIZE_MSG=" $SIZE_MSG "
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
SIZE_MSG="($SIZE_MSG)"
|
|
|
|
DIFF_SIZE=
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
SIZE_MSG=" "
|
|
|
|
DIFF_SIZE=
|
|
|
|
if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then
|
|
|
|
SIZE_MSG=" ! "
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-09-25 09:58:49 +03:00
|
|
|
if [ "$SORT_ALL_SYMBOLS" = "true" ] || [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
SYM_SORT_CMD="sort"
|
|
|
|
else
|
|
|
|
SYM_SORT_CMD="cat"
|
|
|
|
fi
|
|
|
|
|
2016-04-06 12:16:37 +03:00
|
|
|
if [ -n "$SYMBOLS_DIFF_FILTER" ] && [ -z "$NEED_SYMBOLS_DIFF_FILTER" ] \
|
|
|
|
|| [[ "$NEED_SYMBOLS_DIFF_FILTER" = *"$BIN_FILE"* ]]; then
|
|
|
|
this_SYMBOLS_DIFF_FILTER="$SYMBOLS_DIFF_FILTER"
|
|
|
|
else
|
|
|
|
this_SYMBOLS_DIFF_FILTER="$CAT"
|
|
|
|
fi
|
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
# Check symbols
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
|
|
|
# The output from dumpbin on windows differs depending on if the debug symbol
|
|
|
|
# files are still around at the location the binary is pointing too. Need
|
2015-01-15 17:09:37 +03:00
|
|
|
# to filter out that extra information.
|
|
|
|
$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
|
|
|
|
$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
|
2012-10-27 01:29:57 +04:00
|
|
|
elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
|
|
|
|
# Some symbols get seemingly random 15 character prefixes. Filter them out.
|
|
|
|
$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
|
2015-01-15 17:09:37 +03:00
|
|
|
$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
|
2015-12-15 13:02:03 +03:00
|
|
|
elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
|
|
|
|
$OBJDUMP -T $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
|
|
|
|
$OBJDUMP -T $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
|
2016-02-12 13:07:35 +03:00
|
|
|
elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
|
|
|
$NM -j $ORIG_OTHER_FILE 2> /dev/null | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
|
|
|
|
$NM -j $ORIG_THIS_FILE 2> /dev/null | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
|
2012-10-27 01:29:57 +04:00
|
|
|
else
|
2016-04-06 12:16:37 +03:00
|
|
|
$NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME \
|
|
|
|
| $AWK '{print $2, $3, $4, $5}' \
|
|
|
|
| eval "$this_SYMBOLS_DIFF_FILTER" \
|
|
|
|
| $SYM_SORT_CMD \
|
|
|
|
> $WORK_FILE_BASE.symbols.other
|
|
|
|
$NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME \
|
|
|
|
| $AWK '{print $2, $3, $4, $5}' \
|
|
|
|
| eval "$this_SYMBOLS_DIFF_FILTER" \
|
|
|
|
| $SYM_SORT_CMD \
|
|
|
|
> $WORK_FILE_BASE.symbols.this
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ -s $WORK_FILE_BASE.symbols.diff ]; then
|
|
|
|
SYM_MSG=" diff "
|
|
|
|
if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
DIFF_SYM=true
|
|
|
|
if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
SYM_MSG="*$SYM_MSG*"
|
|
|
|
REGRESSIONS=true
|
|
|
|
else
|
|
|
|
SYM_MSG=" $SYM_MSG "
|
|
|
|
fi
|
|
|
|
else
|
2015-01-15 17:09:37 +03:00
|
|
|
SYM_MSG="($SYM_MSG)"
|
2012-10-27 01:29:57 +04:00
|
|
|
DIFF_SYM=
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
SYM_MSG=" "
|
|
|
|
DIFF_SYM=
|
|
|
|
if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then
|
|
|
|
SYM_MSG=" ! "
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check dependencies
|
|
|
|
if [ -n "$LDD_CMD" ]; then
|
2016-04-14 17:42:21 +03:00
|
|
|
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
|
|
|
LDD_FILTER="$GREP \.dll"
|
|
|
|
else
|
|
|
|
LDD_FILTER="$CAT"
|
|
|
|
fi
|
|
|
|
(cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null \
|
|
|
|
| $LDD_FILTER | $AWK '{ print $1;}' | $SORT \
|
|
|
|
| $TEE $WORK_FILE_BASE.deps.other \
|
|
|
|
| $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
|
|
|
|
(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null \
|
|
|
|
| $LDD_FILTER | $AWK '{ print $1;}' | $SORT \
|
|
|
|
| $TEE $WORK_FILE_BASE.deps.this \
|
|
|
|
| $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
|
2015-01-15 17:09:37 +03:00
|
|
|
(cd $FILE_WORK_DIR && $RM -f $NAME)
|
|
|
|
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this \
|
2016-04-14 17:42:21 +03:00
|
|
|
> $WORK_FILE_BASE.deps.diff
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq \
|
2016-04-14 17:42:21 +03:00
|
|
|
> $WORK_FILE_BASE.deps.diff.uniq
|
2015-01-15 17:09:37 +03:00
|
|
|
|
|
|
|
if [ -s $WORK_FILE_BASE.deps.diff ]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then
|
2015-01-15 17:09:37 +03:00
|
|
|
DEP_MSG=" diff "
|
2012-10-27 01:29:57 +04:00
|
|
|
else
|
2015-01-15 17:09:37 +03:00
|
|
|
DEP_MSG=" redun "
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then
|
2015-01-15 17:09:37 +03:00
|
|
|
DIFF_DEP=true
|
|
|
|
if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
DEP_MSG="*$DEP_MSG*"
|
|
|
|
REGRESSIONS=true
|
2015-01-15 17:09:37 +03:00
|
|
|
else
|
2012-10-27 01:29:57 +04:00
|
|
|
DEP_MSG=" $DEP_MSG "
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
else
|
2015-01-15 17:09:37 +03:00
|
|
|
DEP_MSG="($DEP_MSG)"
|
|
|
|
DIFF_DEP=
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
else
|
|
|
|
DEP_MSG=" "
|
|
|
|
DIFF_DEP=
|
2012-10-27 01:29:57 +04:00
|
|
|
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
|
|
|
|
DEP_MSG=" ! "
|
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
else
|
2015-01-15 17:09:37 +03:00
|
|
|
DEP_MSG=" - "
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2015-12-15 13:02:03 +03:00
|
|
|
# Some linux compilers add a unique Build ID
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "linux" ]; then
|
|
|
|
BUILD_ID_FILTER="$SED -r 's/(Build ID:) [0-9a-f]{40}/\1/'"
|
|
|
|
else
|
|
|
|
BUILD_ID_FILTER="$CAT"
|
|
|
|
fi
|
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare fulldump output
|
|
|
|
if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -z "$FULLDUMP_DIFF_FILTER" ]; then
|
|
|
|
FULLDUMP_DIFF_FILTER="$CAT"
|
|
|
|
fi
|
2015-12-15 13:02:03 +03:00
|
|
|
$FULLDUMP_CMD $OTHER_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \
|
2016-04-06 12:16:37 +03:00
|
|
|
> $WORK_FILE_BASE.fulldump.other 2>&1 &
|
2015-12-15 13:02:03 +03:00
|
|
|
$FULLDUMP_CMD $THIS_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \
|
2016-04-06 12:16:37 +03:00
|
|
|
> $WORK_FILE_BASE.fulldump.this 2>&1 &
|
|
|
|
wait
|
2015-02-27 19:27:11 +03:00
|
|
|
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \
|
2015-09-25 09:58:49 +03:00
|
|
|
> $WORK_FILE_BASE.fulldump.diff
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ -s $WORK_FILE_BASE.fulldump.diff ]; then
|
2015-09-25 09:58:49 +03:00
|
|
|
FULLDUMP_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}')
|
|
|
|
FULLDUMP_MSG=$($PRINTF "%8d" $FULLDUMP_DIFF_SIZE)
|
|
|
|
if [[ "$ACCEPTED_FULLDUMP_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
DIFF_FULLDUMP=true
|
|
|
|
if [[ "$KNOWN_FULLDUMP_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
FULLDUMP_MSG="*$FULLDUMP_MSG*"
|
2012-10-27 01:29:57 +04:00
|
|
|
REGRESSIONS=true
|
|
|
|
else
|
2015-09-25 09:58:49 +03:00
|
|
|
FULLDUMP_MSG=" $FULLDUMP_MSG "
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
else
|
2015-09-25 09:58:49 +03:00
|
|
|
FULLDUMP_MSG="($FULLDUMP_MSG)"
|
|
|
|
DIFF_FULLDUMP=
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
else
|
2015-09-25 09:58:49 +03:00
|
|
|
FULLDUMP_MSG=" "
|
|
|
|
DIFF_FULLDUMP=
|
|
|
|
if [[ "$KNOWN_FULLDUMP_DIFF $ACCEPTED_FULLDUMP_DIFF" = *"$BIN_FILE"* ]]; then
|
2016-05-04 16:29:01 +03:00
|
|
|
FULLDUMP_MSG=" ! "
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Compare disassemble output
|
|
|
|
if [ -n "$DIS_CMD" ] && [ -z "$SKIP_DIS_DIFF" ]; then
|
2016-04-06 12:16:37 +03:00
|
|
|
this_DIS_DIFF_FILTER="$CAT"
|
|
|
|
if [ -n "$DIS_DIFF_FILTER" ]; then
|
|
|
|
if [ -z "$NEED_DIS_DIFF_FILTER" ] \
|
|
|
|
|| [[ "$NEED_DIS_DIFF_FILTER" = *"$BIN_FILE"* ]]; then
|
|
|
|
this_DIS_DIFF_FILTER="$DIS_DIFF_FILTER"
|
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
|
|
|
DIS_GREP_ARG=-a
|
|
|
|
else
|
|
|
|
DIS_GREP_ARG=
|
|
|
|
fi
|
|
|
|
$DIS_CMD $OTHER_FILE | $GREP $DIS_GREP_ARG -v $NAME \
|
2016-04-06 12:16:37 +03:00
|
|
|
| eval "$this_DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.other 2>&1 &
|
2016-02-11 13:54:00 +03:00
|
|
|
$DIS_CMD $THIS_FILE | $GREP $DIS_GREP_ARG -v $NAME \
|
2016-04-06 12:16:37 +03:00
|
|
|
| eval "$this_DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this 2>&1 &
|
|
|
|
wait
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2021-12-29 13:34:07 +03:00
|
|
|
$DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ -s $WORK_FILE_BASE.dis.diff ]; then
|
|
|
|
DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}')
|
|
|
|
DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE)
|
|
|
|
if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then
|
|
|
|
DIFF_DIS=true
|
2016-04-06 12:16:37 +03:00
|
|
|
if [ "$MAX_KNOWN_DIS_DIFF_SIZE" = "" ]; then
|
|
|
|
MAX_KNOWN_DIS_DIFF_SIZE="0"
|
|
|
|
fi
|
|
|
|
if [[ "$KNOWN_DIS_DIFF" = *"$BIN_FILE"* ]] \
|
|
|
|
&& [ "$DIS_DIFF_SIZE" -lt "$MAX_KNOWN_DIS_DIFF_SIZE" ]; then
|
|
|
|
DIS_MSG=" $DIS_MSG "
|
|
|
|
else
|
2012-10-27 01:29:57 +04:00
|
|
|
DIS_MSG="*$DIS_MSG*"
|
|
|
|
REGRESSIONS=true
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
DIS_MSG="($DIS_MSG)"
|
|
|
|
DIFF_DIS=
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
DIS_MSG=" "
|
|
|
|
DIFF_DIS=
|
|
|
|
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
|
|
|
|
DIS_MSG=" ! "
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2015-09-25 09:58:49 +03:00
|
|
|
if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_FULLDUMP$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi
|
|
|
|
if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi
|
|
|
|
if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi
|
|
|
|
if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi
|
2015-09-25 09:58:49 +03:00
|
|
|
if [ -n "$FULLDUMP_MSG" ]; then echo -n "$FULLDUMP_MSG:"; fi
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi
|
|
|
|
echo " $BIN_FILE"
|
|
|
|
if [ "$SHOW_DIFFS" = "true" ]; then
|
|
|
|
if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then
|
|
|
|
echo "Symbols diff:"
|
|
|
|
$CAT $WORK_FILE_BASE.symbols.diff
|
|
|
|
fi
|
|
|
|
if [ -s "$WORK_FILE_BASE.deps.diff" ]; then
|
|
|
|
echo "Deps diff:"
|
|
|
|
$CAT $WORK_FILE_BASE.deps.diff
|
|
|
|
fi
|
|
|
|
if [ -s "$WORK_FILE_BASE.fulldump.diff" ]; then
|
|
|
|
echo "Fulldump diff:"
|
|
|
|
$CAT $WORK_FILE_BASE.fulldump.diff
|
|
|
|
fi
|
|
|
|
if [ -s "$WORK_FILE_BASE.dis.diff" ]; then
|
|
|
|
echo "Disassembly diff:"
|
|
|
|
$CAT $WORK_FILE_BASE.dis.diff
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Print binary diff header
|
|
|
|
|
|
|
|
print_binary_diff_header() {
|
|
|
|
if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi
|
|
|
|
if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n " Size :"; fi
|
|
|
|
if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi
|
|
|
|
if [ -z "$SKIP_DEP_DIFF" ]; then echo -n " Deps :"; fi
|
|
|
|
if [ -z "$SKIP_FULLDUMP_DIFF" ]; then echo -n " Fulldump :"; fi
|
|
|
|
if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass :"; fi
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare all libraries
|
|
|
|
|
|
|
|
compare_all_libs() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
|
2015-01-15 17:09:37 +03:00
|
|
|
LIBS=$(cd $THIS_DIR && $FIND . -type f \( -name 'lib*.so' -o -name '*.dylib' \
|
2016-01-30 12:25:15 +03:00
|
|
|
-o -name '*.dll' -o -name '*.obj' -o -name '*.o' -o -name '*.a' \
|
2015-01-15 17:09:37 +03:00
|
|
|
-o -name '*.cpl' \) | $SORT | $FILTER)
|
2012-10-27 01:29:57 +04:00
|
|
|
|
2018-02-19 12:57:05 +03:00
|
|
|
# On macos, filter out the dSYM debug symbols files as they are also
|
|
|
|
# named *.dylib.
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
|
|
|
LIBS=$(echo "$LIBS" | $GREP -v '\.dSYM/')
|
|
|
|
fi
|
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ -n "$LIBS" ]; then
|
|
|
|
echo Libraries...
|
|
|
|
print_binary_diff_header
|
|
|
|
for l in $LIBS; do
|
|
|
|
if [ -f "$OTHER_DIR/$l" ]; then
|
|
|
|
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l
|
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
return_value=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
return $return_value
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Compare all executables
|
|
|
|
|
|
|
|
compare_all_execs() {
|
|
|
|
THIS_DIR=$1
|
|
|
|
OTHER_DIR=$2
|
|
|
|
WORK_DIR=$3
|
|
|
|
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
|
|
|
EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER)
|
|
|
|
else
|
2012-11-04 03:28:14 +04:00
|
|
|
EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \
|
|
|
|
\( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' \
|
|
|
|
-o -name '*.jar' -o -name '*.diz' -o -name 'jcontrol' -o -name '*.properties' \
|
|
|
|
-o -name '*.data' -o -name '*.bfc' -o -name '*.src' -o -name '*.txt' \
|
|
|
|
-o -name '*.cfg' -o -name 'meta-index' -o -name '*.properties.ja' \
|
2016-02-11 13:54:00 +03:00
|
|
|
-o -name '*.xml' -o -name '*.html' -o -name '*.png' -o -name 'README' \
|
|
|
|
-o -name '*.zip' -o -name '*.jimage' -o -name '*.java' -o -name '*.mf' \
|
|
|
|
-o -name '*.jpg' -o -name '*.wsdl' -o -name '*.js' -o -name '*.sh' \
|
|
|
|
-o -name '*.bat' -o -name '*LICENSE' -o -name '*.d' -o -name '*store' \
|
2021-09-28 11:10:08 +03:00
|
|
|
-o -name 'blocked' -o -name '*certs' -o -name '*.ttf' \
|
2016-02-11 13:54:00 +03:00
|
|
|
-o -name '*.jfc' -o -name '*.dat' -o -name 'release' -o -name '*.dir'\
|
|
|
|
-o -name '*.sym' -o -name '*.idl' -o -name '*.h' -o -name '*.access' \
|
|
|
|
-o -name '*.template' -o -name '*.policy' -o -name '*.security' \
|
2018-02-19 12:57:05 +03:00
|
|
|
-o -name 'COPYRIGHT' -o -name '*.1' -o -name '*.debuginfo' \
|
2012-11-04 03:28:14 +04:00
|
|
|
-o -name 'classlist' \) | $SORT | $FILTER)
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$EXECS" ]; then
|
|
|
|
echo Executables...
|
|
|
|
print_binary_diff_header
|
|
|
|
for e in $EXECS; do
|
|
|
|
if [ -f "$OTHER_DIR/$e" ]; then
|
|
|
|
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e
|
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
return_value=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
return $return_value
|
|
|
|
}
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Initiate configuration
|
|
|
|
|
2015-11-05 12:58:53 +03:00
|
|
|
THIS="$SCRIPT_DIR"
|
2012-10-27 01:29:57 +04:00
|
|
|
echo "$THIS"
|
|
|
|
THIS_SCRIPT="$0"
|
|
|
|
|
|
|
|
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
|
|
|
|
echo "bash ./compare.sh [OPTIONS] [FILTER]"
|
|
|
|
echo ""
|
|
|
|
echo "-all Compare all files in all known ways"
|
|
|
|
echo "-names Compare the file names and directory structure"
|
|
|
|
echo "-perms Compare the permission bits on all files and directories"
|
|
|
|
echo "-types Compare the output of the file command on all files"
|
|
|
|
echo "-general Compare the files not convered by the specialized comparisons"
|
2016-12-13 14:31:43 +03:00
|
|
|
echo "-zips Compare the contents of all zip files and files in them"
|
|
|
|
echo "-zips-names Compare the file names inside all zip files"
|
2012-10-27 01:29:57 +04:00
|
|
|
echo "-jars Compare the contents of all jar files"
|
|
|
|
echo "-libs Compare all native libraries"
|
|
|
|
echo "-execs Compare all executables"
|
|
|
|
echo "-v Verbose output, does not hide known differences"
|
|
|
|
echo "-vv More verbose output, shows diff output of all comparisons"
|
|
|
|
echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory"
|
|
|
|
echo ""
|
2015-09-25 09:58:49 +03:00
|
|
|
echo "--sort-symbols Sort all symbols before comparing"
|
|
|
|
echo "--strip Strip all binaries before comparing"
|
2016-02-12 13:07:35 +03:00
|
|
|
echo "--clean Clean all previous comparison results first"
|
2015-09-25 09:58:49 +03:00
|
|
|
echo ""
|
2012-10-27 01:29:57 +04:00
|
|
|
echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs"
|
|
|
|
echo "Example:"
|
2017-09-12 20:03:56 +03:00
|
|
|
echo "bash ./make/scripts/compareimages.sh CodePointIM.jar"
|
2013-01-23 14:41:06 +04:00
|
|
|
echo ""
|
|
|
|
echo "-2zips <file1> <file2> Compare two zip files only"
|
2014-08-17 18:51:37 +04:00
|
|
|
echo "-2bins <file1> <file2> Compare two binary files only"
|
|
|
|
echo "-2dirs <dir1> <dir2> Compare two directories as if they were images"
|
2013-01-23 14:41:06 +04:00
|
|
|
echo ""
|
2012-10-27 01:29:57 +04:00
|
|
|
exit 10
|
|
|
|
fi
|
|
|
|
|
|
|
|
CMP_NAMES=false
|
|
|
|
CMP_PERMS=false
|
|
|
|
CMP_TYPES=false
|
|
|
|
CMP_GENERAL=false
|
|
|
|
CMP_ZIPS=false
|
2016-12-13 14:31:43 +03:00
|
|
|
CMP_ZIPS_CONTENTS=true
|
2012-10-27 01:29:57 +04:00
|
|
|
CMP_JARS=false
|
|
|
|
CMP_LIBS=false
|
|
|
|
CMP_EXECS=false
|
|
|
|
|
|
|
|
while [ -n "$1" ]; do
|
|
|
|
case "$1" in
|
|
|
|
-v)
|
|
|
|
VERBOSE=true
|
|
|
|
;;
|
|
|
|
-vv)
|
|
|
|
VERBOSE=true
|
|
|
|
SHOW_DIFFS=true
|
|
|
|
;;
|
|
|
|
-o)
|
|
|
|
OTHER="$2"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-all)
|
|
|
|
CMP_NAMES=true
|
|
|
|
if [ "$OPENJDK_TARGET_OS" != "windows" ]; then
|
|
|
|
CMP_PERMS=true
|
|
|
|
fi
|
|
|
|
CMP_TYPES=true
|
|
|
|
CMP_GENERAL=true
|
|
|
|
CMP_ZIPS=true
|
|
|
|
CMP_JARS=true
|
|
|
|
CMP_LIBS=true
|
|
|
|
CMP_EXECS=true
|
|
|
|
;;
|
|
|
|
-names)
|
|
|
|
CMP_NAMES=true
|
|
|
|
;;
|
|
|
|
-perms)
|
|
|
|
CMP_PERMS=true
|
|
|
|
;;
|
|
|
|
-types)
|
|
|
|
CMP_TYPES=true
|
|
|
|
;;
|
|
|
|
-general)
|
|
|
|
CMP_GENERAL=true
|
|
|
|
;;
|
|
|
|
-zips)
|
|
|
|
CMP_ZIPS=true
|
2016-12-13 14:31:43 +03:00
|
|
|
CMP_ZIPS_CONTENTS=true
|
|
|
|
;;
|
|
|
|
-zips-names)
|
|
|
|
CMP_ZIPS=true
|
|
|
|
CMP_ZIPS_CONTENTS=false
|
2012-10-27 01:29:57 +04:00
|
|
|
;;
|
|
|
|
-jars)
|
|
|
|
CMP_JARS=true
|
|
|
|
;;
|
|
|
|
-libs)
|
|
|
|
CMP_LIBS=true
|
|
|
|
;;
|
|
|
|
-execs)
|
|
|
|
CMP_EXECS=true
|
|
|
|
;;
|
2014-08-17 18:51:37 +04:00
|
|
|
-2dirs)
|
2015-03-02 15:45:05 +03:00
|
|
|
THIS="$(cd "$2" > /dev/null && pwd )"
|
|
|
|
OTHER="$(cd "$3" > /dev/null && pwd )"
|
2014-08-17 18:51:37 +04:00
|
|
|
THIS_BASE_DIR="$THIS"
|
|
|
|
OTHER_BASE_DIR="$OTHER"
|
|
|
|
SKIP_DEFAULT=true
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
2013-01-23 14:41:06 +04:00
|
|
|
-2zips)
|
|
|
|
CMP_2_ZIPS=true
|
|
|
|
THIS_FILE=$2
|
|
|
|
OTHER_FILE=$3
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
2014-08-17 18:51:37 +04:00
|
|
|
-2bins)
|
|
|
|
CMP_2_BINS=true
|
|
|
|
THIS_FILE=$2
|
|
|
|
OTHER_FILE=$3
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
2015-09-25 09:58:49 +03:00
|
|
|
--sort-symbols)
|
|
|
|
SORT_ALL_SYMBOLS=true
|
|
|
|
;;
|
|
|
|
--strip)
|
|
|
|
STRIP_ALL=true
|
|
|
|
;;
|
2016-02-12 13:07:35 +03:00
|
|
|
--clean)
|
|
|
|
CLEAN_OUTPUT=true
|
|
|
|
;;
|
2012-10-27 01:29:57 +04:00
|
|
|
*)
|
|
|
|
CMP_NAMES=false
|
|
|
|
CMP_PERMS=false
|
|
|
|
CMP_TYPES=false
|
|
|
|
CMP_ZIPS=true
|
|
|
|
CMP_JARS=true
|
|
|
|
CMP_LIBS=true
|
|
|
|
CMP_EXECS=true
|
2015-01-15 17:09:37 +03:00
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
if [ -z "$FILTER" ]; then
|
|
|
|
FILTER="$GREP"
|
|
|
|
fi
|
|
|
|
FILTER="$FILTER -e $1"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2016-02-12 13:07:35 +03:00
|
|
|
if [ "$STRIP_ALL" = "true" ] && [ -z "$STRIP" ]; then
|
|
|
|
echo Warning: Not stripping even with --strip, since strip is missing on this platform
|
|
|
|
STRIP_ALL=false
|
|
|
|
fi
|
|
|
|
|
2018-02-19 12:57:05 +03:00
|
|
|
COMPARE_ROOT=$OUTPUTDIR/compare-support
|
2016-02-12 13:07:35 +03:00
|
|
|
if [ "$CLEAN_OUTPUT" = "true" ]; then
|
|
|
|
echo Cleaning old output in $COMPARE_ROOT.
|
|
|
|
$RM -rf $COMPARE_ROOT
|
|
|
|
fi
|
|
|
|
$MKDIR -p $COMPARE_ROOT
|
|
|
|
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
|
|
|
if [ "$(uname -o)" = "Cygwin" ]; then
|
|
|
|
COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-01-23 14:41:06 +04:00
|
|
|
if [ "$CMP_2_ZIPS" = "true" ]; then
|
|
|
|
THIS_DIR="$(dirname $THIS_FILE)"
|
2015-03-02 15:45:05 +03:00
|
|
|
THIS_DIR="$(cd "$THIS_DIR" > /dev/null && pwd )"
|
2013-01-23 14:41:06 +04:00
|
|
|
OTHER_DIR="$(dirname $OTHER_FILE)"
|
2015-03-02 15:45:05 +03:00
|
|
|
OTHER_DIR="$(cd "$OTHER_DIR" > /dev/null && pwd )"
|
2013-01-23 14:41:06 +04:00
|
|
|
THIS_FILE_NAME="$(basename $THIS_FILE)"
|
|
|
|
OTHER_FILE_NAME="$(basename $OTHER_FILE)"
|
|
|
|
echo Comparing $THIS_DIR/$THIS_FILE_NAME and $OTHER_DIR/$OTHER_FILE_NAME
|
|
|
|
compare_zip_file $THIS_DIR $OTHER_DIR $COMPARE_ROOT/2zips $THIS_FILE_NAME $OTHER_FILE_NAME
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ "$CMP_2_BINS" = "true" ]; then
|
|
|
|
THIS_DIR="$(dirname $THIS_FILE)"
|
2015-03-02 15:45:05 +03:00
|
|
|
THIS_DIR="$(cd "$THIS_DIR" > /dev/null && pwd )"
|
2014-08-17 18:51:37 +04:00
|
|
|
OTHER_DIR="$(dirname $OTHER_FILE)"
|
2015-03-02 15:45:05 +03:00
|
|
|
OTHER_DIR="$(cd "$OTHER_DIR" > /dev/null && pwd )"
|
2014-08-17 18:51:37 +04:00
|
|
|
THIS_FILE_NAME="$(basename $THIS_FILE)"
|
|
|
|
OTHER_FILE_NAME="$(basename $OTHER_FILE)"
|
|
|
|
echo Comparing $THIS_DIR/$THIS_FILE_NAME and $OTHER_DIR/$OTHER_FILE_NAME
|
|
|
|
compare_bin_file $THIS_DIR $OTHER_DIR $COMPARE_ROOT/2bins $THIS_FILE_NAME $OTHER_FILE_NAME
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2012-10-27 01:29:57 +04:00
|
|
|
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
|
|
|
|
CMP_NAMES=true
|
|
|
|
CMP_PERMS=true
|
|
|
|
CMP_TYPES=true
|
|
|
|
CMP_GENERAL=true
|
|
|
|
CMP_ZIPS=true
|
|
|
|
CMP_JARS=true
|
|
|
|
CMP_LIBS=true
|
|
|
|
CMP_EXECS=true
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$FILTER" ]; then
|
|
|
|
FILTER="$CAT"
|
|
|
|
fi
|
|
|
|
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ "$SKIP_DEFAULT" != "true" ]; then
|
|
|
|
if [ -z "$OTHER" ]; then
|
2014-12-03 17:20:21 +03:00
|
|
|
echo "Nothing to compare to, set with -o"
|
|
|
|
exit 1
|
2014-08-17 18:51:37 +04:00
|
|
|
else
|
|
|
|
if [ ! -d "$OTHER" ]; then
|
|
|
|
echo "Other build directory does not exist:"
|
|
|
|
echo "$OTHER"
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-03-02 15:45:05 +03:00
|
|
|
OTHER="$( cd "$OTHER" > /dev/null && pwd )"
|
2014-08-17 18:51:37 +04:00
|
|
|
echo "Comparing to:"
|
2012-10-27 01:29:57 +04:00
|
|
|
echo "$OTHER"
|
2014-08-17 18:51:37 +04:00
|
|
|
echo
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2014-12-03 17:20:21 +03:00
|
|
|
# Find the common images to compare, prioritizing later build stages
|
|
|
|
if [ -d "$THIS/install/jdk" ] && [ -d "$OTHER/install/jdk" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
THIS_JDK="$THIS/install/jdk"
|
|
|
|
OTHER_JDK="$OTHER/install/jdk"
|
2018-03-23 18:50:02 +03:00
|
|
|
echo "Selecting install images for JDK compare"
|
2014-12-03 17:20:21 +03:00
|
|
|
elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
THIS_JDK="$THIS/images/jdk"
|
|
|
|
OTHER_JDK="$OTHER/images/jdk"
|
2018-03-23 18:50:02 +03:00
|
|
|
echo "Selecting normal images for JDK compare"
|
2016-12-01 12:43:59 +03:00
|
|
|
elif [ -d "$(ls -d $THIS/licensee-src/build/*/images/jdk 2> /dev/null)" ] \
|
|
|
|
&& [ -d "$(ls -d $OTHER/licensee-src/build/*/images/jdk 2> /dev/null)" ]
|
2016-07-01 19:29:24 +03:00
|
|
|
then
|
|
|
|
echo "Selecting licensee images for compare"
|
|
|
|
# Simply override the THIS and OTHER dir with the build dir from
|
|
|
|
# the nested licensee source build for the rest of the script
|
|
|
|
# execution.
|
|
|
|
OLD_THIS="$THIS"
|
|
|
|
OLD_OTHER="$OTHER"
|
|
|
|
THIS="$(ls -d $THIS/licensee-src/build/*)"
|
|
|
|
OTHER="$(ls -d $OTHER/licensee-src/build/*)"
|
|
|
|
THIS_JDK="$THIS/images/jdk"
|
|
|
|
OTHER_JDK="$OTHER/images/jdk"
|
|
|
|
# Rewrite the path to tools that are used from the build
|
|
|
|
JIMAGE="$(echo "$JIMAGE" | $SED "s|$OLD_THIS|$THIS|g")"
|
|
|
|
JAVAP="$(echo "$JAVAP" | $SED "s|$OLD_THIS|$THIS|g")"
|
2014-12-03 17:20:21 +03:00
|
|
|
else
|
2015-01-15 17:09:37 +03:00
|
|
|
echo "No common images found."
|
|
|
|
exit 1
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2015-06-04 19:27:42 +03:00
|
|
|
echo " $THIS_JDK"
|
|
|
|
echo " $OTHER_JDK"
|
2012-10-27 01:29:57 +04:00
|
|
|
|
2015-06-04 19:27:42 +03:00
|
|
|
if [ -d "$THIS/images/jdk-bundle" -o -d "$THIS/deploy/images/jdk-bundle" ] \
|
|
|
|
&& [ -d "$OTHER/images/jdk-bundle" -o -d "$OTHER/deploy/images/jdk-bundle" ]; then
|
2015-03-02 15:45:05 +03:00
|
|
|
if [ -d "$THIS/deploy/images/jdk-bundle" ]; then
|
|
|
|
THIS_JDK_BUNDLE="$THIS/deploy/images/jdk-bundle"
|
|
|
|
else
|
2015-06-04 19:27:42 +03:00
|
|
|
THIS_JDK_BUNDLE="$THIS/images/jdk-bundle"
|
2015-03-02 15:45:05 +03:00
|
|
|
fi
|
|
|
|
if [ -d "$OTHER/deploy/images/jdk-bundle" ]; then
|
|
|
|
OTHER_JDK_BUNDLE="$OTHER/deploy/images/jdk-bundle"
|
|
|
|
else
|
2015-06-04 19:27:42 +03:00
|
|
|
OTHER_JDK_BUNDLE="$OTHER/images/jdk-bundle"
|
2015-03-02 15:45:05 +03:00
|
|
|
fi
|
2015-09-25 09:58:49 +03:00
|
|
|
echo "Also comparing jdk macosx bundles"
|
2015-06-04 19:27:42 +03:00
|
|
|
echo " $THIS_JDK_BUNDLE"
|
|
|
|
echo " $OTHER_JDK_BUNDLE"
|
2014-08-17 18:51:37 +04:00
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
|
2015-03-02 15:45:05 +03:00
|
|
|
if [ -d "$THIS/deploy/bundles" -o -d "$THIS/deploy/images/bundles" ] \
|
|
|
|
&& [ -d "$OTHER/deploy/bundles" -o -d "$OTHER/deploy/images/bundles" ]; then
|
|
|
|
if [ -d "$THIS/deploy/images/bundles" ]; then
|
|
|
|
THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/images/bundles"
|
|
|
|
else
|
|
|
|
THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/bundles"
|
|
|
|
fi
|
|
|
|
if [ -d "$OTHER/deploy/images/bundles" ]; then
|
|
|
|
OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/images/bundles"
|
|
|
|
else
|
|
|
|
OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/bundles"
|
|
|
|
fi
|
|
|
|
echo "Also comparing deploy javadoc bundles"
|
|
|
|
fi
|
|
|
|
|
2015-06-04 19:27:42 +03:00
|
|
|
if [ -d "$THIS/images/JavaAppletPlugin.plugin" ] \
|
|
|
|
&& [ -d "$OTHER/images/JavaAppletPlugin.plugin" -o -d "$OTHER/deploy/images/JavaAppletPlugin.plugin" ]; then
|
|
|
|
if [ -d "$THIS/images/JavaAppletPlugin.plugin" ]; then
|
|
|
|
THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/images/JavaAppletPlugin.plugin"
|
2015-03-02 15:45:05 +03:00
|
|
|
else
|
2015-06-04 19:27:42 +03:00
|
|
|
THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/deploy/images/JavaAppletPlugin.plugin"
|
2015-03-02 15:45:05 +03:00
|
|
|
fi
|
2015-06-04 19:27:42 +03:00
|
|
|
if [ -d "$OTHER/images/JavaAppletPlugin.plugin" ]; then
|
|
|
|
OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/images/JavaAppletPlugin.plugin"
|
2015-03-02 15:45:05 +03:00
|
|
|
else
|
2015-06-04 19:27:42 +03:00
|
|
|
OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/deploy/images/JavaAppletPlugin.plugin"
|
2015-03-02 15:45:05 +03:00
|
|
|
fi
|
|
|
|
echo "Also comparing deploy applet image"
|
2015-06-04 19:27:42 +03:00
|
|
|
echo " $THIS_DEPLOY_APPLET_PLUGIN_DIR"
|
|
|
|
echo " $OTHER_DEPLOY_APPLET_PLUGIN_DIR"
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
|
|
|
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ -d "$THIS/install/sparkle/Sparkle.framework" ] \
|
|
|
|
&& [ -d "$OTHER/install/sparkle/Sparkle.framework" ]; then
|
|
|
|
THIS_SPARKLE_DIR="$THIS/install/sparkle/Sparkle.framework"
|
|
|
|
OTHER_SPARKLE_DIR="$OTHER/install/sparkle/Sparkle.framework"
|
|
|
|
echo "Also comparing install sparkle framework"
|
|
|
|
echo " $THIS_SPARKLE_DIR"
|
|
|
|
echo " $OTHER_SPARKLE_DIR"
|
|
|
|
fi
|
|
|
|
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -d "$OTHER/images" ]; then
|
|
|
|
OTHER_SEC_DIR="$OTHER/images"
|
|
|
|
else
|
|
|
|
OTHER_SEC_DIR="$OTHER/tmp"
|
|
|
|
fi
|
2018-03-23 18:50:02 +03:00
|
|
|
if [ -f "$THIS_SEC_DIR/sec-bin.zip" ]; then
|
|
|
|
OTHER_SEC_BIN="$OTHER_SEC_DIR/sec-bin.zip"
|
|
|
|
THIS_SEC_DIR="$THIS/images"
|
|
|
|
THIS_SEC_BIN="$THIS_SEC_DIR/sec-bin.zip"
|
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
|
|
|
if [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
|
|
|
|
JGSS_WINDOWS_BIN="jgss-windows-x64-bin.zip"
|
|
|
|
else
|
|
|
|
JGSS_WINDOWS_BIN="jgss-windows-i586-bin.zip"
|
|
|
|
fi
|
|
|
|
OTHER_SEC_WINDOWS_BIN="$OTHER_SEC_DIR/sec-windows-bin.zip"
|
|
|
|
OTHER_JGSS_WINDOWS_BIN="$OTHER_SEC_DIR/$JGSS_WINDOWS_BIN"
|
|
|
|
THIS_SEC_WINDOWS_BIN="$THIS_SEC_DIR/sec-windows-bin.zip"
|
|
|
|
THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
|
|
|
|
fi
|
2012-11-28 16:40:17 +04:00
|
|
|
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ -d "$THIS/images/docs" ] && [ -d "$OTHER/images/docs" ]; then
|
|
|
|
THIS_DOCS="$THIS/images/docs"
|
|
|
|
OTHER_DOCS="$OTHER/images/docs"
|
2015-01-15 17:09:37 +03:00
|
|
|
echo "Also comparing docs"
|
2014-12-03 17:20:21 +03:00
|
|
|
else
|
2014-08-17 18:51:37 +04:00
|
|
|
echo "WARNING! Docs haven't been built and won't be compared."
|
|
|
|
fi
|
2013-01-04 20:08:33 +04:00
|
|
|
fi
|
|
|
|
|
2015-02-27 19:27:11 +03:00
|
|
|
################################################################################
|
2012-10-27 01:29:57 +04:00
|
|
|
# Do the work
|
|
|
|
|
|
|
|
if [ "$CMP_NAMES" = "true" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
|
|
|
echo -n "JDK "
|
|
|
|
compare_dirs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
|
|
|
echo -n "JDK "
|
|
|
|
compare_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
2018-03-23 18:50:02 +03:00
|
|
|
fi
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
|
|
|
|
echo -n "JDK Bundle "
|
|
|
|
compare_dirs $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
|
|
|
|
|
|
|
echo -n "JDK Bundle "
|
|
|
|
compare_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2012-11-28 16:40:17 +04:00
|
|
|
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
|
|
|
|
echo -n "Docs "
|
|
|
|
compare_dirs $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
|
|
|
|
echo -n "Docs "
|
|
|
|
compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
|
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
|
|
|
compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
|
|
|
compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
|
|
|
|
echo -n "JavaAppletPlugin "
|
|
|
|
compare_dirs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
|
|
|
echo -n "JavaAppletPlugin "
|
|
|
|
compare_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
|
|
|
fi
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
|
|
|
|
echo -n "Sparkle.framework "
|
|
|
|
compare_dirs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
|
|
|
|
echo -n "Sparkle.framework "
|
|
|
|
compare_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
2018-03-23 18:50:02 +03:00
|
|
|
if [ "$CMP_LIBS" = "true" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
|
|
|
echo -n "JDK "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_all_libs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
2014-08-17 18:51:37 +04:00
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
|
|
|
|
echo -n "JavaAppletPlugin "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_all_libs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
|
|
|
|
echo -n "Sparkle.framework "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_all_libs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
|
2016-02-11 13:54:00 +03:00
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
2018-03-23 18:50:02 +03:00
|
|
|
if [ "$CMP_EXECS" = "true" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_all_execs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
2014-08-17 18:51:37 +04:00
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
|
|
|
|
echo -n "JavaAppletPlugin "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_all_execs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
|
|
|
|
echo -n "Sparkle.framework "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_all_execs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
|
2016-02-11 13:54:00 +03:00
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CMP_GENERAL" = "true" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
|
|
|
echo -n "JDK "
|
|
|
|
compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
2018-03-23 18:50:02 +03:00
|
|
|
fi
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
|
|
|
|
echo -n "JDK Bundle "
|
|
|
|
compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2012-11-28 16:40:17 +04:00
|
|
|
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
|
|
|
|
echo -n "Docs "
|
|
|
|
compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
|
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
|
|
|
compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
|
|
|
|
echo -n "JavaAppletPlugin "
|
|
|
|
compare_general_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
|
|
|
fi
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
|
|
|
|
echo -n "Sparkle.framework "
|
|
|
|
compare_general_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CMP_ZIPS" = "true" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
|
|
|
compare_all_zip_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2013-01-04 20:08:33 +04:00
|
|
|
if [ -n "$THIS_SEC_BIN" ] && [ -n "$OTHER_SEC_BIN" ]; then
|
|
|
|
if [ -n "$(echo $THIS_SEC_BIN | $FILTER)" ]; then
|
|
|
|
echo "sec-bin.zip..."
|
2013-01-10 15:20:16 +04:00
|
|
|
compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-bin.zip
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -n "$THIS_SEC_WINDOWS_BIN" ] && [ -n "$OTHER_SEC_WINDOWS_BIN" ]; then
|
|
|
|
if [ -n "$(echo $THIS_SEC_WINDOWS_BIN | $FILTER)" ]; then
|
|
|
|
echo "sec-windows-bin.zip..."
|
|
|
|
compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-windows-bin.zip
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -n "$THIS_JGSS_WINDOWS_BIN" ] && [ -n "$OTHER_JGSS_WINDOWS_BIN" ]; then
|
|
|
|
if [ -n "$(echo $THIS_JGSS_WINDOWS_BIN | $FILTER)" ]; then
|
|
|
|
echo "$JGSS_WINDOWS_BIN..."
|
|
|
|
compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin $JGSS_WINDOWS_BIN
|
2013-01-04 20:08:33 +04:00
|
|
|
fi
|
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
|
|
|
compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -n "$THIS_DEPLOY_BUNDLE_DIR" ] && [ -n "$OTHER_DEPLOY_BUNDLE_DIR" ]; then
|
|
|
|
compare_all_zip_files $THIS_DEPLOY_BUNDLE_DIR $OTHER_DEPLOY_BUNDLE_DIR $COMPARE_ROOT/deploy-bundle
|
|
|
|
fi
|
|
|
|
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
|
|
|
|
compare_all_zip_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CMP_JARS" = "true" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
|
|
|
compare_all_jar_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
|
|
|
compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
|
|
|
|
compare_all_jar_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
2018-03-23 18:50:02 +03:00
|
|
|
if [ "$CMP_PERMS" = "true" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
|
|
|
echo -n "JDK "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_permissions $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
2014-08-17 18:51:37 +04:00
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
|
|
|
|
echo -n "JavaAppletPlugin "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_permissions $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
|
|
|
|
echo -n "Sparkle.framework "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_permissions $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
|
2016-02-11 13:54:00 +03:00
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
2018-03-23 18:50:02 +03:00
|
|
|
if [ "$CMP_TYPES" = "true" ]; then
|
2015-02-27 19:27:11 +03:00
|
|
|
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
|
2018-03-23 18:50:02 +03:00
|
|
|
echo -n "JDK "
|
|
|
|
compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
|
|
|
|
fi
|
|
|
|
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then
|
|
|
|
echo -n "JDK Bundle "
|
|
|
|
compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
2014-08-17 18:51:37 +04:00
|
|
|
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
2014-08-17 18:51:37 +04:00
|
|
|
fi
|
2015-01-15 17:09:37 +03:00
|
|
|
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
|
|
|
|
echo -n "JavaAppletPlugin "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_file_types $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
|
2015-01-15 17:09:37 +03:00
|
|
|
fi
|
2016-02-11 13:54:00 +03:00
|
|
|
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
|
|
|
|
echo -n "Sparkle.framework "
|
2018-03-23 18:50:02 +03:00
|
|
|
compare_file_types $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
|
2016-02-11 13:54:00 +03:00
|
|
|
fi
|
2012-10-27 01:29:57 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
if [ -n "$REGRESSIONS" ]; then
|
|
|
|
echo "REGRESSIONS FOUND!"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "No regressions found"
|
|
|
|
echo
|
|
|
|
exit 0
|
|
|
|
fi
|