Tue, 18 Sep 2012 11:29:16 -0700
7197849: Update new build-infra makefiles
Reviewed-by: ihse, erikj, ohrstrom, tbell
ohair@478 | 1 | #!/bin/bash |
ohair@478 | 2 | # |
ohair@478 | 3 | # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
ohair@478 | 4 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ohair@478 | 5 | # |
ohair@478 | 6 | # This code is free software; you can redistribute it and/or modify it |
ohair@478 | 7 | # under the terms of the GNU General Public License version 2 only, as |
ohair@478 | 8 | # published by the Free Software Foundation. |
ohair@478 | 9 | # |
ohair@478 | 10 | # This code is distributed in the hope that it will be useful, but WITHOUT |
ohair@478 | 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ohair@478 | 12 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ohair@478 | 13 | # version 2 for more details (a copy is included in the LICENSE file that |
ohair@478 | 14 | # accompanied this code). |
ohair@478 | 15 | # |
ohair@478 | 16 | # You should have received a copy of the GNU General Public License version |
ohair@478 | 17 | # 2 along with this work; if not, write to the Free Software Foundation, |
ohair@478 | 18 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ohair@478 | 19 | # |
ohair@478 | 20 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@478 | 21 | # or visit www.oracle.com if you need additional information or have any |
ohair@478 | 22 | # questions. |
ohair@478 | 23 | # |
ohair@478 | 24 | |
ohair@478 | 25 | # This script is processed by configure before it's usable. It is run from |
ohair@478 | 26 | # the root of the build directory. |
ohair@478 | 27 | |
ohair@478 | 28 | |
ohair@478 | 29 | ########################################################################################## |
ohair@478 | 30 | # Substitutions from autoconf |
ohair@478 | 31 | |
ohair@478 | 32 | LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@ |
ohair@478 | 33 | |
ohair@478 | 34 | OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@" |
ohair@478 | 35 | OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@" |
ohair@478 | 36 | |
ohair@478 | 37 | AWK="@AWK@" |
ohair@478 | 38 | CAT="@CAT@" |
ohair@478 | 39 | CMP="@CMP@" |
ohair@478 | 40 | CP="@CP@" |
ohair@478 | 41 | CUT="@CUT@" |
ohair@478 | 42 | DIFF="@DIFF@" |
ohair@478 | 43 | DUMPBIN="@UNCYGDRIVE@ @DUMPBIN@" |
ohair@478 | 44 | EXPR="@EXPR@" |
ohair@478 | 45 | FILE="@FILE@" |
ohair@478 | 46 | FIND="@FIND@" |
ohair@478 | 47 | GREP="@GREP@" |
ohair@478 | 48 | JAVAP="@UNCYGDRIVE@ @BOOT_JDK@/bin/javap" |
ohair@478 | 49 | LDD="@LDD@" |
ohair@478 | 50 | MKDIR="@MKDIR@" |
ohair@478 | 51 | NM="@NM@" |
ohair@478 | 52 | OBJDUMP="@OBJDUMP@" |
ohair@478 | 53 | OTOOL="@OTOOL@" |
ohair@478 | 54 | PRINTF="@PRINTF@" |
ohair@478 | 55 | READELF="@READELF@" |
ohair@478 | 56 | RM="@RM@" |
ohair@478 | 57 | SED="@SED@" |
ohair@478 | 58 | SORT="@SORT@" |
ohair@478 | 59 | STRIP="@POST_STRIP_CMD@" |
ohair@478 | 60 | TEE="@TEE@" |
ohair@478 | 61 | UNIQ="@UNIQ@" |
ohair@478 | 62 | UNZIP="@UNZIP@" |
ohair@478 | 63 | |
ohair@478 | 64 | SRC_ROOT="@SRC_ROOT@" |
ohair@478 | 65 | |
ohair@478 | 66 | if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
ohair@478 | 67 | READELF_CMD="otool -v -V -h -X -t -d" |
ohair@478 | 68 | elif [ -n "$READELF" ] && [ "$OPENJDK_TARGET_OS" != "windows" ]; then |
ohair@478 | 69 | READELF_CMD="$READELF -a" |
ohair@478 | 70 | fi |
ohair@478 | 71 | |
ohair@478 | 72 | if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
ohair@478 | 73 | LDD_CMD="$OTOOL -L" |
ohair@478 | 74 | elif [ -n "$LDD" ]; then |
ohair@478 | 75 | LDD_CMD="$LDD" |
ohair@478 | 76 | fi |
ohair@478 | 77 | |
ohair@478 | 78 | ########################################################################################## |
ohair@478 | 79 | # Diff exceptions |
ohair@478 | 80 | |
ohair@478 | 81 | if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then |
ohair@478 | 82 | STRIP_BEFORE_COMPARE=" |
ohair@478 | 83 | ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so |
ohair@478 | 84 | ./demo/jvmti/gctest/lib/libgctest.so |
ohair@478 | 85 | ./demo/jvmti/heapTracker/lib/libheapTracker.so |
ohair@478 | 86 | ./demo/jvmti/heapViewer/lib/libheapViewer.so |
ohair@478 | 87 | ./demo/jvmti/hprof/lib/libhprof.so |
ohair@478 | 88 | ./demo/jvmti/minst/lib/libminst.so |
ohair@478 | 89 | ./demo/jvmti/mtrace/lib/libmtrace.so |
ohair@478 | 90 | ./demo/jvmti/versionCheck/lib/libversionCheck.so |
ohair@478 | 91 | ./demo/jvmti/waiters/lib/libwaiters.so |
ohair@478 | 92 | " |
ohair@478 | 93 | |
ohair@478 | 94 | KNOWN_BIN_DIFF=" |
ohair@478 | 95 | " |
ohair@478 | 96 | |
ohair@478 | 97 | ACCEPTED_BIN_DIFF=" |
ohair@478 | 98 | ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so |
ohair@478 | 99 | ./demo/jvmti/gctest/lib/libgctest.so |
ohair@478 | 100 | ./demo/jvmti/heapTracker/lib/libheapTracker.so |
ohair@478 | 101 | ./demo/jvmti/heapViewer/lib/libheapViewer.so |
ohair@478 | 102 | ./demo/jvmti/hprof/lib/libhprof.so |
ohair@478 | 103 | ./demo/jvmti/minst/lib/libminst.so |
ohair@478 | 104 | ./demo/jvmti/mtrace/lib/libmtrace.so |
ohair@478 | 105 | ./demo/jvmti/versionCheck/lib/libversionCheck.so |
ohair@478 | 106 | ./demo/jvmti/waiters/lib/libwaiters.so |
ohair@478 | 107 | ./jre/lib/amd64/libattach.so |
ohair@478 | 108 | ./jre/lib/amd64/libdt_socket.so |
ohair@478 | 109 | ./jre/lib/amd64/libhprof.so |
ohair@478 | 110 | ./jre/lib/amd64/libinstrument.so |
ohair@478 | 111 | ./jre/lib/amd64/libjava_crw_demo.so |
ohair@478 | 112 | ./jre/lib/amd64/libjsdt.so |
ohair@478 | 113 | ./jre/lib/amd64/libjsig.so |
ohair@478 | 114 | ./jre/lib/amd64/libmanagement.so |
ohair@478 | 115 | ./jre/lib/amd64/libnpt.so |
ohair@478 | 116 | ./jre/lib/amd64/libsaproc.so |
ohair@478 | 117 | ./jre/lib/amd64/libverify.so |
ohair@478 | 118 | ./jre/lib/amd64/server/libjsig.so |
ohair@478 | 119 | ./jre/lib/amd64/server/libjvm.so |
ohair@478 | 120 | ./bin/appletviewer |
ohair@478 | 121 | ./bin/extcheck |
ohair@478 | 122 | ./bin/idlj |
ohair@478 | 123 | ./bin/jar |
ohair@478 | 124 | ./bin/jarsigner |
ohair@478 | 125 | ./bin/java |
ohair@478 | 126 | ./bin/javac |
ohair@478 | 127 | ./bin/javadoc |
ohair@478 | 128 | ./bin/javah |
ohair@478 | 129 | ./bin/javap |
ohair@478 | 130 | ./bin/jcmd |
ohair@478 | 131 | ./bin/jconsole |
ohair@478 | 132 | ./bin/jdb |
ohair@478 | 133 | ./bin/jhat |
ohair@478 | 134 | ./bin/jinfo |
ohair@478 | 135 | ./bin/jmap |
ohair@478 | 136 | ./bin/jps |
ohair@478 | 137 | ./bin/jrunscript |
ohair@478 | 138 | ./bin/jsadebugd |
ohair@478 | 139 | ./bin/jstack |
ohair@478 | 140 | ./bin/jstat |
ohair@478 | 141 | ./bin/jstatd |
ohair@478 | 142 | ./bin/keytool |
ohair@478 | 143 | ./bin/native2ascii |
ohair@478 | 144 | ./bin/orbd |
ohair@478 | 145 | ./bin/pack200 |
ohair@478 | 146 | ./bin/policytool |
ohair@478 | 147 | ./bin/rmic |
ohair@478 | 148 | ./bin/rmid |
ohair@478 | 149 | ./bin/rmiregistry |
ohair@478 | 150 | ./bin/schemagen |
ohair@478 | 151 | ./bin/serialver |
ohair@478 | 152 | ./bin/servertool |
ohair@478 | 153 | ./bin/tnameserv |
ohair@478 | 154 | ./bin/wsgen |
ohair@478 | 155 | ./bin/wsimport |
ohair@478 | 156 | ./bin/xjc |
ohair@478 | 157 | ./jre/bin/java |
ohair@478 | 158 | ./jre/bin/keytool |
ohair@478 | 159 | ./jre/bin/orbd |
ohair@478 | 160 | ./jre/bin/pack200 |
ohair@478 | 161 | ./jre/bin/policytool |
ohair@478 | 162 | ./jre/bin/rmid |
ohair@478 | 163 | ./jre/bin/rmiregistry |
ohair@478 | 164 | ./jre/bin/servertool |
ohair@478 | 165 | ./jre/bin/tnameserv |
ohair@478 | 166 | " |
ohair@478 | 167 | |
ohair@478 | 168 | KNOWN_SIZE_DIFF=" |
ohair@478 | 169 | " |
ohair@478 | 170 | |
ohair@478 | 171 | KNOWN_SYM_DIFF=" |
ohair@478 | 172 | " |
ohair@478 | 173 | |
ohair@478 | 174 | KNOWN_ELF_DIFF=" |
ohair@478 | 175 | ./demo/jvmti/heapTracker/lib/libheapTracker.so |
ohair@478 | 176 | ./demo/jvmti/hprof/lib/libhprof.so |
ohair@478 | 177 | ./demo/jvmti/waiters/lib/libwaiters.so |
ohair@478 | 178 | " |
ohair@478 | 179 | fi |
ohair@478 | 180 | |
ohair@478 | 181 | if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86" ]; then |
ohair@478 | 182 | |
ohair@478 | 183 | STRIP_BEFORE_COMPARE=" |
ohair@478 | 184 | ./demo/jni/Poller/lib/libPoller.so |
ohair@478 | 185 | ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so |
ohair@478 | 186 | ./demo/jvmti/gctest/lib/libgctest.so |
ohair@478 | 187 | ./demo/jvmti/heapTracker/lib/libheapTracker.so |
ohair@478 | 188 | ./demo/jvmti/heapViewer/lib/libheapViewer.so |
ohair@478 | 189 | ./demo/jvmti/hprof/lib/libhprof.so |
ohair@478 | 190 | ./demo/jvmti/minst/lib/libminst.so |
ohair@478 | 191 | ./demo/jvmti/mtrace/lib/libmtrace.so |
ohair@478 | 192 | ./demo/jvmti/versionCheck/lib/libversionCheck.so |
ohair@478 | 193 | ./demo/jvmti/waiters/lib/libwaiters.so |
ohair@478 | 194 | ./jre/lib/i386/jexec |
ohair@478 | 195 | " |
ohair@478 | 196 | |
ohair@478 | 197 | SORT_SYMBOLS=" |
ohair@478 | 198 | ./jre/lib/i386/client/libjvm.so |
ohair@478 | 199 | ./jre/lib/i386/server/libjvm.so |
ohair@478 | 200 | " |
ohair@478 | 201 | |
ohair@478 | 202 | SKIP_BIN_DIFF="true" |
ohair@478 | 203 | |
ohair@478 | 204 | ACCEPTED_SMALL_SIZE_DIFF=" |
ohair@478 | 205 | ./demo/jni/Poller/lib/libPoller.so |
ohair@478 | 206 | ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so |
ohair@478 | 207 | ./demo/jvmti/gctest/lib/libgctest.so |
ohair@478 | 208 | ./demo/jvmti/heapTracker/lib/libheapTracker.so |
ohair@478 | 209 | ./demo/jvmti/heapViewer/lib/libheapViewer.so |
ohair@478 | 210 | ./demo/jvmti/hprof/lib/libhprof.so |
ohair@478 | 211 | ./demo/jvmti/minst/lib/libminst.so |
ohair@478 | 212 | ./demo/jvmti/mtrace/lib/libmtrace.so |
ohair@478 | 213 | ./demo/jvmti/versionCheck/lib/libversionCheck.so |
ohair@478 | 214 | ./demo/jvmti/waiters/lib/libwaiters.so |
ohair@478 | 215 | ./jre/lib/i386/client/libjvm.so |
ohair@478 | 216 | ./jre/lib/i386/jli/libjli.so |
ohair@478 | 217 | ./jre/lib/i386/libJdbcOdbc.so |
ohair@478 | 218 | ./jre/lib/i386/libattach.so |
ohair@478 | 219 | ./jre/lib/i386/libawt.so |
ohair@478 | 220 | ./jre/lib/i386/libawt_headless.so |
ohair@478 | 221 | ./jre/lib/i386/libawt_xawt.so |
ohair@478 | 222 | ./jre/lib/i386/libdcpr.so |
ohair@478 | 223 | ./jre/lib/i386/libdt_socket.so |
ohair@478 | 224 | ./jre/lib/i386/libfontmanager.so |
ohair@478 | 225 | ./jre/lib/i386/libhprof.so |
ohair@478 | 226 | ./jre/lib/i386/libinstrument.so |
ohair@478 | 227 | ./jre/lib/i386/libj2gss.so |
ohair@478 | 228 | ./jre/lib/i386/libj2pcsc.so |
ohair@478 | 229 | ./jre/lib/i386/libj2pkcs11.so |
ohair@478 | 230 | ./jre/lib/i386/libj2ucrypto.so |
ohair@478 | 231 | ./jre/lib/i386/libjaas_unix.so |
ohair@478 | 232 | ./jre/lib/i386/libjava.so |
ohair@478 | 233 | ./jre/lib/i386/libjava_crw_demo.so |
ohair@478 | 234 | ./jre/lib/i386/libjawt.so |
ohair@478 | 235 | ./jre/lib/i386/libjdwp.so |
ohair@478 | 236 | ./jre/lib/i386/libjfr.so |
ohair@478 | 237 | ./jre/lib/i386/libjpeg.so |
ohair@478 | 238 | ./jre/lib/i386/libjsdt.so |
ohair@478 | 239 | ./jre/lib/i386/libjsound.so |
ohair@478 | 240 | ./jre/lib/i386/libkcms.so |
ohair@478 | 241 | ./jre/lib/i386/libmanagement.so |
ohair@478 | 242 | ./jre/lib/i386/libmlib_image.so |
ohair@478 | 243 | ./jre/lib/i386/libnet.so |
ohair@478 | 244 | ./jre/lib/i386/libnio.so |
ohair@478 | 245 | ./jre/lib/i386/libnpt.so |
ohair@478 | 246 | ./jre/lib/i386/libsctp.so |
ohair@478 | 247 | ./jre/lib/i386/libsplashscreen.so |
ohair@478 | 248 | ./jre/lib/i386/libsunec.so |
ohair@478 | 249 | ./jre/lib/i386/libsunwjdga.so |
ohair@478 | 250 | ./jre/lib/i386/libt2k.so |
ohair@478 | 251 | ./jre/lib/i386/libunpack.so |
ohair@478 | 252 | ./jre/lib/i386/libverify.so |
ohair@478 | 253 | ./jre/lib/i386/libzip.so |
ohair@478 | 254 | ./jre/lib/i386/server/libjvm.so |
ohair@478 | 255 | ./bin/appletviewer |
ohair@478 | 256 | ./bin/extcheck |
ohair@478 | 257 | ./bin/idlj |
ohair@478 | 258 | ./bin/jar |
ohair@478 | 259 | ./bin/jarsigner |
ohair@478 | 260 | ./bin/java |
ohair@478 | 261 | ./bin/javac |
ohair@478 | 262 | ./bin/javadoc |
ohair@478 | 263 | ./bin/javah |
ohair@478 | 264 | ./bin/javap |
ohair@478 | 265 | ./bin/jcmd |
ohair@478 | 266 | ./bin/jconsole |
ohair@478 | 267 | ./bin/jdb |
ohair@478 | 268 | ./bin/jhat |
ohair@478 | 269 | ./bin/jinfo |
ohair@478 | 270 | ./bin/jmap |
ohair@478 | 271 | ./bin/jps |
ohair@478 | 272 | ./bin/jrunscript |
ohair@478 | 273 | ./bin/jsadebugd |
ohair@478 | 274 | ./bin/jstack |
ohair@478 | 275 | ./bin/jstat |
ohair@478 | 276 | ./bin/jstatd |
ohair@478 | 277 | ./bin/keytool |
ohair@478 | 278 | ./bin/native2ascii |
ohair@478 | 279 | ./bin/orbd |
ohair@478 | 280 | ./bin/pack200 |
ohair@478 | 281 | ./bin/policytool |
ohair@478 | 282 | ./bin/rmic |
ohair@478 | 283 | ./bin/rmid |
ohair@478 | 284 | ./bin/rmiregistry |
ohair@478 | 285 | ./bin/schemagen |
ohair@478 | 286 | ./bin/serialver |
ohair@478 | 287 | ./bin/servertool |
ohair@478 | 288 | ./bin/tnameserv |
ohair@478 | 289 | ./bin/unpack200 |
ohair@478 | 290 | ./bin/wsgen |
ohair@478 | 291 | ./bin/wsimport |
ohair@478 | 292 | ./bin/xjc |
ohair@478 | 293 | ./jre/bin/java |
ohair@478 | 294 | ./jre/bin/keytool |
ohair@478 | 295 | ./jre/bin/orbd |
ohair@478 | 296 | ./jre/bin/pack200 |
ohair@478 | 297 | ./jre/bin/policytool |
ohair@478 | 298 | ./jre/bin/rmid |
ohair@478 | 299 | ./jre/bin/rmiregistry |
ohair@478 | 300 | ./jre/bin/servertool |
ohair@478 | 301 | ./jre/bin/tnameserv |
ohair@478 | 302 | ./jre/bin/unpack200 |
ohair@478 | 303 | ./jre/lib/i386/jexec |
ohair@478 | 304 | " |
ohair@478 | 305 | |
ohair@478 | 306 | SKIP_ELF_DIFF="true" |
ohair@478 | 307 | |
ohair@478 | 308 | # libjvm.so differs in the random 15 char prefix on some symbols. |
ohair@478 | 309 | ACCEPTED_DIS_DIFF=" |
ohair@478 | 310 | ./jre/lib/i386/client/libjvm.so |
ohair@478 | 311 | ./jre/lib/i386/server/libjvm.so |
ohair@478 | 312 | " |
ohair@478 | 313 | |
ohair@478 | 314 | fi |
ohair@478 | 315 | |
ohair@478 | 316 | if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then |
ohair@478 | 317 | |
ohair@478 | 318 | STRIP_BEFORE_COMPARE=" |
ohair@478 | 319 | ./demo/jni/Poller/lib/amd64/libPoller.so |
ohair@478 | 320 | ./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so |
ohair@478 | 321 | ./demo/jvmti/gctest/lib/amd64/libgctest.so |
ohair@478 | 322 | ./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so |
ohair@478 | 323 | ./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so |
ohair@478 | 324 | ./demo/jvmti/hprof/lib/amd64/libhprof.so |
ohair@478 | 325 | ./demo/jvmti/minst/lib/amd64/libminst.so |
ohair@478 | 326 | ./demo/jvmti/mtrace/lib/amd64/libmtrace.so |
ohair@478 | 327 | ./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so |
ohair@478 | 328 | ./demo/jvmti/waiters/lib/amd64/libwaiters.so |
ohair@478 | 329 | " |
ohair@478 | 330 | |
ohair@478 | 331 | SORT_SYMBOLS=" |
ohair@478 | 332 | ./jre/lib/amd64/server/libjvm.so |
ohair@478 | 333 | " |
ohair@478 | 334 | |
ohair@478 | 335 | SKIP_BIN_DIFF="true" |
ohair@478 | 336 | |
ohair@478 | 337 | ACCEPTED_SMALL_SIZE_DIFF=" |
ohair@478 | 338 | ./demo/jni/Poller/lib/amd64/libPoller.so |
ohair@478 | 339 | ./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so |
ohair@478 | 340 | ./demo/jvmti/gctest/lib/amd64/libgctest.so |
ohair@478 | 341 | ./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so |
ohair@478 | 342 | ./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so |
ohair@478 | 343 | ./demo/jvmti/hprof/lib/amd64/libhprof.so |
ohair@478 | 344 | ./demo/jvmti/minst/lib/amd64/libminst.so |
ohair@478 | 345 | ./demo/jvmti/mtrace/lib/amd64/libmtrace.so |
ohair@478 | 346 | ./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so |
ohair@478 | 347 | ./demo/jvmti/waiters/lib/amd64/libwaiters.so |
ohair@478 | 348 | ./jre/lib/amd64/jli/libjli.so |
ohair@478 | 349 | ./jre/lib/amd64/libJdbcOdbc.so |
ohair@478 | 350 | ./jre/lib/amd64/libattach.so |
ohair@478 | 351 | ./jre/lib/amd64/libawt.so |
ohair@478 | 352 | ./jre/lib/amd64/libawt_headless.so |
ohair@478 | 353 | ./jre/lib/amd64/libawt_xawt.so |
ohair@478 | 354 | ./jre/lib/amd64/libdcpr.so |
ohair@478 | 355 | ./jre/lib/amd64/libdt_socket.so |
ohair@478 | 356 | ./jre/lib/amd64/libfontmanager.so |
ohair@478 | 357 | ./jre/lib/amd64/libhprof.so |
ohair@478 | 358 | ./jre/lib/amd64/libinstrument.so |
ohair@478 | 359 | ./jre/lib/amd64/libj2gss.so |
ohair@478 | 360 | ./jre/lib/amd64/libj2pcsc.so |
ohair@478 | 361 | ./jre/lib/amd64/libj2pkcs11.so |
ohair@478 | 362 | ./jre/lib/amd64/libj2ucrypto.so |
ohair@478 | 363 | ./jre/lib/amd64/libjaas_unix.so |
ohair@478 | 364 | ./jre/lib/amd64/libjava.so |
ohair@478 | 365 | ./jre/lib/amd64/libjava_crw_demo.so |
ohair@478 | 366 | ./jre/lib/amd64/libjawt.so |
ohair@478 | 367 | ./jre/lib/amd64/libjdwp.so |
ohair@478 | 368 | ./jre/lib/amd64/libjfr.so |
ohair@478 | 369 | ./jre/lib/amd64/libjpeg.so |
ohair@478 | 370 | ./jre/lib/amd64/libjsdt.so |
ohair@478 | 371 | ./jre/lib/amd64/libjsound.so |
ohair@478 | 372 | ./jre/lib/amd64/libkcms.so |
ohair@478 | 373 | ./jre/lib/amd64/libmanagement.so |
ohair@478 | 374 | ./jre/lib/amd64/libmlib_image.so |
ohair@478 | 375 | ./jre/lib/amd64/libnet.so |
ohair@478 | 376 | ./jre/lib/amd64/libnio.so |
ohair@478 | 377 | ./jre/lib/amd64/libnpt.so |
ohair@478 | 378 | ./jre/lib/amd64/libsctp.so |
ohair@478 | 379 | ./jre/lib/amd64/libsplashscreen.so |
ohair@478 | 380 | ./jre/lib/amd64/libsunec.so |
ohair@478 | 381 | ./jre/lib/amd64/libsunwjdga.so |
ohair@478 | 382 | ./jre/lib/amd64/libt2k.so |
ohair@478 | 383 | ./jre/lib/amd64/libunpack.so |
ohair@478 | 384 | ./jre/lib/amd64/libverify.so |
ohair@478 | 385 | ./jre/lib/amd64/libzip.so |
ohair@478 | 386 | ./jre/lib/amd64/server/64/libjvm_db.so |
ohair@478 | 387 | ./jre/lib/amd64/server/64/libjvm_dtrace.so |
ohair@478 | 388 | ./bin/amd64/appletviewer |
ohair@478 | 389 | ./bin/amd64/extcheck |
ohair@478 | 390 | ./bin/amd64/idlj |
ohair@478 | 391 | ./bin/amd64/jar |
ohair@478 | 392 | ./bin/amd64/jarsigner |
ohair@478 | 393 | ./bin/amd64/java |
ohair@478 | 394 | ./bin/amd64/javac |
ohair@478 | 395 | ./bin/amd64/javadoc |
ohair@478 | 396 | ./bin/amd64/javah |
ohair@478 | 397 | ./bin/amd64/javap |
ohair@478 | 398 | ./bin/amd64/jcmd |
ohair@478 | 399 | ./bin/amd64/jconsole |
ohair@478 | 400 | ./bin/amd64/jdb |
ohair@478 | 401 | ./bin/amd64/jhat |
ohair@478 | 402 | ./bin/amd64/jinfo |
ohair@478 | 403 | ./bin/amd64/jmap |
ohair@478 | 404 | ./bin/amd64/jps |
ohair@478 | 405 | ./bin/amd64/jrunscript |
ohair@478 | 406 | ./bin/amd64/jsadebugd |
ohair@478 | 407 | ./bin/amd64/jstack |
ohair@478 | 408 | ./bin/amd64/jstat |
ohair@478 | 409 | ./bin/amd64/jstatd |
ohair@478 | 410 | ./bin/amd64/keytool |
ohair@478 | 411 | ./bin/amd64/native2ascii |
ohair@478 | 412 | ./bin/amd64/orbd |
ohair@478 | 413 | ./bin/amd64/pack200 |
ohair@478 | 414 | ./bin/amd64/policytool |
ohair@478 | 415 | ./bin/amd64/rmic |
ohair@478 | 416 | ./bin/amd64/rmid |
ohair@478 | 417 | ./bin/amd64/rmiregistry |
ohair@478 | 418 | ./bin/amd64/schemagen |
ohair@478 | 419 | ./bin/amd64/serialver |
ohair@478 | 420 | ./bin/amd64/servertool |
ohair@478 | 421 | ./bin/amd64/tnameserv |
ohair@478 | 422 | ./bin/amd64/unpack200 |
ohair@478 | 423 | ./bin/amd64/wsgen |
ohair@478 | 424 | ./bin/amd64/wsimport |
ohair@478 | 425 | ./bin/amd64/xjc |
ohair@478 | 426 | ./jre/bin/amd64/java |
ohair@478 | 427 | ./jre/bin/amd64/keytool |
ohair@478 | 428 | ./jre/bin/amd64/orbd |
ohair@478 | 429 | ./jre/bin/amd64/pack200 |
ohair@478 | 430 | ./jre/bin/amd64/policytool |
ohair@478 | 431 | ./jre/bin/amd64/rmid |
ohair@478 | 432 | ./jre/bin/amd64/rmiregistry |
ohair@478 | 433 | ./jre/bin/amd64/servertool |
ohair@478 | 434 | ./jre/bin/amd64/tnameserv |
ohair@478 | 435 | ./jre/bin/amd64/unpack200 |
ohair@478 | 436 | ./jre/lib/amd64/jexec |
ohair@478 | 437 | " |
ohair@478 | 438 | |
ohair@478 | 439 | SKIP_ELF_DIFF="true" |
ohair@478 | 440 | |
ohair@478 | 441 | # Can't find an explaination for the diff in libmlib_image.so. |
ohair@478 | 442 | KNOWN_DIS_DIFF=" |
ohair@478 | 443 | ./jre/lib/amd64/libmlib_image.so |
ohair@478 | 444 | " |
ohair@478 | 445 | # libjvm.so differs in the random 15 char prefix on some symbols. |
ohair@478 | 446 | ACCEPTED_DIS_DIFF=" |
ohair@478 | 447 | ./jre/lib/amd64/server/libjvm.so |
ohair@478 | 448 | " |
ohair@478 | 449 | |
ohair@478 | 450 | fi |
ohair@478 | 451 | |
ohair@478 | 452 | if [ "$OPENJDK_TARGET_OS" = "windows" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then |
ohair@478 | 453 | |
ohair@478 | 454 | ACCEPTED_BIN_DIFF=" |
ohair@478 | 455 | ./bin/jli.dll |
ohair@478 | 456 | ./demo/jvmti/compiledMethodLoad/lib/compiledMethodLoad.dll |
ohair@478 | 457 | ./demo/jvmti/gctest/lib/gctest.dll |
ohair@478 | 458 | ./demo/jvmti/heapTracker/lib/heapTracker.dll |
ohair@478 | 459 | ./demo/jvmti/heapViewer/lib/heapViewer.dll |
ohair@478 | 460 | ./demo/jvmti/hprof/lib/hprof.dll |
ohair@478 | 461 | ./demo/jvmti/minst/lib/minst.dll |
ohair@478 | 462 | ./demo/jvmti/mtrace/lib/mtrace.dll |
ohair@478 | 463 | ./demo/jvmti/versionCheck/lib/versionCheck.dll |
ohair@478 | 464 | ./demo/jvmti/waiters/lib/waiters.dll |
ohair@478 | 465 | ./jre/bin/attach.dll |
ohair@478 | 466 | ./jre/bin/awt.dll |
ohair@478 | 467 | ./jre/bin/dcpr.dll |
ohair@478 | 468 | ./jre/bin/dt_shmem.dll |
ohair@478 | 469 | ./jre/bin/dt_socket.dll |
ohair@478 | 470 | ./jre/bin/fontmanager.dll |
ohair@478 | 471 | ./jre/bin/hprof.dll |
ohair@478 | 472 | ./jre/bin/instrument.dll |
ohair@478 | 473 | ./jre/bin/j2pcsc.dll |
ohair@478 | 474 | ./jre/bin/j2pkcs11.dll |
ohair@478 | 475 | ./jre/bin/jaas_nt.dll |
ohair@478 | 476 | ./jre/bin/java.dll |
ohair@478 | 477 | ./jre/bin/java_crw_demo.dll |
ohair@478 | 478 | ./jre/bin/jawt.dll |
ohair@478 | 479 | ./jre/bin/JdbcOdbc.dll |
ohair@478 | 480 | ./jre/bin/jdwp.dll |
ohair@478 | 481 | ./jre/bin/jfr.dll |
ohair@478 | 482 | ./jre/bin/jli.dll |
ohair@478 | 483 | ./jre/bin/jpeg.dll |
ohair@478 | 484 | ./jre/bin/jsdt.dll |
ohair@478 | 485 | ./jre/bin/jsound.dll |
ohair@478 | 486 | ./jre/bin/jsoundds.dll |
ohair@478 | 487 | ./jre/bin/kcms.dll |
ohair@478 | 488 | ./jre/bin/management.dll |
ohair@478 | 489 | ./jre/bin/mlib_image.dll |
ohair@478 | 490 | ./jre/bin/net.dll |
ohair@478 | 491 | ./jre/bin/nio.dll |
ohair@478 | 492 | ./jre/bin/npt.dll |
ohair@478 | 493 | ./jre/bin/sawindbg.dll |
ohair@478 | 494 | ./jre/bin/server/jvm.dll |
ohair@478 | 495 | ./jre/bin/splashscreen.dll |
ohair@478 | 496 | ./jre/bin/sunec.dll |
ohair@478 | 497 | ./jre/bin/sunmscapi.dll |
ohair@478 | 498 | ./jre/bin/t2k.dll |
ohair@478 | 499 | ./jre/bin/unpack.dll |
ohair@478 | 500 | ./jre/bin/verify.dll |
ohair@478 | 501 | ./jre/bin/w2k_lsa_auth.dll |
ohair@478 | 502 | ./jre/bin/zip.dll |
ohair@478 | 503 | ./bin/appletviewer.exe |
ohair@478 | 504 | ./bin/extcheck.exe |
ohair@478 | 505 | ./bin/idlj.exe |
ohair@478 | 506 | ./bin/jar.exe |
ohair@478 | 507 | ./bin/jarsigner.exe |
ohair@478 | 508 | ./bin/java.exe |
ohair@478 | 509 | ./bin/javac.exe |
ohair@478 | 510 | ./bin/javadoc.exe |
ohair@478 | 511 | ./bin/javah.exe |
ohair@478 | 512 | ./bin/javap.exe |
ohair@478 | 513 | ./bin/java-rmi.exe |
ohair@478 | 514 | ./bin/javaw.exe |
ohair@478 | 515 | ./bin/jcmd.exe |
ohair@478 | 516 | ./bin/jconsole.exe |
ohair@478 | 517 | ./bin/jdb.exe |
ohair@478 | 518 | ./bin/jhat.exe |
ohair@478 | 519 | ./bin/jinfo.exe |
ohair@478 | 520 | ./bin/jmap.exe |
ohair@478 | 521 | ./bin/jps.exe |
ohair@478 | 522 | ./bin/jrunscript.exe |
ohair@478 | 523 | ./bin/jsadebugd.exe |
ohair@478 | 524 | ./bin/jstack.exe |
ohair@478 | 525 | ./bin/jstat.exe |
ohair@478 | 526 | ./bin/jstatd.exe |
ohair@478 | 527 | ./bin/keytool.exe |
ohair@478 | 528 | ./bin/kinit.exe |
ohair@478 | 529 | ./bin/klist.exe |
ohair@478 | 530 | ./bin/ktab.exe |
ohair@478 | 531 | ./bin/native2ascii.exe |
ohair@478 | 532 | ./bin/orbd.exe |
ohair@478 | 533 | ./bin/pack200.exe |
ohair@478 | 534 | ./bin/policytool.exe |
ohair@478 | 535 | ./bin/rmic.exe |
ohair@478 | 536 | ./bin/rmid.exe |
ohair@478 | 537 | ./bin/rmiregistry.exe |
ohair@478 | 538 | ./bin/schemagen.exe |
ohair@478 | 539 | ./bin/serialver.exe |
ohair@478 | 540 | ./bin/servertool.exe |
ohair@478 | 541 | ./bin/tnameserv.exe |
ohair@478 | 542 | ./bin/unpack200.exe |
ohair@478 | 543 | ./bin/wsgen.exe |
ohair@478 | 544 | ./bin/wsimport.exe |
ohair@478 | 545 | ./bin/xjc.exe |
ohair@478 | 546 | ./jre/bin/java.exe |
ohair@478 | 547 | ./jre/bin/java-rmi.exe |
ohair@478 | 548 | ./jre/bin/javaw.exe |
ohair@478 | 549 | ./jre/bin/keytool.exe |
ohair@478 | 550 | ./jre/bin/kinit.exe |
ohair@478 | 551 | ./jre/bin/klist.exe |
ohair@478 | 552 | ./jre/bin/ktab.exe |
ohair@478 | 553 | ./jre/bin/orbd.exe |
ohair@478 | 554 | ./jre/bin/pack200.exe |
ohair@478 | 555 | ./jre/bin/policytool.exe |
ohair@478 | 556 | ./jre/bin/rmid.exe |
ohair@478 | 557 | ./jre/bin/rmiregistry.exe |
ohair@478 | 558 | ./jre/bin/servertool.exe |
ohair@478 | 559 | ./jre/bin/tnameserv.exe |
ohair@478 | 560 | ./jre/bin/unpack200.exe |
ohair@478 | 561 | " |
ohair@478 | 562 | |
ohair@478 | 563 | KNOWN_SIZE_DIFF=" |
ohair@478 | 564 | ./demo/jvmti/heapTracker/lib/heapTracker.dll |
ohair@478 | 565 | ./demo/jvmti/minst/lib/minst.dll |
ohair@478 | 566 | ./jre/bin/awt.dll |
ohair@478 | 567 | ./jre/bin/java_crw_demo.dll |
ohair@478 | 568 | ./bin/java.exe |
ohair@478 | 569 | ./bin/javaw.exe |
ohair@478 | 570 | ./bin/unpack200.exe |
ohair@478 | 571 | ./jre/bin/java.exe |
ohair@478 | 572 | ./jre/bin/javaw.exe |
ohair@478 | 573 | ./jre/bin/unpack200.exe |
ohair@478 | 574 | " |
ohair@478 | 575 | |
ohair@478 | 576 | KNOWN_SYM_DIFF=" |
ohair@478 | 577 | ./jre/bin/awt.dll |
ohair@478 | 578 | ./jre/bin/java_crw_demo.dll |
ohair@478 | 579 | " |
ohair@478 | 580 | fi |
ohair@478 | 581 | |
ohair@478 | 582 | |
ohair@478 | 583 | |
ohair@478 | 584 | if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
ohair@478 | 585 | ACCEPTED_JARZIP_CONTENTS=" |
ohair@478 | 586 | /META-INF/INDEX.LIST |
ohair@478 | 587 | " |
ohair@478 | 588 | |
ohair@478 | 589 | KNOWN_BIN_DIFF=" |
ohair@478 | 590 | ./jre/lib/libJObjC.dylib |
ohair@478 | 591 | ./jre/lib/libsaproc.dylib |
ohair@478 | 592 | ./jre/lib/server/libjvm.dylib |
ohair@478 | 593 | " |
ohair@478 | 594 | |
ohair@478 | 595 | ACCEPTED_BIN_DIFF=" |
ohair@478 | 596 | ./bin/appletviewer |
ohair@478 | 597 | ./bin/extcheck |
ohair@478 | 598 | ./bin/idlj |
ohair@478 | 599 | ./bin/jar |
ohair@478 | 600 | ./bin/jarsigner |
ohair@478 | 601 | ./bin/java |
ohair@478 | 602 | ./bin/javac |
ohair@478 | 603 | ./bin/javadoc |
ohair@478 | 604 | ./bin/javah |
ohair@478 | 605 | ./bin/javap |
ohair@478 | 606 | ./bin/jcmd |
ohair@478 | 607 | ./bin/jconsole |
ohair@478 | 608 | ./bin/jdb |
ohair@478 | 609 | ./bin/jhat |
ohair@478 | 610 | ./bin/jinfo |
ohair@478 | 611 | ./bin/jmap |
ohair@478 | 612 | ./bin/jps |
ohair@478 | 613 | ./bin/jrunscript |
ohair@478 | 614 | ./bin/jsadebugd |
ohair@478 | 615 | ./bin/jstack |
ohair@478 | 616 | ./bin/jstat |
ohair@478 | 617 | ./bin/jstatd |
ohair@478 | 618 | ./bin/keytool |
ohair@478 | 619 | ./bin/native2ascii |
ohair@478 | 620 | ./bin/orbd |
ohair@478 | 621 | ./bin/pack200 |
ohair@478 | 622 | ./bin/policytool |
ohair@478 | 623 | ./bin/rmic |
ohair@478 | 624 | ./bin/rmid |
ohair@478 | 625 | ./bin/rmiregistry |
ohair@478 | 626 | ./bin/schemagen |
ohair@478 | 627 | ./bin/serialver |
ohair@478 | 628 | ./bin/servertool |
ohair@478 | 629 | ./bin/tnameserv |
ohair@478 | 630 | ./bin/wsgen |
ohair@478 | 631 | ./bin/wsimport |
ohair@478 | 632 | ./bin/xjc |
ohair@478 | 633 | ./jre/bin/java |
ohair@478 | 634 | ./jre/bin/keytool |
ohair@478 | 635 | ./jre/bin/orbd |
ohair@478 | 636 | ./jre/bin/pack200 |
ohair@478 | 637 | ./jre/bin/policytool |
ohair@478 | 638 | ./jre/bin/rmid |
ohair@478 | 639 | ./jre/bin/rmiregistry |
ohair@478 | 640 | ./jre/bin/servertool |
ohair@478 | 641 | ./jre/bin/tnameserv |
ohair@478 | 642 | " |
ohair@478 | 643 | |
ohair@478 | 644 | KNOWN_SIZE_DIFF=" |
ohair@478 | 645 | ./jre/lib/libJObjC.dylib |
ohair@478 | 646 | ./jre/lib/server/libjvm.dylib |
ohair@478 | 647 | " |
ohair@478 | 648 | |
ohair@478 | 649 | KNOWN_SYM_DIFF=" |
ohair@478 | 650 | ./jre/lib/libJObjC.dylib |
ohair@478 | 651 | ./jre/lib/server/libjvm.dylib |
ohair@478 | 652 | " |
ohair@478 | 653 | |
ohair@478 | 654 | KNOWN_ELF_DIFF=" |
ohair@478 | 655 | ./jre/lib/libJObjC.dylib |
ohair@478 | 656 | ./jre/lib/server/libjvm.dylib |
ohair@478 | 657 | " |
ohair@478 | 658 | |
ohair@478 | 659 | SKIP_DIS_DIFF="true" |
ohair@478 | 660 | |
ohair@478 | 661 | fi |
ohair@478 | 662 | |
ohair@478 | 663 | ########################################################################################## |
ohair@478 | 664 | # Compare text files and ignore specific differences: |
ohair@478 | 665 | # |
ohair@478 | 666 | # * Timestamps in Java sources generated by idl2java |
ohair@478 | 667 | # * Sorting order and cleanup style in .properties files |
ohair@478 | 668 | |
ohair@478 | 669 | diff_text() { |
ohair@478 | 670 | OTHER_FILE=$1 |
ohair@478 | 671 | THIS_FILE=$2 |
ohair@478 | 672 | |
ohair@478 | 673 | SUFFIX="${THIS_FILE##*.}" |
ohair@478 | 674 | |
ohair@478 | 675 | TMP=1 |
ohair@478 | 676 | |
ohair@478 | 677 | if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then |
ohair@478 | 678 | TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \ |
ohair@478 | 679 | $GREP '^[<>]' | \ |
ohair@478 | 680 | $SED -e '/[<>] Ant-Version: Apache Ant .*/d' \ |
ohair@478 | 681 | -e '/[<>] Created-By: .* (Oracle Corporation).*/d') |
ohair@478 | 682 | fi |
ohair@478 | 683 | if test "x$SUFFIX" = "xjava"; then |
ohair@478 | 684 | TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \ |
ohair@478 | 685 | $GREP '^[<>]' | \ |
ohair@478 | 686 | $SED -e '/[<>] \* from.*\.idl/d' \ |
ohair@478 | 687 | -e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ |
ohair@478 | 688 | -e '/[<>] \*.*[0-9]\{4\} [0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \ |
ohair@478 | 689 | -e '/\/\/ Generated from input file.*/d' \ |
ohair@478 | 690 | -e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \ |
ohair@478 | 691 | -e '/\/\/ java GenerateCharacter.*/d') |
ohair@478 | 692 | fi |
ohair@478 | 693 | # Ignore date strings in class files. |
ohair@478 | 694 | # On Macosx the system sources for generated java classes produce different output on |
ohair@478 | 695 | # consequtive invokations seemingly randomly. |
ohair@478 | 696 | # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this. |
ohair@478 | 697 | if test "x$SUFFIX" = "xclass"; then |
ohair@478 | 698 | $JAVAP -c -constants -l -p ${OTHER_FILE} > ${OTHER_FILE}.javap |
ohair@478 | 699 | $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap |
ohair@478 | 700 | TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \ |
ohair@478 | 701 | $GREP '^[<>]' | \ |
ohair@478 | 702 | $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ |
ohair@478 | 703 | -e '/[<>].*Point Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \ |
ohair@478 | 704 | -e '/[<>].*public com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*itemsPtr();/d' \ |
ohair@478 | 705 | -e '/[<>].*public void setItemsPtr(com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*);/d') |
ohair@478 | 706 | fi |
ohair@478 | 707 | if test "x$SUFFIX" = "xproperties"; then |
ohair@478 | 708 | $CAT $OTHER_FILE | $SED -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ |
ohair@478 | 709 | | $SED -f "$SRC_ROOT/common/bin/unicode2x.sed" \ |
ohair@478 | 710 | | $SED -e '/^#/d' -e '/^$/d' \ |
ohair@478 | 711 | -e :a -e '/\\$/N; s/\\\n//; ta' \ |
ohair@478 | 712 | -e 's/^[ \t]*//;s/[ \t]*$//' \ |
ohair@478 | 713 | -e 's/\\=/=/' | LANG=C $SORT > $OTHER_FILE.cleaned |
ohair@478 | 714 | TMP=$(LANG=C $DIFF $OTHER_FILE.cleaned $THIS_FILE) |
ohair@478 | 715 | fi |
ohair@478 | 716 | if test -n "$TMP"; then |
ohair@478 | 717 | echo Files $OTHER_FILE and $THIS_FILE differ |
ohair@478 | 718 | return 1 |
ohair@478 | 719 | fi |
ohair@478 | 720 | |
ohair@478 | 721 | return 0 |
ohair@478 | 722 | } |
ohair@478 | 723 | |
ohair@478 | 724 | ########################################################################################## |
ohair@478 | 725 | # Compare directory structure |
ohair@478 | 726 | |
ohair@478 | 727 | compare_dirs() { |
ohair@478 | 728 | THIS_DIR=$1 |
ohair@478 | 729 | OTHER_DIR=$2 |
ohair@478 | 730 | WORK_DIR=$3 |
ohair@478 | 731 | |
ohair@478 | 732 | mkdir -p $WORK_DIR |
ohair@478 | 733 | |
ohair@478 | 734 | (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/other_dirs) |
ohair@478 | 735 | (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/this_dirs) |
ohair@478 | 736 | |
ohair@478 | 737 | echo -n Directory structure... |
ohair@478 | 738 | if $DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs > /dev/null; then |
ohair@478 | 739 | echo Identical! |
ohair@478 | 740 | else |
ohair@478 | 741 | echo Differences found. |
ohair@478 | 742 | REGRESSIONS=true |
ohair@478 | 743 | # Differences in directories found. |
ohair@478 | 744 | ONLY_OTHER=$($DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs | $GREP '<') |
ohair@478 | 745 | if [ "$ONLY_OTHER" ]; then |
ohair@478 | 746 | echo Only in $OTHER |
ohair@478 | 747 | echo $ONLY_OTHER | $SED 's|< ./|\t|g' | $SED 's/ /\n/g' |
ohair@478 | 748 | fi |
ohair@478 | 749 | # Differences in directories found. |
ohair@478 | 750 | ONLY_THIS=$($DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs | $GREP '>') |
ohair@478 | 751 | if [ "$ONLY_THIS" ]; then |
ohair@478 | 752 | echo Only in $THIS |
ohair@478 | 753 | echo $ONLY_THIS | $SED 's|> ./|\t|g' | $SED 's/ /\n/g' |
ohair@478 | 754 | fi |
ohair@478 | 755 | fi |
ohair@478 | 756 | } |
ohair@478 | 757 | |
ohair@478 | 758 | |
ohair@478 | 759 | ########################################################################################## |
ohair@478 | 760 | # Compare file structure |
ohair@478 | 761 | |
ohair@478 | 762 | compare_files() { |
ohair@478 | 763 | THIS_DIR=$1 |
ohair@478 | 764 | OTHER_DIR=$2 |
ohair@478 | 765 | WORK_DIR=$3 |
ohair@478 | 766 | |
ohair@478 | 767 | mkdir -p $WORK_DIR |
ohair@478 | 768 | |
ohair@478 | 769 | (cd $OTHER_DIR && $FIND . -type f | $SORT > $WORK_DIR/other_files) |
ohair@478 | 770 | (cd $THIS_DIR && $FIND . -type f | $SORT > $WORK_DIR/this_files) |
ohair@478 | 771 | |
ohair@478 | 772 | echo -n File names... |
ohair@478 | 773 | if diff $WORK_DIR/other_files $WORK_DIR/this_files > /dev/null; then |
ohair@478 | 774 | echo Identical! |
ohair@478 | 775 | else |
ohair@478 | 776 | echo Differences found. |
ohair@478 | 777 | REGRESSIONS=true |
ohair@478 | 778 | # Differences in directories found. |
ohair@478 | 779 | ONLY_OTHER=$(diff $WORK_DIR/other_files $WORK_DIR/this_files | $GREP '<') |
ohair@478 | 780 | if [ "$ONLY_OTHER" ]; then |
ohair@478 | 781 | echo Only in $OTHER |
ohair@478 | 782 | echo "$ONLY_OTHER" | sed 's|< ./| |g' |
ohair@478 | 783 | fi |
ohair@478 | 784 | # Differences in directories found. |
ohair@478 | 785 | ONLY_THIS=$(diff $WORK_DIR/other_files $WORK_DIR/this_files | $GREP '>') |
ohair@478 | 786 | if [ "$ONLY_THIS" ]; then |
ohair@478 | 787 | echo Only in $THIS |
ohair@478 | 788 | echo "$ONLY_THIS" | sed 's|> ./| |g' |
ohair@478 | 789 | fi |
ohair@478 | 790 | fi |
ohair@478 | 791 | } |
ohair@478 | 792 | |
ohair@478 | 793 | |
ohair@478 | 794 | ########################################################################################## |
ohair@478 | 795 | # Compare permissions |
ohair@478 | 796 | |
ohair@478 | 797 | compare_permissions() { |
ohair@478 | 798 | THIS_DIR=$1 |
ohair@478 | 799 | OTHER_DIR=$2 |
ohair@478 | 800 | WORK_DIR=$3 |
ohair@478 | 801 | |
ohair@478 | 802 | mkdir -p $WORK_DIR |
ohair@478 | 803 | |
ohair@478 | 804 | echo -n Permissions... |
ohair@478 | 805 | found="" |
ohair@478 | 806 | for f in `cd $OTHER_DIR && $FIND . -type f` |
ohair@478 | 807 | do |
ohair@478 | 808 | if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi |
ohair@478 | 809 | if [ ! -f ${THIS_DIR}/$f ]; then continue; fi |
ohair@478 | 810 | OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'` |
ohair@478 | 811 | TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'` |
ohair@478 | 812 | if [ "$OP" != "$TP" ] |
ohair@478 | 813 | then |
ohair@478 | 814 | if [ -z "$found" ]; then echo ; found="yes"; fi |
ohair@478 | 815 | $PRINTF "\told: ${OP} new: ${TP}\t$f\n" |
ohair@478 | 816 | fi |
ohair@478 | 817 | done |
ohair@478 | 818 | if [ -z "$found" ]; then |
ohair@478 | 819 | echo "Identical!" |
ohair@478 | 820 | else |
ohair@478 | 821 | REGRESSIONS=true |
ohair@478 | 822 | fi |
ohair@478 | 823 | } |
ohair@478 | 824 | |
ohair@478 | 825 | ########################################################################################## |
ohair@478 | 826 | # Compare file command output |
ohair@478 | 827 | |
ohair@478 | 828 | compare_file_types() { |
ohair@478 | 829 | THIS_DIR=$1 |
ohair@478 | 830 | OTHER_DIR=$2 |
ohair@478 | 831 | WORK_DIR=$3 |
ohair@478 | 832 | |
ohair@478 | 833 | $MKDIR -p $WORK_DIR |
ohair@478 | 834 | |
ohair@478 | 835 | echo -n File types... |
ohair@478 | 836 | found="" |
ohair@478 | 837 | for f in `cd $OTHER_DIR && $FIND . -type f` |
ohair@478 | 838 | do |
ohair@478 | 839 | if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi |
ohair@478 | 840 | if [ ! -f ${THIS_DIR}/$f ]; then continue; fi |
ohair@478 | 841 | OF=`cd ${OTHER_DIR} && $FILE $f` |
ohair@478 | 842 | TF=`cd ${THIS_DIR} && $FILE $f` |
ohair@478 | 843 | if [ "$f" = "./src.zip" ] || [ "$f" = "./jre/lib/JObjC.jar" ] || [ "$f" = "./lib/JObjC.jar" ] |
ohair@478 | 844 | then |
ohair@478 | 845 | if [ "`echo $OF | $GREP -ic zip`" -gt 0 -a "`echo $TF | $GREP -ic zip`" -gt 0 ] |
ohair@478 | 846 | then |
ohair@478 | 847 | # the way we produces zip-files make it so that directories are stored in old file |
ohair@478 | 848 | # but not in new (only files with full-path) |
ohair@478 | 849 | # this makes file-5.09 report them as different |
ohair@478 | 850 | continue; |
ohair@478 | 851 | fi |
ohair@478 | 852 | fi |
ohair@478 | 853 | |
ohair@478 | 854 | if [ "$OF" != "$TF" ] |
ohair@478 | 855 | then |
ohair@478 | 856 | if [ -z "$found" ]; then echo ; found="yes"; fi |
ohair@478 | 857 | $PRINTF "\tother: ${OF}\n\tthis : ${TF}\n" |
ohair@478 | 858 | fi |
ohair@478 | 859 | done |
ohair@478 | 860 | if [ -z "$found" ]; then |
ohair@478 | 861 | echo "Identical!" |
ohair@478 | 862 | else |
ohair@478 | 863 | REGRESSIONS=true |
ohair@478 | 864 | fi |
ohair@478 | 865 | } |
ohair@478 | 866 | |
ohair@478 | 867 | ########################################################################################## |
ohair@478 | 868 | # Compare the rest of the files |
ohair@478 | 869 | |
ohair@478 | 870 | compare_general_files() { |
ohair@478 | 871 | THIS_DIR=$1 |
ohair@478 | 872 | OTHER_DIR=$2 |
ohair@478 | 873 | WORK_DIR=$3 |
ohair@478 | 874 | |
ohair@478 | 875 | GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \ |
ohair@478 | 876 | ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \ |
ohair@478 | 877 | ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \ |
ohair@478 | 878 | ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \ |
ohair@478 | 879 | ! -name "*.lib" \ |
ohair@478 | 880 | | $GREP -v "./bin/" | $SORT | $FILTER) |
ohair@478 | 881 | |
ohair@478 | 882 | echo General files... |
ohair@478 | 883 | for f in $GENERAL_FILES |
ohair@478 | 884 | do |
ohair@478 | 885 | if [ -e $OTHER_DIR/$f ]; then |
ohair@478 | 886 | DIFF_OUT=$($DIFF $OTHER_DIR/$f $THIS_DIR/$f 2>&1) |
ohair@478 | 887 | if [ -n "$DIFF_OUT" ]; then |
ohair@478 | 888 | echo $f |
ohair@478 | 889 | REGRESSIONS=true |
ohair@478 | 890 | if [ "$SHOW_DIFFS" = "true" ]; then |
ohair@478 | 891 | echo "$DIFF_OUT" |
ohair@478 | 892 | fi |
ohair@478 | 893 | fi |
ohair@478 | 894 | fi |
ohair@478 | 895 | done |
ohair@478 | 896 | |
ohair@478 | 897 | |
ohair@478 | 898 | } |
ohair@478 | 899 | |
ohair@478 | 900 | ########################################################################################## |
ohair@478 | 901 | # Compare zip file |
ohair@478 | 902 | |
ohair@478 | 903 | compare_zip_file() { |
ohair@478 | 904 | THIS_DIR=$1 |
ohair@478 | 905 | OTHER_DIR=$2 |
ohair@478 | 906 | WORK_DIR=$3 |
ohair@478 | 907 | ZIP_FILE=$4 |
ohair@478 | 908 | |
ohair@478 | 909 | THIS_ZIP=$THIS_DIR/$ZIP_FILE |
ohair@478 | 910 | OTHER_ZIP=$OTHER_DIR/$ZIP_FILE |
ohair@478 | 911 | |
ohair@478 | 912 | THIS_SUFFIX="${THIS_ZIP##*.}" |
ohair@478 | 913 | OTHER_SUFFIX="${OTHER_ZIP##*.}" |
ohair@478 | 914 | if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then |
ohair@478 | 915 | echo The files do not have the same suffix type! |
ohair@478 | 916 | return 2 |
ohair@478 | 917 | fi |
ohair@478 | 918 | |
ohair@478 | 919 | UNARCHIVE="$UNZIP -q" |
ohair@478 | 920 | |
ohair@478 | 921 | TYPE="$THIS_SUFFIX" |
ohair@478 | 922 | |
ohair@478 | 923 | if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null |
ohair@478 | 924 | then |
ohair@478 | 925 | return 0 |
ohair@478 | 926 | fi |
ohair@478 | 927 | # Not quite identical, the might still contain the same data. |
ohair@478 | 928 | # Unpack the jar/zip files in temp dirs |
ohair@478 | 929 | |
ohair@478 | 930 | THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this |
ohair@478 | 931 | OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other |
ohair@478 | 932 | $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR |
ohair@478 | 933 | $MKDIR -p $THIS_UNZIPDIR |
ohair@478 | 934 | $MKDIR -p $OTHER_UNZIPDIR |
ohair@478 | 935 | (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP) |
ohair@478 | 936 | (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP) |
ohair@478 | 937 | |
ohair@478 | 938 | CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff |
ohair@478 | 939 | LANG=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE |
ohair@478 | 940 | |
ohair@478 | 941 | ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE) |
ohair@478 | 942 | ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE) |
ohair@478 | 943 | |
ohair@478 | 944 | return_value=0 |
ohair@478 | 945 | |
ohair@478 | 946 | if [ -n "$ONLY_OTHER" ]; then |
ohair@478 | 947 | echo " Only OTHER $ZIP_FILE contains:" |
ohair@478 | 948 | echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g' |
ohair@478 | 949 | return_value=1 |
ohair@478 | 950 | fi |
ohair@478 | 951 | |
ohair@478 | 952 | if [ -n "$ONLY_THIS" ]; then |
ohair@478 | 953 | echo " Only THIS $ZIP_FILE contains:" |
ohair@478 | 954 | echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g' |
ohair@478 | 955 | return_value=1 |
ohair@478 | 956 | fi |
ohair@478 | 957 | |
ohair@478 | 958 | DIFFING_FILES=$($GREP differ $CONTENTS_DIFF_FILE | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") |
ohair@478 | 959 | |
ohair@478 | 960 | $RM -f $WORK_DIR/$ZIP_FILE.diffs |
ohair@478 | 961 | for file in $DIFFING_FILES; do |
ohair@478 | 962 | if [[ "$ACCEPTED_JARZIP_CONTENTS" != *"$file"* ]]; then |
ohair@478 | 963 | diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs |
ohair@478 | 964 | fi |
ohair@478 | 965 | done |
ohair@478 | 966 | |
ohair@478 | 967 | if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then |
ohair@478 | 968 | return_value=1 |
ohair@478 | 969 | echo " Differing files in $ZIP_FILE" |
ohair@478 | 970 | $CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP differ | cut -f 2 -d ' ' | \ |
ohair@478 | 971 | $SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist |
ohair@478 | 972 | $CAT $WORK_DIR/$ZIP_FILE.difflist |
ohair@478 | 973 | |
ohair@478 | 974 | if [ -n "$SHOW_DIFFS" ]; then |
ohair@478 | 975 | for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do |
ohair@478 | 976 | if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then |
ohair@478 | 977 | LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap |
ohair@478 | 978 | elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then |
ohair@478 | 979 | LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i |
ohair@478 | 980 | else |
ohair@478 | 981 | LANG=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i |
ohair@478 | 982 | fi |
ohair@478 | 983 | done |
ohair@478 | 984 | fi |
ohair@478 | 985 | fi |
ohair@478 | 986 | |
ohair@478 | 987 | return $return_value |
ohair@478 | 988 | } |
ohair@478 | 989 | |
ohair@478 | 990 | |
ohair@478 | 991 | ########################################################################################## |
ohair@478 | 992 | # Compare all zip files |
ohair@478 | 993 | |
ohair@478 | 994 | compare_all_zip_files() { |
ohair@478 | 995 | THIS_DIR=$1 |
ohair@478 | 996 | OTHER_DIR=$2 |
ohair@478 | 997 | WORK_DIR=$3 |
ohair@478 | 998 | |
ohair@478 | 999 | ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER ) |
ohair@478 | 1000 | |
ohair@478 | 1001 | if [ -n "$ZIPS" ]; then |
ohair@478 | 1002 | echo Zip files... |
ohair@478 | 1003 | |
ohair@478 | 1004 | return_value=0 |
ohair@478 | 1005 | for f in $ZIPS; do |
ohair@478 | 1006 | if [ -f "$OTHER_DIR/$f" ]; then |
ohair@478 | 1007 | compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f |
ohair@478 | 1008 | if [ "$?" != "0" ]; then |
ohair@478 | 1009 | return_value=1 |
ohair@478 | 1010 | REGRESSIONS=true |
ohair@478 | 1011 | fi |
ohair@478 | 1012 | fi |
ohair@478 | 1013 | done |
ohair@478 | 1014 | fi |
ohair@478 | 1015 | |
ohair@478 | 1016 | return $return_value |
ohair@478 | 1017 | } |
ohair@478 | 1018 | |
ohair@478 | 1019 | ########################################################################################## |
ohair@478 | 1020 | # Compare all jar files |
ohair@478 | 1021 | |
ohair@478 | 1022 | compare_all_jar_files() { |
ohair@478 | 1023 | THIS_DIR=$1 |
ohair@478 | 1024 | OTHER_DIR=$2 |
ohair@478 | 1025 | WORK_DIR=$3 |
ohair@478 | 1026 | |
ohair@478 | 1027 | # TODO filter? |
ohair@478 | 1028 | ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" | $SORT | $FILTER) |
ohair@478 | 1029 | |
ohair@478 | 1030 | if [ -n "$ZIPS" ]; then |
ohair@478 | 1031 | echo Jar files... |
ohair@478 | 1032 | |
ohair@478 | 1033 | return_value=0 |
ohair@478 | 1034 | for f in $ZIPS; do |
ohair@478 | 1035 | if [ -f "$OTHER_DIR/$f" ]; then |
ohair@478 | 1036 | compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f |
ohair@478 | 1037 | if [ "$?" != "0" ]; then |
ohair@478 | 1038 | return_value=1 |
ohair@478 | 1039 | REGRESSIONS=true |
ohair@478 | 1040 | fi |
ohair@478 | 1041 | fi |
ohair@478 | 1042 | done |
ohair@478 | 1043 | fi |
ohair@478 | 1044 | |
ohair@478 | 1045 | return $return_value |
ohair@478 | 1046 | } |
ohair@478 | 1047 | |
ohair@478 | 1048 | ########################################################################################## |
ohair@478 | 1049 | # Compare binary (executable/library) file |
ohair@478 | 1050 | |
ohair@478 | 1051 | compare_bin_file() { |
ohair@478 | 1052 | THIS_DIR=$1 |
ohair@478 | 1053 | OTHER_DIR=$2 |
ohair@478 | 1054 | WORK_DIR=$3 |
ohair@478 | 1055 | BIN_FILE=$4 |
ohair@478 | 1056 | |
ohair@478 | 1057 | THIS_FILE=$THIS_DIR/$BIN_FILE |
ohair@478 | 1058 | OTHER_FILE=$OTHER_DIR/$BIN_FILE |
ohair@478 | 1059 | NAME=$(basename $BIN_FILE) |
ohair@478 | 1060 | WORK_FILE_BASE=$WORK_DIR/$BIN_FILE |
ohair@478 | 1061 | FILE_WORK_DIR=$(dirname $WORK_FILE_BASE) |
ohair@478 | 1062 | |
ohair@478 | 1063 | $MKDIR -p $FILE_WORK_DIR |
ohair@478 | 1064 | |
ohair@478 | 1065 | ORIG_THIS_FILE="$THIS_FILE" |
ohair@478 | 1066 | ORIG_OTHER_FILE="$OTHER_FILE" |
ohair@478 | 1067 | |
ohair@478 | 1068 | if [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then |
ohair@478 | 1069 | THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME |
ohair@478 | 1070 | OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME |
ohair@478 | 1071 | $MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other |
ohair@478 | 1072 | $CP $THIS_FILE $THIS_STRIPPED_FILE |
ohair@478 | 1073 | $CP $OTHER_FILE $OTHER_STRIPPED_FILE |
ohair@478 | 1074 | $STRIP $THIS_STRIPPED_FILE |
ohair@478 | 1075 | $STRIP $OTHER_STRIPPED_FILE |
ohair@478 | 1076 | THIS_FILE="$THIS_STRIPPED_FILE" |
ohair@478 | 1077 | OTHER_FILE="$OTHER_STRIPPED_FILE" |
ohair@478 | 1078 | fi |
ohair@478 | 1079 | |
ohair@478 | 1080 | if [ -z "$SKIP_BIN_DIFF" ]; then |
ohair@478 | 1081 | if cmp $OTHER_FILE $THIS_FILE > /dev/null; then |
ohair@478 | 1082 | # The files were bytewise identical. |
ohair@478 | 1083 | if [ -n "$VERBOSE" ]; then |
ohair@478 | 1084 | echo " : : : : : $BIN_FILE" |
ohair@478 | 1085 | fi |
ohair@478 | 1086 | return 0 |
ohair@478 | 1087 | fi |
ohair@478 | 1088 | BIN_MSG=" diff " |
ohair@478 | 1089 | if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1090 | DIFF_BIN=true |
ohair@478 | 1091 | if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1092 | BIN_MSG="*$BIN_MSG*" |
ohair@478 | 1093 | REGRESSIONS=true |
ohair@478 | 1094 | else |
ohair@478 | 1095 | BIN_MSG=" $BIN_MSG " |
ohair@478 | 1096 | fi |
ohair@478 | 1097 | else |
ohair@478 | 1098 | BIN_MSG="($BIN_MSG)" |
ohair@478 | 1099 | DIFF_BIN= |
ohair@478 | 1100 | fi |
ohair@478 | 1101 | fi |
ohair@478 | 1102 | |
ohair@478 | 1103 | THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }') |
ohair@478 | 1104 | OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }') |
ohair@478 | 1105 | if [ $THIS_SIZE -ne $OTHER_SIZE ]; then |
ohair@478 | 1106 | DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE) |
ohair@478 | 1107 | DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE) |
ohair@478 | 1108 | SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM) |
ohair@478 | 1109 | if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] && [ "$DIFF_SIZE_REL" -lt 102 ]; then |
ohair@478 | 1110 | SIZE_MSG="($SIZE_MSG)" |
ohair@478 | 1111 | DIFF_SIZE= |
ohair@478 | 1112 | else |
ohair@478 | 1113 | if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1114 | DIFF_SIZE=true |
ohair@478 | 1115 | if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1116 | SIZE_MSG="*$SIZE_MSG*" |
ohair@478 | 1117 | REGRESSIONS=true |
ohair@478 | 1118 | else |
ohair@478 | 1119 | SIZE_MSG=" $SIZE_MSG " |
ohair@478 | 1120 | fi |
ohair@478 | 1121 | else |
ohair@478 | 1122 | SIZE_MSG="($SIZE_MSG)" |
ohair@478 | 1123 | DIFF_SIZE= |
ohair@478 | 1124 | fi |
ohair@478 | 1125 | fi |
ohair@478 | 1126 | else |
ohair@478 | 1127 | SIZE_MSG=" " |
ohair@478 | 1128 | DIFF_SIZE= |
ohair@478 | 1129 | if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then |
ohair@478 | 1130 | SIZE_MSG=" ! " |
ohair@478 | 1131 | fi |
ohair@478 | 1132 | fi |
ohair@478 | 1133 | |
ohair@478 | 1134 | if [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then |
ohair@478 | 1135 | SYM_SORT_CMD="sort" |
ohair@478 | 1136 | else |
ohair@478 | 1137 | SYM_SORT_CMD="cat" |
ohair@478 | 1138 | fi |
ohair@478 | 1139 | |
ohair@478 | 1140 | # Check symbols |
ohair@478 | 1141 | if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
ohair@478 | 1142 | $DUMPBIN -exports $OTHER_FILE | $GREP " = " | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other |
ohair@478 | 1143 | $DUMPBIN -exports $THIS_FILE | $GREP " = " | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this |
ohair@478 | 1144 | elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then |
ohair@478 | 1145 | # Some symbols get seemingly random 15 character prefixes. Filter them out. |
ohair@478 | 1146 | $NM -a $ORIG_OTHER_FILE | $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 |
ohair@478 | 1147 | $NM -a $ORIG_THIS_FILE | $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 |
ohair@478 | 1148 | else |
ohair@478 | 1149 | $NM -a $ORIG_OTHER_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other |
ohair@478 | 1150 | $NM -a $ORIG_THIS_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this |
ohair@478 | 1151 | fi |
ohair@478 | 1152 | |
ohair@478 | 1153 | LANG=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff |
ohair@478 | 1154 | if [ -s $WORK_FILE_BASE.symbols.diff ]; then |
ohair@478 | 1155 | SYM_MSG=" diff " |
ohair@478 | 1156 | if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1157 | DIFF_SYM=true |
ohair@478 | 1158 | if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1159 | SYM_MSG="*$SYM_MSG*" |
ohair@478 | 1160 | REGRESSIONS=true |
ohair@478 | 1161 | else |
ohair@478 | 1162 | SYM_MSG=" $SYM_MSG " |
ohair@478 | 1163 | fi |
ohair@478 | 1164 | else |
ohair@478 | 1165 | SYM_MSG="($SYM_MSG)" |
ohair@478 | 1166 | DIFF_SYM= |
ohair@478 | 1167 | fi |
ohair@478 | 1168 | else |
ohair@478 | 1169 | SYM_MSG=" " |
ohair@478 | 1170 | DIFF_SYM= |
ohair@478 | 1171 | if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then |
ohair@478 | 1172 | SYM_MSG=" ! " |
ohair@478 | 1173 | fi |
ohair@478 | 1174 | fi |
ohair@478 | 1175 | |
ohair@478 | 1176 | # Check dependencies |
ohair@478 | 1177 | if [ -n "$LDD_CMD" ];then |
ohair@478 | 1178 | (cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq) |
ohair@478 | 1179 | (cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq) |
ohair@478 | 1180 | (cd $FILE_WORK_DIR && $RM -f $NAME) |
ohair@478 | 1181 | |
ohair@478 | 1182 | LANG=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff |
ohair@478 | 1183 | LANG=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq |
ohair@478 | 1184 | |
ohair@478 | 1185 | if [ -s $WORK_FILE_BASE.deps.diff ]; then |
ohair@478 | 1186 | if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then |
ohair@478 | 1187 | DEP_MSG=" diff " |
ohair@478 | 1188 | else |
ohair@478 | 1189 | DEP_MSG=" redun " |
ohair@478 | 1190 | fi |
ohair@478 | 1191 | if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1192 | DIFF_DEP=true |
ohair@478 | 1193 | if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1194 | DEP_MSG="*$DEP_MSG*" |
ohair@478 | 1195 | REGRESSIONS=true |
ohair@478 | 1196 | else |
ohair@478 | 1197 | DEP_MSG=" $DEP_MSG " |
ohair@478 | 1198 | fi |
ohair@478 | 1199 | else |
ohair@478 | 1200 | DEP_MSG="($DEP_MSG)" |
ohair@478 | 1201 | DIFF_DEP= |
ohair@478 | 1202 | fi |
ohair@478 | 1203 | else |
ohair@478 | 1204 | DEP_MSG=" " |
ohair@478 | 1205 | DIFF_DEP= |
ohair@478 | 1206 | if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then |
ohair@478 | 1207 | DEP_MSG=" ! " |
ohair@478 | 1208 | fi |
ohair@478 | 1209 | fi |
ohair@478 | 1210 | fi |
ohair@478 | 1211 | |
ohair@478 | 1212 | # Compare readelf output |
ohair@478 | 1213 | if [ -n "$READELF_CMD" ] && [ -z "$SKIP_ELF_DIFF" ]; then |
ohair@478 | 1214 | $READELF_CMD $OTHER_FILE > $WORK_FILE_BASE.readelf.other 2>&1 |
ohair@478 | 1215 | $READELF_CMD $THIS_FILE > $WORK_FILE_BASE.readelf.this 2>&1 |
ohair@478 | 1216 | |
ohair@478 | 1217 | LANG=C $DIFF $WORK_FILE_BASE.readelf.other $WORK_FILE_BASE.readelf.this > $WORK_FILE_BASE.readelf.diff |
ohair@478 | 1218 | |
ohair@478 | 1219 | if [ -s $WORK_FILE_BASE.readelf.diff ]; then |
ohair@478 | 1220 | ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.readelf.diff | awk '{print $5}') |
ohair@478 | 1221 | ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE) |
ohair@478 | 1222 | if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1223 | DIFF_ELF=true |
ohair@478 | 1224 | if [[ "$KNOWN_ELF_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1225 | ELF_MSG="*$ELF_MSG*" |
ohair@478 | 1226 | REGRESSIONS=true |
ohair@478 | 1227 | else |
ohair@478 | 1228 | ELF_MSG=" $ELF_MSG " |
ohair@478 | 1229 | fi |
ohair@478 | 1230 | else |
ohair@478 | 1231 | ELF_MSG="($ELF_MSG)" |
ohair@478 | 1232 | DIFF_ELF= |
ohair@478 | 1233 | fi |
ohair@478 | 1234 | else |
ohair@478 | 1235 | ELF_MSG=" " |
ohair@478 | 1236 | DIFF_ELF= |
ohair@478 | 1237 | if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then |
ohair@478 | 1238 | ELF_MSG=" ! " |
ohair@478 | 1239 | fi |
ohair@478 | 1240 | fi |
ohair@478 | 1241 | fi |
ohair@478 | 1242 | |
ohair@478 | 1243 | # Compare disassemble output |
ohair@478 | 1244 | if [ -f "$OBJDUMP" ] && [ -z "$SKIP_DIS_DIFF" ]; then |
ohair@478 | 1245 | $OBJDUMP -d $OTHER_FILE | $GREP -v $NAME > $WORK_FILE_BASE.dis.other 2>&1 |
ohair@478 | 1246 | $OBJDUMP -d $THIS_FILE | $GREP -v $NAME > $WORK_FILE_BASE.dis.this 2>&1 |
ohair@478 | 1247 | |
ohair@478 | 1248 | LANG=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff |
ohair@478 | 1249 | |
ohair@478 | 1250 | if [ -s $WORK_FILE_BASE.dis.diff ]; then |
ohair@478 | 1251 | DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}') |
ohair@478 | 1252 | DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE) |
ohair@478 | 1253 | if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1254 | DIFF_DIS=true |
ohair@478 | 1255 | if [[ "$KNOWN_DIS_DIFF" != *"$BIN_FILE"* ]]; then |
ohair@478 | 1256 | DIS_MSG="*$DIS_MSG*" |
ohair@478 | 1257 | REGRESSIONS=true |
ohair@478 | 1258 | else |
ohair@478 | 1259 | DIS_MSG=" $DIS_MSG " |
ohair@478 | 1260 | fi |
ohair@478 | 1261 | else |
ohair@478 | 1262 | DIS_MSG="($DIS_MSG)" |
ohair@478 | 1263 | DIFF_DIS= |
ohair@478 | 1264 | fi |
ohair@478 | 1265 | else |
ohair@478 | 1266 | DIS_MSG=" " |
ohair@478 | 1267 | DIFF_DIS= |
ohair@478 | 1268 | if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then |
ohair@478 | 1269 | DIS_MSG=" ! " |
ohair@478 | 1270 | fi |
ohair@478 | 1271 | fi |
ohair@478 | 1272 | fi |
ohair@478 | 1273 | |
ohair@478 | 1274 | |
ohair@478 | 1275 | if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_ELF$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then |
ohair@478 | 1276 | if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi |
ohair@478 | 1277 | if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi |
ohair@478 | 1278 | if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi |
ohair@478 | 1279 | if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi |
ohair@478 | 1280 | if [ -n "$ELF_MSG" ]; then echo -n "$ELF_MSG:"; fi |
ohair@478 | 1281 | if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi |
ohair@478 | 1282 | echo " $BIN_FILE" |
ohair@478 | 1283 | if [ "$SHOW_DIFFS" = "true" ]; then |
ohair@478 | 1284 | if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then |
ohair@478 | 1285 | echo "Symbols diff:" |
ohair@478 | 1286 | $CAT $WORK_FILE_BASE.symbols.diff |
ohair@478 | 1287 | fi |
ohair@478 | 1288 | if [ -s "$WORK_FILE_BASE.deps.diff" ]; then |
ohair@478 | 1289 | echo "Deps diff:" |
ohair@478 | 1290 | $CAT $WORK_FILE_BASE.deps.diff |
ohair@478 | 1291 | fi |
ohair@478 | 1292 | if [ -s "$WORK_FILE_BASE.readelf.diff" ]; then |
ohair@478 | 1293 | echo "Readelf diff:" |
ohair@478 | 1294 | $CAT $WORK_FILE_BASE.readelf.diff |
ohair@478 | 1295 | fi |
ohair@478 | 1296 | if [ -s "$WORK_FILE_BASE.dis.diff" ]; then |
ohair@478 | 1297 | echo "Disassembly diff:" |
ohair@478 | 1298 | $CAT $WORK_FILE_BASE.dis.diff |
ohair@478 | 1299 | fi |
ohair@478 | 1300 | fi |
ohair@478 | 1301 | return 1 |
ohair@478 | 1302 | fi |
ohair@478 | 1303 | return 0 |
ohair@478 | 1304 | } |
ohair@478 | 1305 | |
ohair@478 | 1306 | ########################################################################################## |
ohair@478 | 1307 | # Print binary diff header |
ohair@478 | 1308 | |
ohair@478 | 1309 | print_binary_diff_header() { |
ohair@478 | 1310 | if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi |
ohair@478 | 1311 | if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n " Size :"; fi |
ohair@478 | 1312 | if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi |
ohair@478 | 1313 | if [ -z "$SKIP_DEP_DIFF" ]; then echo -n " Deps :"; fi |
ohair@478 | 1314 | if [ -z "$SKIP_ELF_DIFF" ]; then echo -n " Readelf :"; fi |
ohair@478 | 1315 | if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass :"; fi |
ohair@478 | 1316 | echo |
ohair@478 | 1317 | } |
ohair@478 | 1318 | |
ohair@478 | 1319 | ########################################################################################## |
ohair@478 | 1320 | # Compare all libraries |
ohair@478 | 1321 | |
ohair@478 | 1322 | compare_all_libs() { |
ohair@478 | 1323 | THIS_DIR=$1 |
ohair@478 | 1324 | OTHER_DIR=$2 |
ohair@478 | 1325 | WORK_DIR=$3 |
ohair@478 | 1326 | |
ohair@478 | 1327 | LIBS=$(cd $THIS_DIR && $FIND . -name 'lib*.so' -o -name '*.dylib' -o -name '*.dll' | $SORT | $FILTER) |
ohair@478 | 1328 | |
ohair@478 | 1329 | if [ -n "$LIBS" ]; then |
ohair@478 | 1330 | echo Libraries... |
ohair@478 | 1331 | print_binary_diff_header |
ohair@478 | 1332 | for l in $LIBS; do |
ohair@478 | 1333 | if [ -f "$OTHER_DIR/$l" ]; then |
ohair@478 | 1334 | compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l |
ohair@478 | 1335 | if [ "$?" != "0" ]; then |
ohair@478 | 1336 | return_value=1 |
ohair@478 | 1337 | fi |
ohair@478 | 1338 | fi |
ohair@478 | 1339 | done |
ohair@478 | 1340 | fi |
ohair@478 | 1341 | |
ohair@478 | 1342 | return $return_value |
ohair@478 | 1343 | } |
ohair@478 | 1344 | |
ohair@478 | 1345 | ########################################################################################## |
ohair@478 | 1346 | # Compare all executables |
ohair@478 | 1347 | |
ohair@478 | 1348 | compare_all_execs() { |
ohair@478 | 1349 | THIS_DIR=$1 |
ohair@478 | 1350 | OTHER_DIR=$2 |
ohair@478 | 1351 | WORK_DIR=$3 |
ohair@478 | 1352 | |
ohair@478 | 1353 | if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
ohair@478 | 1354 | EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER) |
ohair@478 | 1355 | else |
ohair@478 | 1356 | EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' \) | $SORT | $FILTER) |
ohair@478 | 1357 | fi |
ohair@478 | 1358 | |
ohair@478 | 1359 | if [ -n "$EXECS" ]; then |
ohair@478 | 1360 | echo Executables... |
ohair@478 | 1361 | print_binary_diff_header |
ohair@478 | 1362 | for e in $EXECS; do |
ohair@478 | 1363 | if [ -f "$OTHER_DIR/$e" ]; then |
ohair@478 | 1364 | compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e |
ohair@478 | 1365 | if [ "$?" != "0" ]; then |
ohair@478 | 1366 | return_value=1 |
ohair@478 | 1367 | fi |
ohair@478 | 1368 | fi |
ohair@478 | 1369 | done |
ohair@478 | 1370 | fi |
ohair@478 | 1371 | |
ohair@478 | 1372 | return $return_value |
ohair@478 | 1373 | } |
ohair@478 | 1374 | |
ohair@478 | 1375 | ########################################################################################## |
ohair@478 | 1376 | # Initiate configuration |
ohair@478 | 1377 | |
ohair@478 | 1378 | COMPARE_ROOT=/tmp/cimages.$USER |
ohair@478 | 1379 | $MKDIR -p $COMPARE_ROOT |
ohair@478 | 1380 | if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
ohair@478 | 1381 | if [ "$(uname -o)" = "Cygwin" ]; then |
ohair@478 | 1382 | COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT) |
ohair@478 | 1383 | fi |
ohair@478 | 1384 | fi |
ohair@478 | 1385 | |
ohair@478 | 1386 | THIS="$( cd "$( dirname "$0" )" && pwd )" |
ohair@478 | 1387 | echo "$THIS" |
ohair@478 | 1388 | THIS_SCRIPT="$0" |
ohair@478 | 1389 | |
ohair@478 | 1390 | if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then |
ohair@478 | 1391 | echo "bash ./compare.sh [OPTIONS] [FILTER]" |
ohair@478 | 1392 | echo "" |
ohair@478 | 1393 | echo "-all Compare all files in all known ways" |
ohair@478 | 1394 | echo "-names Compare the file names and directory structure" |
ohair@478 | 1395 | echo "-perms Compare the permission bits on all files and directories" |
ohair@478 | 1396 | echo "-types Compare the output of the file command on all files" |
ohair@478 | 1397 | echo "-general Compare the files not convered by the specialized comparisons" |
ohair@478 | 1398 | echo "-zips Compare the contents of all zip files" |
ohair@478 | 1399 | echo "-jars Compare the contents of all jar files" |
ohair@478 | 1400 | echo "-libs Compare all native libraries" |
ohair@478 | 1401 | echo "-execs Compare all executables" |
ohair@478 | 1402 | echo "-v Verbose output, does not hide known differences" |
ohair@478 | 1403 | echo "-vv More verbose output, shows diff output of all comparisons" |
ohair@478 | 1404 | echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory" |
ohair@478 | 1405 | echo "" |
ohair@478 | 1406 | echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs" |
ohair@478 | 1407 | echo "Example:" |
ohair@478 | 1408 | echo "bash ./common/bin/compareimages.sh CodePointIM.jar" |
ohair@478 | 1409 | exit 10 |
ohair@478 | 1410 | fi |
ohair@478 | 1411 | |
ohair@478 | 1412 | CMP_NAMES=false |
ohair@478 | 1413 | CMP_PERMS=false |
ohair@478 | 1414 | CMP_TYPES=false |
ohair@478 | 1415 | CMP_GENERAL=false |
ohair@478 | 1416 | CMP_ZIPS=false |
ohair@478 | 1417 | CMP_JARS=false |
ohair@478 | 1418 | CMP_LIBS=false |
ohair@478 | 1419 | CMP_EXECS=false |
ohair@478 | 1420 | |
ohair@478 | 1421 | while [ -n "$1" ]; do |
ohair@478 | 1422 | case "$1" in |
ohair@478 | 1423 | -v) |
ohair@478 | 1424 | VERBOSE=true |
ohair@478 | 1425 | ;; |
ohair@478 | 1426 | -vv) |
ohair@478 | 1427 | VERBOSE=true |
ohair@478 | 1428 | SHOW_DIFFS=true |
ohair@478 | 1429 | ;; |
ohair@478 | 1430 | -o) |
ohair@478 | 1431 | OTHER=$2 |
ohair@478 | 1432 | shift |
ohair@478 | 1433 | ;; |
ohair@478 | 1434 | -all) |
ohair@478 | 1435 | CMP_NAMES=true |
ohair@478 | 1436 | if [ "$OPENJDK_TARGET_OS" != "windows" ]; then |
ohair@478 | 1437 | CMP_PERMS=true |
ohair@478 | 1438 | fi |
ohair@478 | 1439 | CMP_TYPES=true |
ohair@478 | 1440 | CMP_GENERAL=true |
ohair@478 | 1441 | CMP_ZIPS=true |
ohair@478 | 1442 | CMP_JARS=true |
ohair@478 | 1443 | CMP_LIBS=true |
ohair@478 | 1444 | CMP_EXECS=true |
ohair@478 | 1445 | ;; |
ohair@478 | 1446 | -names) |
ohair@478 | 1447 | CMP_NAMES=true |
ohair@478 | 1448 | ;; |
ohair@478 | 1449 | -perms) |
ohair@478 | 1450 | CMP_PERMS=true |
ohair@478 | 1451 | ;; |
ohair@478 | 1452 | -types) |
ohair@478 | 1453 | CMP_TYPES=true |
ohair@478 | 1454 | ;; |
ohair@478 | 1455 | -general) |
ohair@478 | 1456 | CMP_GENERAL=true |
ohair@478 | 1457 | ;; |
ohair@478 | 1458 | -zips) |
ohair@478 | 1459 | CMP_ZIPS=true |
ohair@478 | 1460 | ;; |
ohair@478 | 1461 | -jars) |
ohair@478 | 1462 | CMP_JARS=true |
ohair@478 | 1463 | ;; |
ohair@478 | 1464 | -libs) |
ohair@478 | 1465 | CMP_LIBS=true |
ohair@478 | 1466 | ;; |
ohair@478 | 1467 | -execs) |
ohair@478 | 1468 | CMP_EXECS=true |
ohair@478 | 1469 | ;; |
ohair@478 | 1470 | *) |
ohair@478 | 1471 | CMP_NAMES=false |
ohair@478 | 1472 | CMP_PERMS=false |
ohair@478 | 1473 | CMP_TYPES=false |
ohair@478 | 1474 | CMP_ZIPS=true |
ohair@478 | 1475 | CMP_JARS=true |
ohair@478 | 1476 | CMP_LIBS=true |
ohair@478 | 1477 | CMP_EXECS=true |
ohair@478 | 1478 | |
ohair@478 | 1479 | if [ -z "$FILTER" ]; then |
ohair@478 | 1480 | FILTER="$GREP" |
ohair@478 | 1481 | fi |
ohair@478 | 1482 | FILTER="$FILTER -e $1" |
ohair@478 | 1483 | ;; |
ohair@478 | 1484 | esac |
ohair@478 | 1485 | shift |
ohair@478 | 1486 | done |
ohair@478 | 1487 | |
ohair@478 | 1488 | 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 |
ohair@478 | 1489 | CMP_NAMES=true |
ohair@478 | 1490 | CMP_PERMS=true |
ohair@478 | 1491 | CMP_TYPES=true |
ohair@478 | 1492 | CMP_GENERAL=true |
ohair@478 | 1493 | CMP_ZIPS=true |
ohair@478 | 1494 | CMP_JARS=true |
ohair@478 | 1495 | CMP_LIBS=true |
ohair@478 | 1496 | CMP_EXECS=true |
ohair@478 | 1497 | fi |
ohair@478 | 1498 | |
ohair@478 | 1499 | if [ -z "$FILTER" ]; then |
ohair@478 | 1500 | FILTER="$CAT" |
ohair@478 | 1501 | fi |
ohair@478 | 1502 | |
ohair@478 | 1503 | if [ -z "$OTHER" ]; then |
ohair@478 | 1504 | OTHER="$THIS/../$LEGACY_BUILD_DIR" |
ohair@478 | 1505 | if [ -d "$OTHER" ]; then |
ohair@478 | 1506 | OTHER="$( cd "$OTHER" && pwd )" |
ohair@478 | 1507 | else |
ohair@478 | 1508 | echo "Default old build directory does not exist:" |
ohair@478 | 1509 | echo "$OTHER" |
ohair@478 | 1510 | fi |
ohair@478 | 1511 | echo "Comparing to default old build:" |
ohair@478 | 1512 | echo "$OTHER" |
ohair@478 | 1513 | echo |
ohair@478 | 1514 | else |
ohair@478 | 1515 | echo "Comparing to:" |
ohair@478 | 1516 | echo "$OTHER" |
ohair@478 | 1517 | echo |
ohair@478 | 1518 | fi |
ohair@478 | 1519 | |
ohair@478 | 1520 | if [ ! -d "$OTHER" ]; then |
ohair@478 | 1521 | echo "Other build directory does not exist:" |
ohair@478 | 1522 | echo "$OTHER" |
ohair@478 | 1523 | exit 1; |
ohair@478 | 1524 | fi |
ohair@478 | 1525 | |
ohair@478 | 1526 | # Figure out the layout of the new build. Which kinds of images have been produced |
ohair@478 | 1527 | if [ -d "$THIS/images/j2sdk-image" ]; then |
ohair@478 | 1528 | THIS_J2SDK="$THIS/images/j2sdk-image" |
ohair@478 | 1529 | THIS_J2RE="$THIS/images/j2re-image" |
ohair@478 | 1530 | fi |
ohair@478 | 1531 | if [ -d "$THIS/images/j2sdk-overlay-image" ]; then |
ohair@478 | 1532 | THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image" |
ohair@478 | 1533 | THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image" |
ohair@478 | 1534 | fi |
ohair@478 | 1535 | |
ohair@478 | 1536 | # Figure out the layout of the other build (old or new, normal or overlay image) |
ohair@478 | 1537 | if [ -d "$OTHER/j2sdk-image" ]; then |
ohair@478 | 1538 | if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then |
ohair@478 | 1539 | OTHER_J2SDK="$OTHER/j2sdk-image" |
ohair@478 | 1540 | OTHER_J2RE="$OTHER/j2re-image" |
ohair@478 | 1541 | else |
ohair@478 | 1542 | OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image" |
ohair@478 | 1543 | OTHER_J2RE_OVERLAY="$OTHER/j2re-image" |
ohair@478 | 1544 | fi |
ohair@478 | 1545 | |
ohair@478 | 1546 | fi |
ohair@478 | 1547 | |
ohair@478 | 1548 | if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then |
ohair@478 | 1549 | echo "OTHER build only has an overlay image while this build does not. Nothing to compare!" |
ohair@478 | 1550 | exit 1 |
ohair@478 | 1551 | fi |
ohair@478 | 1552 | |
ohair@478 | 1553 | |
ohair@478 | 1554 | ########################################################################################## |
ohair@478 | 1555 | # Do the work |
ohair@478 | 1556 | |
ohair@478 | 1557 | if [ "$CMP_NAMES" = "true" ]; then |
ohair@478 | 1558 | if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then |
ohair@478 | 1559 | echo -n "J2SDK " |
ohair@478 | 1560 | compare_dirs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1561 | echo -n "J2RE " |
ohair@478 | 1562 | compare_dirs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re |
ohair@478 | 1563 | |
ohair@478 | 1564 | echo -n "J2SDK " |
ohair@478 | 1565 | compare_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1566 | echo -n "J2RE " |
ohair@478 | 1567 | compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re |
ohair@478 | 1568 | fi |
ohair@478 | 1569 | if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then |
ohair@478 | 1570 | echo -n "J2SDK Overlay " |
ohair@478 | 1571 | compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay |
ohair@478 | 1572 | echo -n "J2RE Overlay " |
ohair@478 | 1573 | compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay |
ohair@478 | 1574 | |
ohair@478 | 1575 | echo -n "J2SDK Overlay " |
ohair@478 | 1576 | compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay |
ohair@478 | 1577 | echo -n "J2RE Overlay " |
ohair@478 | 1578 | compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay |
ohair@478 | 1579 | fi |
ohair@478 | 1580 | fi |
ohair@478 | 1581 | |
ohair@478 | 1582 | if [ "$CMP_PERMS" = "true" ]; then |
ohair@478 | 1583 | if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then |
ohair@478 | 1584 | echo -n "J2SDK " |
ohair@478 | 1585 | compare_permissions $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1586 | echo -n "J2RE " |
ohair@478 | 1587 | compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re |
ohair@478 | 1588 | fi |
ohair@478 | 1589 | if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then |
ohair@478 | 1590 | echo -n "J2SDK Overlay " |
ohair@478 | 1591 | compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay |
ohair@478 | 1592 | echo -n "J2RE Overlay " |
ohair@478 | 1593 | compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay |
ohair@478 | 1594 | fi |
ohair@478 | 1595 | fi |
ohair@478 | 1596 | |
ohair@478 | 1597 | if [ "$CMP_TYPES" = "true" ]; then |
ohair@478 | 1598 | if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then |
ohair@478 | 1599 | echo -n "J2SDK " |
ohair@478 | 1600 | compare_file_types $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1601 | echo -n "J2RE " |
ohair@478 | 1602 | compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re |
ohair@478 | 1603 | fi |
ohair@478 | 1604 | if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then |
ohair@478 | 1605 | echo -n "J2SDK Overlay " |
ohair@478 | 1606 | compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay |
ohair@478 | 1607 | echo -n "J2RE Overlay " |
ohair@478 | 1608 | compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay |
ohair@478 | 1609 | fi |
ohair@478 | 1610 | fi |
ohair@478 | 1611 | |
ohair@478 | 1612 | if [ "$CMP_GENERAL" = "true" ]; then |
ohair@478 | 1613 | if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then |
ohair@478 | 1614 | echo -n "J2SDK " |
ohair@478 | 1615 | compare_general_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1616 | echo -n "J2RE " |
ohair@478 | 1617 | compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re |
ohair@478 | 1618 | fi |
ohair@478 | 1619 | if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then |
ohair@478 | 1620 | echo -n "J2SDK Overlay " |
ohair@478 | 1621 | compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay |
ohair@478 | 1622 | echo -n "J2RE Overlay " |
ohair@478 | 1623 | compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay |
ohair@478 | 1624 | fi |
ohair@478 | 1625 | fi |
ohair@478 | 1626 | |
ohair@478 | 1627 | if [ "$CMP_ZIPS" = "true" ]; then |
ohair@478 | 1628 | if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then |
ohair@478 | 1629 | compare_all_zip_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1630 | fi |
ohair@478 | 1631 | fi |
ohair@478 | 1632 | |
ohair@478 | 1633 | if [ "$CMP_JARS" = "true" ]; then |
ohair@478 | 1634 | if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then |
ohair@478 | 1635 | compare_all_jar_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1636 | fi |
ohair@478 | 1637 | fi |
ohair@478 | 1638 | |
ohair@478 | 1639 | if [ "$CMP_LIBS" = "true" ]; then |
ohair@478 | 1640 | if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then |
ohair@478 | 1641 | compare_all_libs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1642 | fi |
ohair@478 | 1643 | if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then |
ohair@478 | 1644 | echo -n "Overlay " |
ohair@478 | 1645 | compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay |
ohair@478 | 1646 | fi |
ohair@478 | 1647 | fi |
ohair@478 | 1648 | |
ohair@478 | 1649 | if [ "$CMP_EXECS" = "true" ]; then |
ohair@478 | 1650 | if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then |
ohair@478 | 1651 | compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk |
ohair@478 | 1652 | fi |
ohair@478 | 1653 | if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then |
ohair@478 | 1654 | echo -n "Overlay " |
ohair@478 | 1655 | compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay |
ohair@478 | 1656 | fi |
ohair@478 | 1657 | fi |
ohair@478 | 1658 | |
ohair@478 | 1659 | echo |
ohair@478 | 1660 | |
ohair@478 | 1661 | if [ -n "$REGRESSIONS" ]; then |
ohair@478 | 1662 | echo "REGRESSIONS FOUND!" |
ohair@478 | 1663 | echo |
ohair@478 | 1664 | exit 1 |
ohair@478 | 1665 | else |
ohair@478 | 1666 | echo "No regressions found" |
ohair@478 | 1667 | echo |
ohair@478 | 1668 | exit 0 |
ohair@478 | 1669 | fi |