OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 # | 2 # |
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Sanitize environment. | 7 # Sanitize environment. |
8 set -e | 8 set -e |
9 export LANG=C | 9 export LANG=C |
10 export LC_ALL=C | 10 export LC_ALL=C |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 OPENSSL_SHA1_DOWNLOADED=$(sha1sum $DOWNLOAD_DIR/$OPENSSL_PACKAGE | cut -d" " -f1
) | 321 OPENSSL_SHA1_DOWNLOADED=$(sha1sum $DOWNLOAD_DIR/$OPENSSL_PACKAGE | cut -d" " -f1
) |
322 OPENSSL_SHA1_EXPECTED=$OPENSSL_TAR_SHA1 | 322 OPENSSL_SHA1_EXPECTED=$OPENSSL_TAR_SHA1 |
323 if [ "$OPENSSL_SHA1_DOWNLOADED" != "$OPENSSL_SHA1_EXPECTED" ]; then | 323 if [ "$OPENSSL_SHA1_DOWNLOADED" != "$OPENSSL_SHA1_EXPECTED" ]; then |
324 echo "ERROR: Content mismatch for downloaded OpenSSL package:" | 324 echo "ERROR: Content mismatch for downloaded OpenSSL package:" |
325 echo " Downloaded SHA-1: $OPENSSL_SHA1_DOWNLOADED" | 325 echo " Downloaded SHA-1: $OPENSSL_SHA1_DOWNLOADED" |
326 echo " Expected SHA-1 : $OPENSSL_SHA1_EXPECTED" | 326 echo " Expected SHA-1 : $OPENSSL_SHA1_EXPECTED" |
327 exit 1 | 327 exit 1 |
328 fi | 328 fi |
329 dump "Checking content of downloaded package: ok" | 329 dump "Checking content of downloaded package: ok" |
330 | 330 |
| 331 # The import_openssl.sh script will really remove the existing 'openssl' |
| 332 # directory and replace it with something completely new. This is a problem |
| 333 # when using subversion because this also gets rid of all .svn |
| 334 # subdirectories. This makes it impossible to commit the right set of |
| 335 # changes with "gcl commit". |
| 336 # |
| 337 # To work-around this, copy all the .svn subdirectories into a temporary |
| 338 # tarball, which will be extracted after the import process. |
| 339 # |
| 340 dump "Saving .svn subdirectories" |
| 341 SAVED_SVN_TARBALL=$BUILD_DIR/saved-svn-subdirs.tar.gz |
| 342 run tar czf $SAVED_SVN_TARBALL $(find . -type d -name ".svn") |
| 343 |
331 # Re-run the import_openssl.sh script. | 344 # Re-run the import_openssl.sh script. |
332 dump "Re-running the 'import_openssl.sh' script to reconfigure all sources." | 345 dump "Re-running the 'import_openssl.sh' script to reconfigure all sources." |
333 ( | 346 ( |
334 cd $ANDROID_SRC_DIR | 347 cd $ANDROID_SRC_DIR |
335 run ./import_openssl.sh import $DOWNLOAD_DIR/$OPENSSL_PACKAGE | 348 run ./import_openssl.sh import $DOWNLOAD_DIR/$OPENSSL_PACKAGE |
336 ) | 349 ) |
337 | 350 |
338 dump "Copying new Android sources to final location." | 351 dump "Copying new Android sources to final location." |
339 clean_openssl_new () { | 352 clean_openssl_new () { |
340 rm -rf "$PROGDIR/openssl.new" | 353 rm -rf "$PROGDIR/openssl.new" |
341 } | 354 } |
342 atexit clean_openssl_new | 355 atexit clean_openssl_new |
343 | 356 |
344 run cp -rp "$ANDROID_SRC_DIR" "$PROGDIR/openssl.new" | 357 run cp -rp "$ANDROID_SRC_DIR" "$PROGDIR/openssl.new" |
345 run mv "$PROGDIR/openssl" "$PROGDIR/openssl.old" | 358 run mv "$PROGDIR/openssl" "$PROGDIR/openssl.old" |
346 run mv "$PROGDIR/openssl.new" "$PROGDIR/openssl" | 359 run mv "$PROGDIR/openssl.new" "$PROGDIR/openssl" |
347 run rm -rf "$PROGDIR/openssl.old" | 360 run rm -rf "$PROGDIR/openssl.old" |
348 | 361 |
| 362 dump "Restoring .svn subdirectores" |
| 363 run tar xzf $SAVED_SVN_TARBALL |
| 364 |
349 # Extract list of source files or compiler defines from openssl.config | 365 # Extract list of source files or compiler defines from openssl.config |
350 # variable definition. This assumes that the lists are in variables that | 366 # variable definition. This assumes that the lists are in variables that |
351 # are named as <prefix><suffix> or <prefix><suffix><arch>. | 367 # are named as <prefix><suffix> or <prefix><suffix><arch>. |
352 # | 368 # |
353 # A few examples: | 369 # A few examples: |
354 # get_gyp_list "FOO BAR" _SOURCES | 370 # get_gyp_list "FOO BAR" _SOURCES |
355 # -> returns '$FOO_SOURCES $BAR_SOURCES' | 371 # -> returns '$FOO_SOURCES $BAR_SOURCES' |
356 # | 372 # |
357 # get_gyp_list FOO _SOURCES_ "arm x86" | 373 # get_gyp_list FOO _SOURCES_ "arm x86" |
358 # -> returns '$FOO_SOURCES_arm $FOO_SOURCES_x86" | 374 # -> returns '$FOO_SOURCES_arm $FOO_SOURCES_x86" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 > $PROGDIR/config/x64/openssl/opensslconf.h | 461 > $PROGDIR/config/x64/openssl/opensslconf.h |
446 | 462 |
447 dump "Generating .gypi file." | 463 dump "Generating .gypi file." |
448 . $ANDROID_SRC_DIR/openssl.config | 464 . $ANDROID_SRC_DIR/openssl.config |
449 generate_gyp_file > $PROGDIR/openssl.gypi.new | 465 generate_gyp_file > $PROGDIR/openssl.gypi.new |
450 run mv $PROGDIR/openssl.gypi $PROGDIR/openssl.gypi.old | 466 run mv $PROGDIR/openssl.gypi $PROGDIR/openssl.gypi.old |
451 run mv $PROGDIR/openssl.gypi.new $PROGDIR/openssl.gypi | 467 run mv $PROGDIR/openssl.gypi.new $PROGDIR/openssl.gypi |
452 run rm $PROGDIR/openssl.gypi.old | 468 run rm $PROGDIR/openssl.gypi.old |
453 | 469 |
454 dump "Done." | 470 dump "Done." |
OLD | NEW |