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