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