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