common/autoconf/compare.sh.in

changeset 494
e64f2cb57d05
parent 478
2ba6f4da4bf3
child 502
ed9e5635fc80
     1.1 --- a/common/autoconf/compare.sh.in	Wed Oct 24 13:11:42 2012 -0700
     1.2 +++ b/common/autoconf/compare.sh.in	Fri Oct 26 14:29:57 2012 -0700
     1.3 @@ -40,12 +40,12 @@
     1.4  CP="@CP@"
     1.5  CUT="@CUT@"
     1.6  DIFF="@DIFF@"
     1.7 -DUMPBIN="@UNCYGDRIVE@ @DUMPBIN@"
     1.8 +DUMPBIN="@FIXPATH@ @DUMPBIN@"
     1.9  EXPR="@EXPR@"
    1.10  FILE="@FILE@"
    1.11  FIND="@FIND@"
    1.12  GREP="@GREP@"
    1.13 -JAVAP="@UNCYGDRIVE@ @BOOT_JDK@/bin/javap"
    1.14 +JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap"
    1.15  LDD="@LDD@"
    1.16  MKDIR="@MKDIR@"
    1.17  NM="@NM@"
    1.18 @@ -56,6 +56,7 @@
    1.19  RM="@RM@"
    1.20  SED="@SED@"
    1.21  SORT="@SORT@"
    1.22 +STAT="@STAT@"
    1.23  STRIP="@POST_STRIP_CMD@"
    1.24  TEE="@TEE@"
    1.25  UNIQ="@UNIQ@"
    1.26 @@ -63,1607 +64,15 @@
    1.27  
    1.28  SRC_ROOT="@SRC_ROOT@"
    1.29  
    1.30 -if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
    1.31 -    READELF_CMD="otool -v -V -h -X -t -d"
    1.32 -elif [ -n "$READELF" ] && [ "$OPENJDK_TARGET_OS" != "windows" ]; then
    1.33 -    READELF_CMD="$READELF -a"
    1.34 +if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
    1.35 +    PATH="@VS_PATH@"
    1.36  fi
    1.37  
    1.38 -if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
    1.39 -    LDD_CMD="$OTOOL -L"
    1.40 -elif [ -n "$LDD" ]; then
    1.41 -    LDD_CMD="$LDD"
    1.42 -fi
    1.43 -
    1.44 -##########################################################################################
    1.45 -# Diff exceptions
    1.46 -
    1.47 -if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
    1.48 -STRIP_BEFORE_COMPARE="
    1.49 -./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
    1.50 -./demo/jvmti/gctest/lib/libgctest.so
    1.51 -./demo/jvmti/heapTracker/lib/libheapTracker.so
    1.52 -./demo/jvmti/heapViewer/lib/libheapViewer.so
    1.53 -./demo/jvmti/hprof/lib/libhprof.so
    1.54 -./demo/jvmti/minst/lib/libminst.so
    1.55 -./demo/jvmti/mtrace/lib/libmtrace.so
    1.56 -./demo/jvmti/versionCheck/lib/libversionCheck.so
    1.57 -./demo/jvmti/waiters/lib/libwaiters.so
    1.58 -"
    1.59 -
    1.60 -KNOWN_BIN_DIFF="
    1.61 -"
    1.62 -
    1.63 -ACCEPTED_BIN_DIFF="
    1.64 -./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
    1.65 -./demo/jvmti/gctest/lib/libgctest.so
    1.66 -./demo/jvmti/heapTracker/lib/libheapTracker.so
    1.67 -./demo/jvmti/heapViewer/lib/libheapViewer.so
    1.68 -./demo/jvmti/hprof/lib/libhprof.so
    1.69 -./demo/jvmti/minst/lib/libminst.so
    1.70 -./demo/jvmti/mtrace/lib/libmtrace.so
    1.71 -./demo/jvmti/versionCheck/lib/libversionCheck.so
    1.72 -./demo/jvmti/waiters/lib/libwaiters.so
    1.73 -./jre/lib/amd64/libattach.so
    1.74 -./jre/lib/amd64/libdt_socket.so
    1.75 -./jre/lib/amd64/libhprof.so
    1.76 -./jre/lib/amd64/libinstrument.so
    1.77 -./jre/lib/amd64/libjava_crw_demo.so
    1.78 -./jre/lib/amd64/libjsdt.so
    1.79 -./jre/lib/amd64/libjsig.so
    1.80 -./jre/lib/amd64/libmanagement.so
    1.81 -./jre/lib/amd64/libnpt.so
    1.82 -./jre/lib/amd64/libsaproc.so
    1.83 -./jre/lib/amd64/libverify.so
    1.84 -./jre/lib/amd64/server/libjsig.so
    1.85 -./jre/lib/amd64/server/libjvm.so
    1.86 -./bin/appletviewer
    1.87 -./bin/extcheck
    1.88 -./bin/idlj
    1.89 -./bin/jar
    1.90 -./bin/jarsigner
    1.91 -./bin/java
    1.92 -./bin/javac
    1.93 -./bin/javadoc
    1.94 -./bin/javah
    1.95 -./bin/javap
    1.96 -./bin/jcmd
    1.97 -./bin/jconsole
    1.98 -./bin/jdb
    1.99 -./bin/jhat
   1.100 -./bin/jinfo
   1.101 -./bin/jmap
   1.102 -./bin/jps
   1.103 -./bin/jrunscript
   1.104 -./bin/jsadebugd
   1.105 -./bin/jstack
   1.106 -./bin/jstat
   1.107 -./bin/jstatd
   1.108 -./bin/keytool
   1.109 -./bin/native2ascii
   1.110 -./bin/orbd
   1.111 -./bin/pack200
   1.112 -./bin/policytool
   1.113 -./bin/rmic
   1.114 -./bin/rmid
   1.115 -./bin/rmiregistry
   1.116 -./bin/schemagen
   1.117 -./bin/serialver
   1.118 -./bin/servertool
   1.119 -./bin/tnameserv
   1.120 -./bin/wsgen
   1.121 -./bin/wsimport
   1.122 -./bin/xjc
   1.123 -./jre/bin/java
   1.124 -./jre/bin/keytool
   1.125 -./jre/bin/orbd
   1.126 -./jre/bin/pack200
   1.127 -./jre/bin/policytool
   1.128 -./jre/bin/rmid
   1.129 -./jre/bin/rmiregistry
   1.130 -./jre/bin/servertool
   1.131 -./jre/bin/tnameserv
   1.132 -"
   1.133 -
   1.134 -KNOWN_SIZE_DIFF="
   1.135 -"
   1.136 -
   1.137 -KNOWN_SYM_DIFF="
   1.138 -"
   1.139 -
   1.140 -KNOWN_ELF_DIFF="
   1.141 -./demo/jvmti/heapTracker/lib/libheapTracker.so
   1.142 -./demo/jvmti/hprof/lib/libhprof.so
   1.143 -./demo/jvmti/waiters/lib/libwaiters.so
   1.144 -"
   1.145 -fi
   1.146 -
   1.147 -if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86" ]; then
   1.148 -
   1.149 -STRIP_BEFORE_COMPARE="
   1.150 -./demo/jni/Poller/lib/libPoller.so
   1.151 -./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
   1.152 -./demo/jvmti/gctest/lib/libgctest.so
   1.153 -./demo/jvmti/heapTracker/lib/libheapTracker.so
   1.154 -./demo/jvmti/heapViewer/lib/libheapViewer.so
   1.155 -./demo/jvmti/hprof/lib/libhprof.so
   1.156 -./demo/jvmti/minst/lib/libminst.so
   1.157 -./demo/jvmti/mtrace/lib/libmtrace.so
   1.158 -./demo/jvmti/versionCheck/lib/libversionCheck.so
   1.159 -./demo/jvmti/waiters/lib/libwaiters.so
   1.160 -./jre/lib/i386/jexec
   1.161 -"
   1.162 -
   1.163 -SORT_SYMBOLS="
   1.164 -./jre/lib/i386/client/libjvm.so
   1.165 -./jre/lib/i386/server/libjvm.so
   1.166 -"
   1.167 -
   1.168 -SKIP_BIN_DIFF="true"
   1.169 -
   1.170 -ACCEPTED_SMALL_SIZE_DIFF="
   1.171 -./demo/jni/Poller/lib/libPoller.so
   1.172 -./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
   1.173 -./demo/jvmti/gctest/lib/libgctest.so
   1.174 -./demo/jvmti/heapTracker/lib/libheapTracker.so
   1.175 -./demo/jvmti/heapViewer/lib/libheapViewer.so
   1.176 -./demo/jvmti/hprof/lib/libhprof.so
   1.177 -./demo/jvmti/minst/lib/libminst.so
   1.178 -./demo/jvmti/mtrace/lib/libmtrace.so
   1.179 -./demo/jvmti/versionCheck/lib/libversionCheck.so
   1.180 -./demo/jvmti/waiters/lib/libwaiters.so
   1.181 -./jre/lib/i386/client/libjvm.so
   1.182 -./jre/lib/i386/jli/libjli.so
   1.183 -./jre/lib/i386/libJdbcOdbc.so
   1.184 -./jre/lib/i386/libattach.so
   1.185 -./jre/lib/i386/libawt.so
   1.186 -./jre/lib/i386/libawt_headless.so
   1.187 -./jre/lib/i386/libawt_xawt.so
   1.188 -./jre/lib/i386/libdcpr.so
   1.189 -./jre/lib/i386/libdt_socket.so
   1.190 -./jre/lib/i386/libfontmanager.so
   1.191 -./jre/lib/i386/libhprof.so
   1.192 -./jre/lib/i386/libinstrument.so
   1.193 -./jre/lib/i386/libj2gss.so
   1.194 -./jre/lib/i386/libj2pcsc.so
   1.195 -./jre/lib/i386/libj2pkcs11.so
   1.196 -./jre/lib/i386/libj2ucrypto.so
   1.197 -./jre/lib/i386/libjaas_unix.so
   1.198 -./jre/lib/i386/libjava.so
   1.199 -./jre/lib/i386/libjava_crw_demo.so
   1.200 -./jre/lib/i386/libjawt.so
   1.201 -./jre/lib/i386/libjdwp.so
   1.202 -./jre/lib/i386/libjfr.so
   1.203 -./jre/lib/i386/libjpeg.so
   1.204 -./jre/lib/i386/libjsdt.so
   1.205 -./jre/lib/i386/libjsound.so
   1.206 -./jre/lib/i386/libkcms.so
   1.207 -./jre/lib/i386/libmanagement.so
   1.208 -./jre/lib/i386/libmlib_image.so
   1.209 -./jre/lib/i386/libnet.so
   1.210 -./jre/lib/i386/libnio.so
   1.211 -./jre/lib/i386/libnpt.so
   1.212 -./jre/lib/i386/libsctp.so
   1.213 -./jre/lib/i386/libsplashscreen.so
   1.214 -./jre/lib/i386/libsunec.so
   1.215 -./jre/lib/i386/libsunwjdga.so
   1.216 -./jre/lib/i386/libt2k.so
   1.217 -./jre/lib/i386/libunpack.so
   1.218 -./jre/lib/i386/libverify.so
   1.219 -./jre/lib/i386/libzip.so
   1.220 -./jre/lib/i386/server/libjvm.so
   1.221 -./bin/appletviewer
   1.222 -./bin/extcheck
   1.223 -./bin/idlj
   1.224 -./bin/jar
   1.225 -./bin/jarsigner
   1.226 -./bin/java
   1.227 -./bin/javac
   1.228 -./bin/javadoc
   1.229 -./bin/javah
   1.230 -./bin/javap
   1.231 -./bin/jcmd
   1.232 -./bin/jconsole
   1.233 -./bin/jdb
   1.234 -./bin/jhat
   1.235 -./bin/jinfo
   1.236 -./bin/jmap
   1.237 -./bin/jps
   1.238 -./bin/jrunscript
   1.239 -./bin/jsadebugd
   1.240 -./bin/jstack
   1.241 -./bin/jstat
   1.242 -./bin/jstatd
   1.243 -./bin/keytool
   1.244 -./bin/native2ascii
   1.245 -./bin/orbd
   1.246 -./bin/pack200
   1.247 -./bin/policytool
   1.248 -./bin/rmic
   1.249 -./bin/rmid
   1.250 -./bin/rmiregistry
   1.251 -./bin/schemagen
   1.252 -./bin/serialver
   1.253 -./bin/servertool
   1.254 -./bin/tnameserv
   1.255 -./bin/unpack200
   1.256 -./bin/wsgen
   1.257 -./bin/wsimport
   1.258 -./bin/xjc
   1.259 -./jre/bin/java
   1.260 -./jre/bin/keytool
   1.261 -./jre/bin/orbd
   1.262 -./jre/bin/pack200
   1.263 -./jre/bin/policytool
   1.264 -./jre/bin/rmid
   1.265 -./jre/bin/rmiregistry
   1.266 -./jre/bin/servertool
   1.267 -./jre/bin/tnameserv
   1.268 -./jre/bin/unpack200
   1.269 -./jre/lib/i386/jexec
   1.270 -"
   1.271 -
   1.272 -SKIP_ELF_DIFF="true"
   1.273 -
   1.274 -# libjvm.so differs in the random 15 char prefix on some symbols.
   1.275 -ACCEPTED_DIS_DIFF="
   1.276 -./jre/lib/i386/client/libjvm.so
   1.277 -./jre/lib/i386/server/libjvm.so
   1.278 -"
   1.279 -
   1.280 -fi
   1.281 -
   1.282 -if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
   1.283 -
   1.284 -STRIP_BEFORE_COMPARE="
   1.285 -./demo/jni/Poller/lib/amd64/libPoller.so
   1.286 -./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so
   1.287 -./demo/jvmti/gctest/lib/amd64/libgctest.so
   1.288 -./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so
   1.289 -./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so
   1.290 -./demo/jvmti/hprof/lib/amd64/libhprof.so
   1.291 -./demo/jvmti/minst/lib/amd64/libminst.so
   1.292 -./demo/jvmti/mtrace/lib/amd64/libmtrace.so
   1.293 -./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so
   1.294 -./demo/jvmti/waiters/lib/amd64/libwaiters.so
   1.295 -"
   1.296 -
   1.297 -SORT_SYMBOLS="
   1.298 -./jre/lib/amd64/server/libjvm.so
   1.299 -"
   1.300 -
   1.301 -SKIP_BIN_DIFF="true"
   1.302 -
   1.303 -ACCEPTED_SMALL_SIZE_DIFF="
   1.304 -./demo/jni/Poller/lib/amd64/libPoller.so
   1.305 -./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so
   1.306 -./demo/jvmti/gctest/lib/amd64/libgctest.so
   1.307 -./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so
   1.308 -./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so
   1.309 -./demo/jvmti/hprof/lib/amd64/libhprof.so
   1.310 -./demo/jvmti/minst/lib/amd64/libminst.so
   1.311 -./demo/jvmti/mtrace/lib/amd64/libmtrace.so
   1.312 -./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so
   1.313 -./demo/jvmti/waiters/lib/amd64/libwaiters.so
   1.314 -./jre/lib/amd64/jli/libjli.so
   1.315 -./jre/lib/amd64/libJdbcOdbc.so
   1.316 -./jre/lib/amd64/libattach.so
   1.317 -./jre/lib/amd64/libawt.so
   1.318 -./jre/lib/amd64/libawt_headless.so
   1.319 -./jre/lib/amd64/libawt_xawt.so
   1.320 -./jre/lib/amd64/libdcpr.so
   1.321 -./jre/lib/amd64/libdt_socket.so
   1.322 -./jre/lib/amd64/libfontmanager.so
   1.323 -./jre/lib/amd64/libhprof.so
   1.324 -./jre/lib/amd64/libinstrument.so
   1.325 -./jre/lib/amd64/libj2gss.so
   1.326 -./jre/lib/amd64/libj2pcsc.so
   1.327 -./jre/lib/amd64/libj2pkcs11.so
   1.328 -./jre/lib/amd64/libj2ucrypto.so
   1.329 -./jre/lib/amd64/libjaas_unix.so
   1.330 -./jre/lib/amd64/libjava.so
   1.331 -./jre/lib/amd64/libjava_crw_demo.so
   1.332 -./jre/lib/amd64/libjawt.so
   1.333 -./jre/lib/amd64/libjdwp.so
   1.334 -./jre/lib/amd64/libjfr.so
   1.335 -./jre/lib/amd64/libjpeg.so
   1.336 -./jre/lib/amd64/libjsdt.so
   1.337 -./jre/lib/amd64/libjsound.so
   1.338 -./jre/lib/amd64/libkcms.so
   1.339 -./jre/lib/amd64/libmanagement.so
   1.340 -./jre/lib/amd64/libmlib_image.so
   1.341 -./jre/lib/amd64/libnet.so
   1.342 -./jre/lib/amd64/libnio.so
   1.343 -./jre/lib/amd64/libnpt.so
   1.344 -./jre/lib/amd64/libsctp.so
   1.345 -./jre/lib/amd64/libsplashscreen.so
   1.346 -./jre/lib/amd64/libsunec.so
   1.347 -./jre/lib/amd64/libsunwjdga.so
   1.348 -./jre/lib/amd64/libt2k.so
   1.349 -./jre/lib/amd64/libunpack.so
   1.350 -./jre/lib/amd64/libverify.so
   1.351 -./jre/lib/amd64/libzip.so
   1.352 -./jre/lib/amd64/server/64/libjvm_db.so
   1.353 -./jre/lib/amd64/server/64/libjvm_dtrace.so
   1.354 -./bin/amd64/appletviewer
   1.355 -./bin/amd64/extcheck
   1.356 -./bin/amd64/idlj
   1.357 -./bin/amd64/jar
   1.358 -./bin/amd64/jarsigner
   1.359 -./bin/amd64/java
   1.360 -./bin/amd64/javac
   1.361 -./bin/amd64/javadoc
   1.362 -./bin/amd64/javah
   1.363 -./bin/amd64/javap
   1.364 -./bin/amd64/jcmd
   1.365 -./bin/amd64/jconsole
   1.366 -./bin/amd64/jdb
   1.367 -./bin/amd64/jhat
   1.368 -./bin/amd64/jinfo
   1.369 -./bin/amd64/jmap
   1.370 -./bin/amd64/jps
   1.371 -./bin/amd64/jrunscript
   1.372 -./bin/amd64/jsadebugd
   1.373 -./bin/amd64/jstack
   1.374 -./bin/amd64/jstat
   1.375 -./bin/amd64/jstatd
   1.376 -./bin/amd64/keytool
   1.377 -./bin/amd64/native2ascii
   1.378 -./bin/amd64/orbd
   1.379 -./bin/amd64/pack200
   1.380 -./bin/amd64/policytool
   1.381 -./bin/amd64/rmic
   1.382 -./bin/amd64/rmid
   1.383 -./bin/amd64/rmiregistry
   1.384 -./bin/amd64/schemagen
   1.385 -./bin/amd64/serialver
   1.386 -./bin/amd64/servertool
   1.387 -./bin/amd64/tnameserv
   1.388 -./bin/amd64/unpack200
   1.389 -./bin/amd64/wsgen
   1.390 -./bin/amd64/wsimport
   1.391 -./bin/amd64/xjc
   1.392 -./jre/bin/amd64/java
   1.393 -./jre/bin/amd64/keytool
   1.394 -./jre/bin/amd64/orbd
   1.395 -./jre/bin/amd64/pack200
   1.396 -./jre/bin/amd64/policytool
   1.397 -./jre/bin/amd64/rmid
   1.398 -./jre/bin/amd64/rmiregistry
   1.399 -./jre/bin/amd64/servertool
   1.400 -./jre/bin/amd64/tnameserv
   1.401 -./jre/bin/amd64/unpack200
   1.402 -./jre/lib/amd64/jexec
   1.403 -"
   1.404 -
   1.405 -SKIP_ELF_DIFF="true"
   1.406 -
   1.407 -# Can't find an explaination for the diff in libmlib_image.so.
   1.408 -KNOWN_DIS_DIFF="
   1.409 -./jre/lib/amd64/libmlib_image.so
   1.410 -"
   1.411 -# libjvm.so differs in the random 15 char prefix on some symbols.
   1.412 -ACCEPTED_DIS_DIFF="
   1.413 -./jre/lib/amd64/server/libjvm.so
   1.414 -"
   1.415 -
   1.416 -fi
   1.417 -
   1.418 -if [ "$OPENJDK_TARGET_OS" = "windows" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
   1.419 -
   1.420 -ACCEPTED_BIN_DIFF="
   1.421 -./bin/jli.dll
   1.422 -./demo/jvmti/compiledMethodLoad/lib/compiledMethodLoad.dll
   1.423 -./demo/jvmti/gctest/lib/gctest.dll
   1.424 -./demo/jvmti/heapTracker/lib/heapTracker.dll
   1.425 -./demo/jvmti/heapViewer/lib/heapViewer.dll
   1.426 -./demo/jvmti/hprof/lib/hprof.dll
   1.427 -./demo/jvmti/minst/lib/minst.dll
   1.428 -./demo/jvmti/mtrace/lib/mtrace.dll
   1.429 -./demo/jvmti/versionCheck/lib/versionCheck.dll
   1.430 -./demo/jvmti/waiters/lib/waiters.dll
   1.431 -./jre/bin/attach.dll
   1.432 -./jre/bin/awt.dll
   1.433 -./jre/bin/dcpr.dll
   1.434 -./jre/bin/dt_shmem.dll
   1.435 -./jre/bin/dt_socket.dll
   1.436 -./jre/bin/fontmanager.dll
   1.437 -./jre/bin/hprof.dll
   1.438 -./jre/bin/instrument.dll
   1.439 -./jre/bin/j2pcsc.dll
   1.440 -./jre/bin/j2pkcs11.dll
   1.441 -./jre/bin/jaas_nt.dll
   1.442 -./jre/bin/java.dll
   1.443 -./jre/bin/java_crw_demo.dll
   1.444 -./jre/bin/jawt.dll
   1.445 -./jre/bin/JdbcOdbc.dll
   1.446 -./jre/bin/jdwp.dll
   1.447 -./jre/bin/jfr.dll
   1.448 -./jre/bin/jli.dll
   1.449 -./jre/bin/jpeg.dll
   1.450 -./jre/bin/jsdt.dll
   1.451 -./jre/bin/jsound.dll
   1.452 -./jre/bin/jsoundds.dll
   1.453 -./jre/bin/kcms.dll
   1.454 -./jre/bin/management.dll
   1.455 -./jre/bin/mlib_image.dll
   1.456 -./jre/bin/net.dll
   1.457 -./jre/bin/nio.dll
   1.458 -./jre/bin/npt.dll
   1.459 -./jre/bin/sawindbg.dll
   1.460 -./jre/bin/server/jvm.dll
   1.461 -./jre/bin/splashscreen.dll
   1.462 -./jre/bin/sunec.dll
   1.463 -./jre/bin/sunmscapi.dll
   1.464 -./jre/bin/t2k.dll
   1.465 -./jre/bin/unpack.dll
   1.466 -./jre/bin/verify.dll
   1.467 -./jre/bin/w2k_lsa_auth.dll
   1.468 -./jre/bin/zip.dll
   1.469 -./bin/appletviewer.exe
   1.470 -./bin/extcheck.exe
   1.471 -./bin/idlj.exe
   1.472 -./bin/jar.exe
   1.473 -./bin/jarsigner.exe
   1.474 -./bin/java.exe
   1.475 -./bin/javac.exe
   1.476 -./bin/javadoc.exe
   1.477 -./bin/javah.exe
   1.478 -./bin/javap.exe
   1.479 -./bin/java-rmi.exe
   1.480 -./bin/javaw.exe
   1.481 -./bin/jcmd.exe
   1.482 -./bin/jconsole.exe
   1.483 -./bin/jdb.exe
   1.484 -./bin/jhat.exe
   1.485 -./bin/jinfo.exe
   1.486 -./bin/jmap.exe
   1.487 -./bin/jps.exe
   1.488 -./bin/jrunscript.exe
   1.489 -./bin/jsadebugd.exe
   1.490 -./bin/jstack.exe
   1.491 -./bin/jstat.exe
   1.492 -./bin/jstatd.exe
   1.493 -./bin/keytool.exe
   1.494 -./bin/kinit.exe
   1.495 -./bin/klist.exe
   1.496 -./bin/ktab.exe
   1.497 -./bin/native2ascii.exe
   1.498 -./bin/orbd.exe
   1.499 -./bin/pack200.exe
   1.500 -./bin/policytool.exe
   1.501 -./bin/rmic.exe
   1.502 -./bin/rmid.exe
   1.503 -./bin/rmiregistry.exe
   1.504 -./bin/schemagen.exe
   1.505 -./bin/serialver.exe
   1.506 -./bin/servertool.exe
   1.507 -./bin/tnameserv.exe
   1.508 -./bin/unpack200.exe
   1.509 -./bin/wsgen.exe
   1.510 -./bin/wsimport.exe
   1.511 -./bin/xjc.exe
   1.512 -./jre/bin/java.exe
   1.513 -./jre/bin/java-rmi.exe
   1.514 -./jre/bin/javaw.exe
   1.515 -./jre/bin/keytool.exe
   1.516 -./jre/bin/kinit.exe
   1.517 -./jre/bin/klist.exe
   1.518 -./jre/bin/ktab.exe
   1.519 -./jre/bin/orbd.exe
   1.520 -./jre/bin/pack200.exe
   1.521 -./jre/bin/policytool.exe
   1.522 -./jre/bin/rmid.exe
   1.523 -./jre/bin/rmiregistry.exe
   1.524 -./jre/bin/servertool.exe
   1.525 -./jre/bin/tnameserv.exe
   1.526 -./jre/bin/unpack200.exe
   1.527 -"
   1.528 -
   1.529 -KNOWN_SIZE_DIFF="
   1.530 -./demo/jvmti/heapTracker/lib/heapTracker.dll
   1.531 -./demo/jvmti/minst/lib/minst.dll
   1.532 -./jre/bin/awt.dll
   1.533 -./jre/bin/java_crw_demo.dll
   1.534 -./bin/java.exe
   1.535 -./bin/javaw.exe
   1.536 -./bin/unpack200.exe
   1.537 -./jre/bin/java.exe
   1.538 -./jre/bin/javaw.exe
   1.539 -./jre/bin/unpack200.exe
   1.540 -"
   1.541 -
   1.542 -KNOWN_SYM_DIFF="
   1.543 -./jre/bin/awt.dll
   1.544 -./jre/bin/java_crw_demo.dll
   1.545 -"
   1.546 -fi
   1.547 -
   1.548 -
   1.549 -
   1.550 -if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
   1.551 -ACCEPTED_JARZIP_CONTENTS="
   1.552 -/META-INF/INDEX.LIST
   1.553 -"
   1.554 -
   1.555 -KNOWN_BIN_DIFF="
   1.556 -./jre/lib/libJObjC.dylib
   1.557 -./jre/lib/libsaproc.dylib
   1.558 -./jre/lib/server/libjvm.dylib
   1.559 -"
   1.560 -
   1.561 -ACCEPTED_BIN_DIFF="
   1.562 -./bin/appletviewer
   1.563 -./bin/extcheck
   1.564 -./bin/idlj
   1.565 -./bin/jar
   1.566 -./bin/jarsigner
   1.567 -./bin/java
   1.568 -./bin/javac
   1.569 -./bin/javadoc
   1.570 -./bin/javah
   1.571 -./bin/javap
   1.572 -./bin/jcmd
   1.573 -./bin/jconsole
   1.574 -./bin/jdb
   1.575 -./bin/jhat
   1.576 -./bin/jinfo
   1.577 -./bin/jmap
   1.578 -./bin/jps
   1.579 -./bin/jrunscript
   1.580 -./bin/jsadebugd
   1.581 -./bin/jstack
   1.582 -./bin/jstat
   1.583 -./bin/jstatd
   1.584 -./bin/keytool
   1.585 -./bin/native2ascii
   1.586 -./bin/orbd
   1.587 -./bin/pack200
   1.588 -./bin/policytool
   1.589 -./bin/rmic
   1.590 -./bin/rmid
   1.591 -./bin/rmiregistry
   1.592 -./bin/schemagen
   1.593 -./bin/serialver
   1.594 -./bin/servertool
   1.595 -./bin/tnameserv
   1.596 -./bin/wsgen
   1.597 -./bin/wsimport
   1.598 -./bin/xjc
   1.599 -./jre/bin/java
   1.600 -./jre/bin/keytool
   1.601 -./jre/bin/orbd
   1.602 -./jre/bin/pack200
   1.603 -./jre/bin/policytool
   1.604 -./jre/bin/rmid
   1.605 -./jre/bin/rmiregistry
   1.606 -./jre/bin/servertool
   1.607 -./jre/bin/tnameserv
   1.608 -"
   1.609 -
   1.610 -KNOWN_SIZE_DIFF="
   1.611 -./jre/lib/libJObjC.dylib
   1.612 -./jre/lib/server/libjvm.dylib
   1.613 -"
   1.614 -
   1.615 -KNOWN_SYM_DIFF="
   1.616 -./jre/lib/libJObjC.dylib
   1.617 -./jre/lib/server/libjvm.dylib
   1.618 -"
   1.619 -
   1.620 -KNOWN_ELF_DIFF="
   1.621 -./jre/lib/libJObjC.dylib
   1.622 -./jre/lib/server/libjvm.dylib
   1.623 -"
   1.624 -
   1.625 -SKIP_DIS_DIFF="true"
   1.626 -
   1.627 -fi
   1.628 -
   1.629 -##########################################################################################
   1.630 -# Compare text files and ignore specific differences:
   1.631 -#
   1.632 -#  * Timestamps in Java sources generated by idl2java
   1.633 -#  * Sorting order and cleanup style in .properties files
   1.634 -
   1.635 -diff_text() {
   1.636 -    OTHER_FILE=$1
   1.637 -    THIS_FILE=$2
   1.638 -
   1.639 -    SUFFIX="${THIS_FILE##*.}"
   1.640 -
   1.641 -    TMP=1
   1.642 -
   1.643 -    if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then
   1.644 -        TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \
   1.645 -            $GREP '^[<>]' | \
   1.646 -            $SED -e '/[<>] Ant-Version: Apache Ant .*/d' \
   1.647 -	         -e '/[<>] Created-By: .* (Oracle Corporation).*/d')
   1.648 -    fi
   1.649 -    if test "x$SUFFIX" = "xjava"; then
   1.650 -        TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \
   1.651 -            $GREP '^[<>]' | \
   1.652 -            $SED -e '/[<>] \* from.*\.idl/d' \
   1.653 -                 -e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
   1.654 -                 -e '/[<>] \*.*[0-9]\{4\} [0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \
   1.655 -                 -e '/\/\/ Generated from input file.*/d' \
   1.656 -                 -e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \
   1.657 -                 -e '/\/\/ java GenerateCharacter.*/d')
   1.658 -    fi
   1.659 -    # Ignore date strings in class files.
   1.660 -    # On Macosx the system sources for generated java classes produce different output on 
   1.661 -    # consequtive invokations seemingly randomly.
   1.662 -    # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this.
   1.663 -    if test "x$SUFFIX" = "xclass"; then
   1.664 -        $JAVAP -c -constants -l -p ${OTHER_FILE} >  ${OTHER_FILE}.javap
   1.665 -        $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap
   1.666 -        TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
   1.667 -            $GREP '^[<>]' | \
   1.668 -            $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
   1.669 -	         -e '/[<>].*Point   Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \
   1.670 -	         -e '/[<>].*public com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*itemsPtr();/d' \
   1.671 -	         -e '/[<>].*public void setItemsPtr(com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*);/d')
   1.672 -    fi
   1.673 -    if test "x$SUFFIX" = "xproperties"; then
   1.674 -        $CAT $OTHER_FILE | $SED -e 's/\([^\\]\):/\1\\:/g' -e  's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
   1.675 -            | $SED -f "$SRC_ROOT/common/bin/unicode2x.sed" \
   1.676 -  	    | $SED -e '/^#/d' -e '/^$/d' \
   1.677 -            -e :a -e '/\\$/N; s/\\\n//; ta' \
   1.678 -  	    -e 's/^[ \t]*//;s/[ \t]*$//' \
   1.679 -	    -e 's/\\=/=/' | LANG=C $SORT > $OTHER_FILE.cleaned
   1.680 -        TMP=$(LANG=C $DIFF $OTHER_FILE.cleaned $THIS_FILE)
   1.681 -    fi
   1.682 -    if test -n "$TMP"; then
   1.683 -        echo Files $OTHER_FILE and $THIS_FILE differ
   1.684 -        return 1
   1.685 -    fi
   1.686 -
   1.687 -    return 0
   1.688 -}
   1.689 -
   1.690 -##########################################################################################
   1.691 -# Compare directory structure
   1.692 -
   1.693 -compare_dirs() {
   1.694 -    THIS_DIR=$1
   1.695 -    OTHER_DIR=$2
   1.696 -    WORK_DIR=$3
   1.697 -
   1.698 -    mkdir -p $WORK_DIR
   1.699 -
   1.700 -    (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/other_dirs)
   1.701 -    (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/this_dirs)
   1.702 -    
   1.703 -    echo -n Directory structure...
   1.704 -    if $DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs > /dev/null; then
   1.705 -        echo Identical!
   1.706 -    else
   1.707 -        echo Differences found.
   1.708 -        REGRESSIONS=true
   1.709 -    # Differences in directories found.
   1.710 -        ONLY_OTHER=$($DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs | $GREP '<')
   1.711 -        if [ "$ONLY_OTHER" ]; then
   1.712 -            echo Only in $OTHER
   1.713 -            echo $ONLY_OTHER | $SED 's|< ./|\t|g' | $SED 's/ /\n/g'
   1.714 -        fi
   1.715 -    # Differences in directories found.
   1.716 -        ONLY_THIS=$($DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs | $GREP '>')
   1.717 -        if [ "$ONLY_THIS" ]; then
   1.718 -            echo Only in $THIS
   1.719 -            echo $ONLY_THIS | $SED 's|> ./|\t|g' | $SED 's/ /\n/g'
   1.720 -        fi
   1.721 -    fi
   1.722 -}
   1.723 -
   1.724 -
   1.725 -##########################################################################################
   1.726 -# Compare file structure
   1.727 -
   1.728 -compare_files() {
   1.729 -    THIS_DIR=$1
   1.730 -    OTHER_DIR=$2
   1.731 -    WORK_DIR=$3
   1.732 -
   1.733 -    mkdir -p $WORK_DIR
   1.734 -
   1.735 -    (cd $OTHER_DIR && $FIND . -type f | $SORT > $WORK_DIR/other_files)
   1.736 -    (cd $THIS_DIR && $FIND . -type f | $SORT > $WORK_DIR/this_files)
   1.737 -    
   1.738 -    echo -n File names...
   1.739 -    if diff $WORK_DIR/other_files $WORK_DIR/this_files > /dev/null; then
   1.740 -        echo Identical!
   1.741 -    else
   1.742 -        echo Differences found.
   1.743 -        REGRESSIONS=true
   1.744 -    # Differences in directories found.
   1.745 -        ONLY_OTHER=$(diff $WORK_DIR/other_files $WORK_DIR/this_files | $GREP '<')
   1.746 -        if [ "$ONLY_OTHER" ]; then
   1.747 -            echo Only in $OTHER
   1.748 -            echo "$ONLY_OTHER" | sed 's|< ./|    |g'
   1.749 -        fi
   1.750 -    # Differences in directories found.
   1.751 -        ONLY_THIS=$(diff $WORK_DIR/other_files $WORK_DIR/this_files | $GREP '>')
   1.752 -        if [ "$ONLY_THIS" ]; then
   1.753 -            echo Only in $THIS
   1.754 -            echo "$ONLY_THIS" | sed 's|> ./|    |g'
   1.755 -        fi
   1.756 -    fi
   1.757 -}
   1.758 -
   1.759 -
   1.760 -##########################################################################################
   1.761 -# Compare permissions
   1.762 -
   1.763 -compare_permissions() {
   1.764 -    THIS_DIR=$1
   1.765 -    OTHER_DIR=$2
   1.766 -    WORK_DIR=$3
   1.767 -
   1.768 -    mkdir -p $WORK_DIR
   1.769 -
   1.770 -    echo -n Permissions...
   1.771 -    found=""
   1.772 -    for f in `cd $OTHER_DIR && $FIND . -type f`
   1.773 -    do
   1.774 -        if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
   1.775 -        if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
   1.776 -        OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
   1.777 -        TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
   1.778 -        if [ "$OP" != "$TP" ]
   1.779 -        then
   1.780 -	    if [ -z "$found" ]; then echo ; found="yes"; fi
   1.781 -	    $PRINTF "\told: ${OP} new: ${TP}\t$f\n"
   1.782 -        fi
   1.783 -    done
   1.784 -    if [ -z "$found" ]; then 
   1.785 -        echo "Identical!"
   1.786 -    else
   1.787 -        REGRESSIONS=true
   1.788 -    fi
   1.789 -}
   1.790 -
   1.791 -##########################################################################################
   1.792 -# Compare file command output
   1.793 -
   1.794 -compare_file_types() {
   1.795 -    THIS_DIR=$1
   1.796 -    OTHER_DIR=$2
   1.797 -    WORK_DIR=$3
   1.798 -
   1.799 -    $MKDIR -p $WORK_DIR
   1.800 -
   1.801 -    echo -n File types...
   1.802 -    found=""
   1.803 -    for f in `cd $OTHER_DIR && $FIND . -type f`
   1.804 -    do
   1.805 -        if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
   1.806 -        if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
   1.807 -        OF=`cd ${OTHER_DIR} && $FILE $f`
   1.808 -        TF=`cd ${THIS_DIR} && $FILE $f`
   1.809 -        if [ "$f" = "./src.zip" ] || [ "$f" = "./jre/lib/JObjC.jar" ] || [ "$f" = "./lib/JObjC.jar" ]
   1.810 -        then
   1.811 -	    if [ "`echo $OF | $GREP -ic zip`" -gt 0 -a "`echo $TF | $GREP -ic zip`" -gt 0 ]
   1.812 -	    then
   1.813 -	        # the way we produces zip-files make it so that directories are stored in old file
   1.814 -	        # but not in new (only files with full-path)
   1.815 -	        # this makes file-5.09 report them as different
   1.816 -	        continue;
   1.817 -	    fi
   1.818 -        fi
   1.819 -        
   1.820 -        if [ "$OF" != "$TF" ]
   1.821 -        then
   1.822 -	    if [ -z "$found" ]; then echo ; found="yes"; fi
   1.823 -	    $PRINTF "\tother: ${OF}\n\tthis : ${TF}\n"
   1.824 -        fi
   1.825 -    done
   1.826 -    if [ -z "$found" ]; then 
   1.827 -        echo "Identical!"
   1.828 -    else
   1.829 -        REGRESSIONS=true
   1.830 -    fi
   1.831 -}
   1.832 -
   1.833 -##########################################################################################
   1.834 -# Compare the rest of the files
   1.835 -
   1.836 -compare_general_files() {
   1.837 -    THIS_DIR=$1
   1.838 -    OTHER_DIR=$2
   1.839 -    WORK_DIR=$3
   1.840 -    
   1.841 -    GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
   1.842 -        ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
   1.843 -        ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
   1.844 -        ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
   1.845 -        ! -name "*.lib" \
   1.846 -        | $GREP -v "./bin/"  | $SORT | $FILTER)
   1.847 -
   1.848 -    echo General files...
   1.849 -    for f in $GENERAL_FILES
   1.850 -    do
   1.851 -        if [ -e $OTHER_DIR/$f ]; then
   1.852 -            DIFF_OUT=$($DIFF $OTHER_DIR/$f $THIS_DIR/$f 2>&1)
   1.853 -            if [ -n "$DIFF_OUT" ]; then
   1.854 -                echo $f
   1.855 -                REGRESSIONS=true
   1.856 -                if [ "$SHOW_DIFFS" = "true" ]; then
   1.857 -                    echo "$DIFF_OUT"
   1.858 -                fi
   1.859 -            fi
   1.860 -        fi
   1.861 -    done
   1.862 -
   1.863 -
   1.864 -}
   1.865 -
   1.866 -##########################################################################################
   1.867 -# Compare zip file
   1.868 -
   1.869 -compare_zip_file() {
   1.870 -    THIS_DIR=$1
   1.871 -    OTHER_DIR=$2
   1.872 -    WORK_DIR=$3
   1.873 -    ZIP_FILE=$4
   1.874 -
   1.875 -    THIS_ZIP=$THIS_DIR/$ZIP_FILE
   1.876 -    OTHER_ZIP=$OTHER_DIR/$ZIP_FILE
   1.877 -
   1.878 -    THIS_SUFFIX="${THIS_ZIP##*.}"
   1.879 -    OTHER_SUFFIX="${OTHER_ZIP##*.}"
   1.880 -    if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then
   1.881 -        echo The files do not have the same suffix type!
   1.882 -        return 2
   1.883 -    fi
   1.884 -
   1.885 -    UNARCHIVE="$UNZIP -q"
   1.886 -
   1.887 -    TYPE="$THIS_SUFFIX"
   1.888 -
   1.889 -    if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null
   1.890 -    then
   1.891 -        return 0
   1.892 -    fi
   1.893 -    # Not quite identical, the might still contain the same data.
   1.894 -    # Unpack the jar/zip files in temp dirs
   1.895 -    
   1.896 -    THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this
   1.897 -    OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other
   1.898 -    $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
   1.899 -    $MKDIR -p $THIS_UNZIPDIR
   1.900 -    $MKDIR -p $OTHER_UNZIPDIR
   1.901 -    (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
   1.902 -    (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
   1.903 -
   1.904 -    CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff
   1.905 -    LANG=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
   1.906 -
   1.907 -    ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE)
   1.908 -    ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE)
   1.909 -
   1.910 -    return_value=0
   1.911 -
   1.912 -    if [ -n "$ONLY_OTHER" ]; then
   1.913 -        echo "        Only OTHER $ZIP_FILE contains:"
   1.914 -        echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR|            |"g | sed 's|: |/|g'
   1.915 -        return_value=1
   1.916 -    fi
   1.917 -
   1.918 -    if [ -n "$ONLY_THIS" ]; then
   1.919 -        echo "        Only THIS $ZIP_FILE contains:"
   1.920 -        echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR|            |"g | sed 's|: |/|g'
   1.921 -        return_value=1
   1.922 -    fi
   1.923 -
   1.924 -    DIFFING_FILES=$($GREP differ $CONTENTS_DIFF_FILE | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
   1.925 -
   1.926 -    $RM -f $WORK_DIR/$ZIP_FILE.diffs
   1.927 -    for file in $DIFFING_FILES; do
   1.928 -	if [[ "$ACCEPTED_JARZIP_CONTENTS" != *"$file"* ]]; then
   1.929 -            diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs
   1.930 -	fi
   1.931 -    done
   1.932 -
   1.933 -    if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then
   1.934 -        return_value=1
   1.935 -        echo "        Differing files in $ZIP_FILE"
   1.936 -        $CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP differ | cut -f 2 -d ' ' | \
   1.937 -            $SED "s|$OTHER_UNZIPDIR|            |g" > $WORK_DIR/$ZIP_FILE.difflist
   1.938 -        $CAT $WORK_DIR/$ZIP_FILE.difflist
   1.939 -
   1.940 -        if [ -n "$SHOW_DIFFS" ]; then
   1.941 -            for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do
   1.942 -                if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then
   1.943 -                    LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
   1.944 -                elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then
   1.945 -                    LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
   1.946 -                else
   1.947 -                    LANG=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
   1.948 -                fi
   1.949 -            done
   1.950 -        fi
   1.951 -    fi
   1.952 -
   1.953 -    return $return_value
   1.954 -}
   1.955 -
   1.956 -
   1.957 -##########################################################################################
   1.958 -# Compare all zip files
   1.959 -
   1.960 -compare_all_zip_files() {
   1.961 -    THIS_DIR=$1
   1.962 -    OTHER_DIR=$2
   1.963 -    WORK_DIR=$3
   1.964 -
   1.965 -    ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER )
   1.966 -
   1.967 -    if [ -n "$ZIPS" ]; then
   1.968 -        echo Zip files...
   1.969 -
   1.970 -        return_value=0
   1.971 -        for f in $ZIPS; do
   1.972 -            if [ -f "$OTHER_DIR/$f" ]; then
   1.973 -                compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
   1.974 -                if [ "$?" != "0" ]; then
   1.975 -                    return_value=1
   1.976 -                    REGRESSIONS=true
   1.977 -                fi
   1.978 -            fi
   1.979 -        done
   1.980 -    fi
   1.981 -
   1.982 -    return $return_value
   1.983 -}
   1.984 -
   1.985 -##########################################################################################
   1.986 -# Compare all jar files
   1.987 -
   1.988 -compare_all_jar_files() {
   1.989 -    THIS_DIR=$1
   1.990 -    OTHER_DIR=$2
   1.991 -    WORK_DIR=$3
   1.992 -
   1.993 -    # TODO filter?
   1.994 -    ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" | $SORT | $FILTER)
   1.995 -
   1.996 -    if [ -n "$ZIPS" ]; then
   1.997 -        echo Jar files...
   1.998 -
   1.999 -        return_value=0
  1.1000 -        for f in $ZIPS; do
  1.1001 -            if [ -f "$OTHER_DIR/$f" ]; then
  1.1002 -                compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
  1.1003 -                if [ "$?" != "0" ]; then
  1.1004 -                    return_value=1
  1.1005 -                    REGRESSIONS=true
  1.1006 -                fi
  1.1007 -            fi
  1.1008 -        done
  1.1009 -    fi
  1.1010 -
  1.1011 -    return $return_value
  1.1012 -}
  1.1013 -
  1.1014 -##########################################################################################
  1.1015 -# Compare binary (executable/library) file
  1.1016 -
  1.1017 -compare_bin_file() {
  1.1018 -    THIS_DIR=$1
  1.1019 -    OTHER_DIR=$2
  1.1020 -    WORK_DIR=$3
  1.1021 -    BIN_FILE=$4
  1.1022 -
  1.1023 -    THIS_FILE=$THIS_DIR/$BIN_FILE
  1.1024 -    OTHER_FILE=$OTHER_DIR/$BIN_FILE
  1.1025 -    NAME=$(basename $BIN_FILE)
  1.1026 -    WORK_FILE_BASE=$WORK_DIR/$BIN_FILE
  1.1027 -    FILE_WORK_DIR=$(dirname $WORK_FILE_BASE)
  1.1028 -
  1.1029 -    $MKDIR -p $FILE_WORK_DIR
  1.1030 -
  1.1031 -    ORIG_THIS_FILE="$THIS_FILE"
  1.1032 -    ORIG_OTHER_FILE="$OTHER_FILE"
  1.1033 -
  1.1034 -    if [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then
  1.1035 -        THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME
  1.1036 -        OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME
  1.1037 -        $MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other
  1.1038 -        $CP $THIS_FILE $THIS_STRIPPED_FILE
  1.1039 -        $CP $OTHER_FILE $OTHER_STRIPPED_FILE
  1.1040 -        $STRIP $THIS_STRIPPED_FILE
  1.1041 -        $STRIP $OTHER_STRIPPED_FILE
  1.1042 -        THIS_FILE="$THIS_STRIPPED_FILE"
  1.1043 -        OTHER_FILE="$OTHER_STRIPPED_FILE"
  1.1044 -    fi
  1.1045 -
  1.1046 -    if [ -z "$SKIP_BIN_DIFF" ]; then
  1.1047 -        if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
  1.1048 -        # The files were bytewise identical.
  1.1049 -            if [ -n "$VERBOSE" ]; then
  1.1050 -                echo "        :           :         :         :          : $BIN_FILE"
  1.1051 -            fi
  1.1052 -            return 0
  1.1053 -        fi
  1.1054 -        BIN_MSG=" diff "
  1.1055 -        if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then
  1.1056 -            DIFF_BIN=true
  1.1057 -            if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then
  1.1058 -                BIN_MSG="*$BIN_MSG*"
  1.1059 -                REGRESSIONS=true
  1.1060 -            else
  1.1061 -                BIN_MSG=" $BIN_MSG "
  1.1062 -            fi
  1.1063 -        else
  1.1064 -            BIN_MSG="($BIN_MSG)"
  1.1065 -            DIFF_BIN=
  1.1066 -        fi
  1.1067 -    fi
  1.1068 -
  1.1069 -    THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }')
  1.1070 -    OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }')
  1.1071 -    if [ $THIS_SIZE -ne $OTHER_SIZE ]; then
  1.1072 -        DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE)
  1.1073 -        DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE)
  1.1074 -        SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM)
  1.1075 -        if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] && [ "$DIFF_SIZE_REL" -lt 102 ]; then
  1.1076 -            SIZE_MSG="($SIZE_MSG)"
  1.1077 -            DIFF_SIZE=
  1.1078 -        else
  1.1079 -            if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
  1.1080 -                DIFF_SIZE=true
  1.1081 -                if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
  1.1082 -                    SIZE_MSG="*$SIZE_MSG*"
  1.1083 -                    REGRESSIONS=true
  1.1084 -                else
  1.1085 -                    SIZE_MSG=" $SIZE_MSG "
  1.1086 -                fi
  1.1087 -            else
  1.1088 -                SIZE_MSG="($SIZE_MSG)"
  1.1089 -                DIFF_SIZE=
  1.1090 -            fi
  1.1091 -        fi
  1.1092 -    else
  1.1093 -        SIZE_MSG="           "
  1.1094 -        DIFF_SIZE=
  1.1095 -        if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then
  1.1096 -            SIZE_MSG="     !     "
  1.1097 -        fi
  1.1098 -    fi
  1.1099 -
  1.1100 -    if [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then
  1.1101 -        SYM_SORT_CMD="sort"
  1.1102 -    else
  1.1103 -        SYM_SORT_CMD="cat"
  1.1104 -    fi
  1.1105 -
  1.1106 -    # Check symbols
  1.1107 -    if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
  1.1108 -	$DUMPBIN -exports $OTHER_FILE | $GREP " = " | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
  1.1109 -	$DUMPBIN -exports $THIS_FILE  | $GREP " = " | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
  1.1110 -    elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
  1.1111 -        # Some symbols get seemingly random 15 character prefixes. Filter them out.
  1.1112 -        $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
  1.1113 -	$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
  1.1114 -    else
  1.1115 -	$NM -a $ORIG_OTHER_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
  1.1116 -	$NM -a $ORIG_THIS_FILE  | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
  1.1117 -    fi
  1.1118 -    
  1.1119 -    LANG=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
  1.1120 -    if [ -s $WORK_FILE_BASE.symbols.diff ]; then
  1.1121 -        SYM_MSG=" diff  "
  1.1122 -        if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then
  1.1123 -            DIFF_SYM=true
  1.1124 -            if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then
  1.1125 -                SYM_MSG="*$SYM_MSG*"
  1.1126 -                REGRESSIONS=true
  1.1127 -            else
  1.1128 -                SYM_MSG=" $SYM_MSG "
  1.1129 -            fi
  1.1130 -        else
  1.1131 -            SYM_MSG="($SYM_MSG)"            
  1.1132 -            DIFF_SYM=
  1.1133 -        fi
  1.1134 -    else
  1.1135 -        SYM_MSG="         "
  1.1136 -        DIFF_SYM=
  1.1137 -        if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then
  1.1138 -            SYM_MSG="    !    "
  1.1139 -        fi
  1.1140 -    fi
  1.1141 -
  1.1142 -    # Check dependencies
  1.1143 -    if [ -n "$LDD_CMD" ];then
  1.1144 -	(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)
  1.1145 -	(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)
  1.1146 -	(cd $FILE_WORK_DIR && $RM -f $NAME)
  1.1147 -	
  1.1148 -	LANG=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
  1.1149 -	LANG=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq
  1.1150 -	
  1.1151 -	if [ -s $WORK_FILE_BASE.deps.diff ]; then
  1.1152 -            if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then
  1.1153 -		DEP_MSG=" diff  "
  1.1154 -            else
  1.1155 -		DEP_MSG=" redun "
  1.1156 -            fi
  1.1157 -            if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then
  1.1158 -		DIFF_DEP=true
  1.1159 -		if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then
  1.1160 -                    DEP_MSG="*$DEP_MSG*"
  1.1161 -                    REGRESSIONS=true
  1.1162 -		else
  1.1163 -                    DEP_MSG=" $DEP_MSG "
  1.1164 -		fi
  1.1165 -            else
  1.1166 -		DEP_MSG="($DEP_MSG)"
  1.1167 -		DIFF_DEP=
  1.1168 -            fi
  1.1169 -	else
  1.1170 -	    DEP_MSG="         "
  1.1171 -	    DIFF_DEP=
  1.1172 -            if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
  1.1173 -                DEP_MSG="     !      "
  1.1174 -            fi
  1.1175 -	fi
  1.1176 -    fi
  1.1177 -    
  1.1178 -    # Compare readelf output
  1.1179 -    if [ -n "$READELF_CMD" ] && [ -z "$SKIP_ELF_DIFF" ]; then
  1.1180 -        $READELF_CMD $OTHER_FILE > $WORK_FILE_BASE.readelf.other 2>&1
  1.1181 -        $READELF_CMD $THIS_FILE > $WORK_FILE_BASE.readelf.this 2>&1
  1.1182 -        
  1.1183 -        LANG=C $DIFF $WORK_FILE_BASE.readelf.other $WORK_FILE_BASE.readelf.this > $WORK_FILE_BASE.readelf.diff
  1.1184 -        
  1.1185 -        if [ -s $WORK_FILE_BASE.readelf.diff ]; then
  1.1186 -            ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.readelf.diff | awk '{print $5}')
  1.1187 -            ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE)
  1.1188 -            if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then
  1.1189 -                DIFF_ELF=true
  1.1190 -                if [[ "$KNOWN_ELF_DIFF" != *"$BIN_FILE"* ]]; then
  1.1191 -                    ELF_MSG="*$ELF_MSG*"
  1.1192 -                    REGRESSIONS=true
  1.1193 -                else
  1.1194 -                    ELF_MSG=" $ELF_MSG "
  1.1195 -                fi
  1.1196 -            else
  1.1197 -                ELF_MSG="($ELF_MSG)"
  1.1198 -                DIFF_ELF=
  1.1199 -            fi
  1.1200 -        else
  1.1201 -            ELF_MSG="          "
  1.1202 -            DIFF_ELF=
  1.1203 -            if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
  1.1204 -                ELF_MSG="    !    "
  1.1205 -            fi
  1.1206 -        fi
  1.1207 -    fi
  1.1208 -
  1.1209 -    # Compare disassemble output
  1.1210 -    if [ -f "$OBJDUMP" ] && [ -z "$SKIP_DIS_DIFF" ]; then
  1.1211 -        $OBJDUMP -d $OTHER_FILE | $GREP -v $NAME > $WORK_FILE_BASE.dis.other 2>&1
  1.1212 -        $OBJDUMP -d $THIS_FILE  | $GREP -v $NAME > $WORK_FILE_BASE.dis.this  2>&1
  1.1213 -        
  1.1214 -        LANG=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
  1.1215 -        
  1.1216 -        if [ -s $WORK_FILE_BASE.dis.diff ]; then
  1.1217 -            DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}')
  1.1218 -            DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE)
  1.1219 -            if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then
  1.1220 -                DIFF_DIS=true
  1.1221 -                if [[ "$KNOWN_DIS_DIFF" != *"$BIN_FILE"* ]]; then
  1.1222 -                    DIS_MSG="*$DIS_MSG*"
  1.1223 -                    REGRESSIONS=true
  1.1224 -                else
  1.1225 -                    DIS_MSG=" $DIS_MSG "
  1.1226 -                fi
  1.1227 -            else
  1.1228 -                DIS_MSG="($DIS_MSG)"
  1.1229 -                DIFF_DIS=
  1.1230 -            fi
  1.1231 -        else
  1.1232 -            DIS_MSG="          "
  1.1233 -            DIFF_DIS=
  1.1234 -            if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
  1.1235 -                DIS_MSG="    !    "
  1.1236 -            fi
  1.1237 -        fi
  1.1238 -    fi
  1.1239 -
  1.1240 -
  1.1241 -    if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_ELF$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then
  1.1242 -        if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi
  1.1243 -        if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi
  1.1244 -        if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi
  1.1245 -        if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi
  1.1246 -        if [ -n "$ELF_MSG" ]; then echo -n "$ELF_MSG:"; fi
  1.1247 -        if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi
  1.1248 -        echo " $BIN_FILE"
  1.1249 -        if [ "$SHOW_DIFFS" = "true" ]; then
  1.1250 -            if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then
  1.1251 -                echo "Symbols diff:"
  1.1252 -                $CAT $WORK_FILE_BASE.symbols.diff
  1.1253 -            fi
  1.1254 -            if [ -s "$WORK_FILE_BASE.deps.diff" ]; then
  1.1255 -                echo "Deps diff:"
  1.1256 -                $CAT $WORK_FILE_BASE.deps.diff
  1.1257 -            fi
  1.1258 -            if [ -s "$WORK_FILE_BASE.readelf.diff" ]; then
  1.1259 -                echo "Readelf diff:"
  1.1260 -                $CAT $WORK_FILE_BASE.readelf.diff
  1.1261 -            fi
  1.1262 -            if [ -s "$WORK_FILE_BASE.dis.diff" ]; then
  1.1263 -                echo "Disassembly diff:"
  1.1264 -                $CAT $WORK_FILE_BASE.dis.diff
  1.1265 -            fi
  1.1266 -        fi
  1.1267 -        return 1
  1.1268 -    fi
  1.1269 -    return 0
  1.1270 -}
  1.1271 -
  1.1272 -##########################################################################################
  1.1273 -# Print binary diff header
  1.1274 -
  1.1275 -print_binary_diff_header() {
  1.1276 -    if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi
  1.1277 -    if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n "   Size    :"; fi
  1.1278 -    if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi
  1.1279 -    if [ -z "$SKIP_DEP_DIFF" ]; then echo -n "  Deps   :"; fi
  1.1280 -    if [ -z "$SKIP_ELF_DIFF" ]; then echo -n " Readelf  :"; fi
  1.1281 -    if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass   :"; fi
  1.1282 -    echo
  1.1283 -}
  1.1284 -
  1.1285 -##########################################################################################
  1.1286 -# Compare all libraries
  1.1287 -
  1.1288 -compare_all_libs() {
  1.1289 -    THIS_DIR=$1
  1.1290 -    OTHER_DIR=$2
  1.1291 -    WORK_DIR=$3
  1.1292 -
  1.1293 -    LIBS=$(cd $THIS_DIR && $FIND . -name 'lib*.so' -o -name '*.dylib' -o -name '*.dll' | $SORT | $FILTER)
  1.1294 -
  1.1295 -    if [ -n "$LIBS" ]; then
  1.1296 -        echo Libraries...
  1.1297 -        print_binary_diff_header
  1.1298 -        for l in $LIBS; do
  1.1299 -            if [ -f "$OTHER_DIR/$l" ]; then
  1.1300 -                compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l
  1.1301 -                if [ "$?" != "0" ]; then
  1.1302 -                    return_value=1
  1.1303 -                fi
  1.1304 -            fi
  1.1305 -        done
  1.1306 -    fi
  1.1307 -
  1.1308 -    return $return_value
  1.1309 -}
  1.1310 -
  1.1311 -##########################################################################################
  1.1312 -# Compare all executables
  1.1313 -
  1.1314 -compare_all_execs() {
  1.1315 -    THIS_DIR=$1
  1.1316 -    OTHER_DIR=$2
  1.1317 -    WORK_DIR=$3
  1.1318 -
  1.1319 -    if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
  1.1320 -        EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER)
  1.1321 -    else
  1.1322 -        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)
  1.1323 -    fi
  1.1324 -
  1.1325 -    if [ -n "$EXECS" ]; then
  1.1326 -        echo Executables...
  1.1327 -        print_binary_diff_header
  1.1328 -        for e in $EXECS; do
  1.1329 -            if [ -f "$OTHER_DIR/$e" ]; then
  1.1330 -                compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e
  1.1331 -                if [ "$?" != "0" ]; then
  1.1332 -                    return_value=1
  1.1333 -                fi
  1.1334 -            fi
  1.1335 -        done
  1.1336 -    fi
  1.1337 -
  1.1338 -    return $return_value
  1.1339 -}
  1.1340 -
  1.1341 -##########################################################################################
  1.1342 -# Initiate configuration
  1.1343 -
  1.1344 -COMPARE_ROOT=/tmp/cimages.$USER
  1.1345 -$MKDIR -p $COMPARE_ROOT
  1.1346 -if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
  1.1347 -    if [ "$(uname -o)" = "Cygwin" ]; then
  1.1348 -	COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT)
  1.1349 -    fi
  1.1350 -fi
  1.1351 -
  1.1352 -THIS="$( cd "$( dirname "$0" )" && pwd )"
  1.1353 -echo "$THIS"
  1.1354 -THIS_SCRIPT="$0"
  1.1355 -
  1.1356 -if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
  1.1357 -    echo "bash ./compare.sh [OPTIONS] [FILTER]"
  1.1358 -    echo ""
  1.1359 -    echo "-all                Compare all files in all known ways"
  1.1360 -    echo "-names              Compare the file names and directory structure"
  1.1361 -    echo "-perms              Compare the permission bits on all files and directories"
  1.1362 -    echo "-types              Compare the output of the file command on all files"
  1.1363 -    echo "-general            Compare the files not convered by the specialized comparisons"
  1.1364 -    echo "-zips               Compare the contents of all zip files"
  1.1365 -    echo "-jars               Compare the contents of all jar files"
  1.1366 -    echo "-libs               Compare all native libraries"
  1.1367 -    echo "-execs              Compare all executables"
  1.1368 -    echo "-v                  Verbose output, does not hide known differences"
  1.1369 -    echo "-vv                 More verbose output, shows diff output of all comparisons"
  1.1370 -    echo "-o [OTHER]          Compare with build in other directory. Will default to the old build directory"
  1.1371 -    echo ""
  1.1372 -    echo "[FILTER]            List filenames in the image to compare, works for jars, zips, libs and execs"
  1.1373 -    echo "Example:"
  1.1374 -    echo "bash ./common/bin/compareimages.sh CodePointIM.jar"
  1.1375 -    exit 10
  1.1376 -fi
  1.1377 -
  1.1378 -CMP_NAMES=false
  1.1379 -CMP_PERMS=false
  1.1380 -CMP_TYPES=false
  1.1381 -CMP_GENERAL=false
  1.1382 -CMP_ZIPS=false
  1.1383 -CMP_JARS=false
  1.1384 -CMP_LIBS=false
  1.1385 -CMP_EXECS=false
  1.1386 -
  1.1387 -while [ -n "$1" ]; do
  1.1388 -    case "$1" in
  1.1389 -        -v)
  1.1390 -            VERBOSE=true
  1.1391 -            ;;
  1.1392 -        -vv)
  1.1393 -            VERBOSE=true
  1.1394 -            SHOW_DIFFS=true
  1.1395 -            ;;
  1.1396 -        -o)
  1.1397 -            OTHER=$2
  1.1398 -            shift
  1.1399 -            ;;
  1.1400 -        -all)
  1.1401 -            CMP_NAMES=true
  1.1402 -            if [ "$OPENJDK_TARGET_OS" != "windows" ]; then
  1.1403 -                CMP_PERMS=true
  1.1404 -            fi
  1.1405 -            CMP_TYPES=true
  1.1406 -            CMP_GENERAL=true
  1.1407 -            CMP_ZIPS=true
  1.1408 -            CMP_JARS=true
  1.1409 -            CMP_LIBS=true
  1.1410 -            CMP_EXECS=true
  1.1411 -            ;;
  1.1412 -        -names)
  1.1413 -            CMP_NAMES=true
  1.1414 -            ;;
  1.1415 -        -perms)
  1.1416 -            CMP_PERMS=true
  1.1417 -            ;;
  1.1418 -        -types)
  1.1419 -            CMP_TYPES=true
  1.1420 -            ;;
  1.1421 -        -general)
  1.1422 -            CMP_GENERAL=true
  1.1423 -            ;;
  1.1424 -        -zips)
  1.1425 -            CMP_ZIPS=true
  1.1426 -            ;;
  1.1427 -        -jars)
  1.1428 -            CMP_JARS=true
  1.1429 -            ;;
  1.1430 -        -libs)
  1.1431 -            CMP_LIBS=true
  1.1432 -            ;;
  1.1433 -        -execs)
  1.1434 -            CMP_EXECS=true
  1.1435 -            ;;
  1.1436 -        *)
  1.1437 -            CMP_NAMES=false
  1.1438 -            CMP_PERMS=false
  1.1439 -            CMP_TYPES=false
  1.1440 -            CMP_ZIPS=true
  1.1441 -            CMP_JARS=true
  1.1442 -            CMP_LIBS=true
  1.1443 -            CMP_EXECS=true
  1.1444 -            
  1.1445 -            if [ -z "$FILTER" ]; then
  1.1446 -                FILTER="$GREP"
  1.1447 -            fi
  1.1448 -            FILTER="$FILTER -e $1"
  1.1449 -            ;;
  1.1450 -    esac
  1.1451 -    shift
  1.1452 -done
  1.1453 -
  1.1454 -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
  1.1455 -    CMP_NAMES=true
  1.1456 -    CMP_PERMS=true
  1.1457 -    CMP_TYPES=true
  1.1458 -    CMP_GENERAL=true
  1.1459 -    CMP_ZIPS=true
  1.1460 -    CMP_JARS=true
  1.1461 -    CMP_LIBS=true
  1.1462 -    CMP_EXECS=true
  1.1463 -fi
  1.1464 -
  1.1465 -if [ -z "$FILTER" ]; then
  1.1466 -    FILTER="$CAT"
  1.1467 -fi
  1.1468 -
  1.1469 -if [ -z "$OTHER" ]; then
  1.1470 -    OTHER="$THIS/../$LEGACY_BUILD_DIR"
  1.1471 -    if [ -d "$OTHER" ]; then
  1.1472 -        OTHER="$( cd "$OTHER" && pwd )"
  1.1473 -    else
  1.1474 -        echo "Default old build directory does not exist:"
  1.1475 -        echo "$OTHER"
  1.1476 -    fi
  1.1477 -    echo "Comparing to default old build:"
  1.1478 -    echo "$OTHER"
  1.1479 -    echo
  1.1480 -else
  1.1481 -    echo "Comparing to:"
  1.1482 -    echo "$OTHER"
  1.1483 -    echo
  1.1484 -fi
  1.1485 -
  1.1486 -if [ ! -d "$OTHER" ]; then
  1.1487 -    echo "Other build directory does not exist:"
  1.1488 -    echo "$OTHER"
  1.1489 -    exit 1;
  1.1490 -fi
  1.1491 -
  1.1492 -# Figure out the layout of the new build. Which kinds of images have been produced
  1.1493 -if [ -d "$THIS/images/j2sdk-image" ]; then
  1.1494 -    THIS_J2SDK="$THIS/images/j2sdk-image"
  1.1495 -    THIS_J2RE="$THIS/images/j2re-image"
  1.1496 -fi
  1.1497 -if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
  1.1498 -    THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image"
  1.1499 -    THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image"
  1.1500 -fi
  1.1501 -
  1.1502 -# Figure out the layout of the other build (old or new, normal or overlay image)
  1.1503 -if [ -d "$OTHER/j2sdk-image" ]; then
  1.1504 -    if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then
  1.1505 -        OTHER_J2SDK="$OTHER/j2sdk-image"
  1.1506 -        OTHER_J2RE="$OTHER/j2re-image"
  1.1507 -    else
  1.1508 -        OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image"
  1.1509 -        OTHER_J2RE_OVERLAY="$OTHER/j2re-image"
  1.1510 -    fi
  1.1511 -
  1.1512 -fi
  1.1513 -
  1.1514 -if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then
  1.1515 -    echo "OTHER build only has an overlay image while this build does not. Nothing to compare!"
  1.1516 +# Now locate the main script and run it.
  1.1517 +REAL_COMPARE_SCRIPT="$SRC_ROOT/common/bin/compare.sh"
  1.1518 +if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then
  1.1519 +    echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT"
  1.1520      exit 1
  1.1521  fi
  1.1522  
  1.1523 -
  1.1524 -##########################################################################################
  1.1525 -# Do the work
  1.1526 -
  1.1527 -if [ "$CMP_NAMES" = "true" ]; then
  1.1528 -    if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1.1529 -        echo -n "J2SDK "
  1.1530 -        compare_dirs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1531 -        echo -n "J2RE  "
  1.1532 -        compare_dirs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1.1533 -        
  1.1534 -        echo -n "J2SDK "
  1.1535 -        compare_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1536 -        echo -n "J2RE  "
  1.1537 -        compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1.1538 -    fi
  1.1539 -    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
  1.1540 -        echo -n "J2SDK Overlay "
  1.1541 -        compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
  1.1542 -        echo -n "J2RE  Overlay "
  1.1543 -        compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
  1.1544 -        
  1.1545 -        echo -n "J2SDK Overlay "
  1.1546 -        compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
  1.1547 -        echo -n "J2RE  Overlay "
  1.1548 -        compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
  1.1549 -    fi
  1.1550 -fi
  1.1551 -
  1.1552 -if [ "$CMP_PERMS" = "true" ]; then
  1.1553 -    if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1.1554 -        echo -n "J2SDK "
  1.1555 -        compare_permissions $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1556 -        echo -n "J2RE  "
  1.1557 -        compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1.1558 -    fi
  1.1559 -    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
  1.1560 -        echo -n "J2SDK Overlay "
  1.1561 -        compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
  1.1562 -        echo -n "J2RE  Overlay "
  1.1563 -        compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
  1.1564 -    fi
  1.1565 -fi
  1.1566 -
  1.1567 -if [ "$CMP_TYPES" = "true" ]; then
  1.1568 -    if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1.1569 -        echo -n "J2SDK "
  1.1570 -        compare_file_types $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1571 -        echo -n "J2RE  "
  1.1572 -        compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1.1573 -    fi
  1.1574 -    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
  1.1575 -        echo -n "J2SDK Overlay "
  1.1576 -        compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
  1.1577 -        echo -n "J2RE  Overlay "
  1.1578 -        compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
  1.1579 -    fi
  1.1580 -fi
  1.1581 -
  1.1582 -if [ "$CMP_GENERAL" = "true" ]; then
  1.1583 -    if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1.1584 -        echo -n "J2SDK "
  1.1585 -        compare_general_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1586 -        echo -n "J2RE  "
  1.1587 -        compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
  1.1588 -    fi
  1.1589 -    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
  1.1590 -        echo -n "J2SDK Overlay "
  1.1591 -        compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
  1.1592 -        echo -n "J2RE  Overlay "
  1.1593 -        compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
  1.1594 -    fi
  1.1595 -fi
  1.1596 -
  1.1597 -if [ "$CMP_ZIPS" = "true" ]; then
  1.1598 -    if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1.1599 -        compare_all_zip_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1600 -    fi
  1.1601 -fi
  1.1602 -
  1.1603 -if [ "$CMP_JARS" = "true" ]; then
  1.1604 -    if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1.1605 -        compare_all_jar_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1606 -    fi
  1.1607 -fi
  1.1608 -
  1.1609 -if [ "$CMP_LIBS" = "true" ]; then
  1.1610 -    if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1.1611 -        compare_all_libs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1612 -    fi
  1.1613 -    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
  1.1614 -        echo -n "Overlay "
  1.1615 -        compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
  1.1616 -    fi
  1.1617 -fi
  1.1618 -
  1.1619 -if [ "$CMP_EXECS" = "true" ]; then
  1.1620 -    if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
  1.1621 -        compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
  1.1622 -    fi
  1.1623 -    if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
  1.1624 -        echo -n "Overlay "
  1.1625 -        compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
  1.1626 -    fi
  1.1627 -fi
  1.1628 -
  1.1629 -echo
  1.1630 -
  1.1631 -if [ -n "$REGRESSIONS" ]; then
  1.1632 -    echo "REGRESSIONS FOUND!"
  1.1633 -    echo
  1.1634 -    exit 1
  1.1635 -else
  1.1636 -    echo "No regressions found"
  1.1637 -    echo
  1.1638 -    exit 0
  1.1639 -fi
  1.1640 +. "$REAL_COMPARE_SCRIPT" "$@"

mercurial