OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright 2012 the V8 project authors. All rights reserved. | 2 # Copyright 2012 the V8 project authors. All rights reserved. |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
(...skipping 15 matching lines...) Expand all Loading... |
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 |
29 # This script pushes android binaries and test data to the device. | 29 # This script pushes android binaries and test data to the device. |
30 # The first argument can be either "android.release" or "android.debug". | 30 # The first argument can be either "android.release" or "android.debug". |
31 # The second argument is a relative path to the output directory with binaries. | 31 # The second argument is a relative path to the output directory with binaries. |
32 # The third argument is the absolute path to the V8 directory on the host. | 32 # The third argument is the absolute path to the V8 directory on the host. |
33 # The fourth argument is the absolute path to the V8 directory on the device. | 33 # The fourth argument is the absolute path to the V8 directory on the device. |
34 | 34 |
35 if [ ${#@} -lt 4 ] ; then | 35 if [ ${#@} -lt 4 ] ; then |
36 echo "Error: need 4 arguments" | 36 echo "$0: Error: need 4 arguments" |
37 exit 1 | 37 exit 1 |
38 fi | 38 fi |
39 | 39 |
40 ARCH_MODE=$1 | 40 ARCH_MODE=$1 |
41 OUTDIR=$2 | 41 OUTDIR=$2 |
42 HOST_V8=$3 | 42 HOST_V8=$3 |
43 ANDROID_V8=$4 | 43 ANDROID_V8=$4 |
44 | 44 |
| 45 function LINUX_MD5 { |
| 46 local HASH=$(md5sum $1) |
| 47 echo ${HASH%% *} |
| 48 } |
| 49 |
| 50 function DARWIN_MD5 { |
| 51 local HASH=$(md5 $1) |
| 52 echo ${HASH} | cut -f2 -d "=" | cut -f2 -d " " |
| 53 } |
| 54 |
| 55 host_os=$(uname -s) |
| 56 case "${host_os}" in |
| 57 "Linux") |
| 58 MD5=LINUX_MD5 |
| 59 ;; |
| 60 "Darwin") |
| 61 MD5=DARWIN_MD5 |
| 62 ;; |
| 63 *) |
| 64 echo "$0: Host platform ${host_os} is not supported" >& 2 |
| 65 exit 1 |
| 66 esac |
| 67 |
45 function sync_file { | 68 function sync_file { |
46 local FILE=$1 | 69 local FILE=$1 |
47 local ANDROID_HASH=$(adb shell "md5 \"$ANDROID_V8/$FILE\"") | 70 local ANDROID_HASH=$(adb shell "md5 \"$ANDROID_V8/$FILE\"") |
48 local HOST_HASH=$(md5sum "$HOST_V8/$FILE") | 71 local HOST_HASH=$($MD5 "$HOST_V8/$FILE") |
49 if [ "${ANDROID_HASH%% *}" != "${HOST_HASH%% *}" ]; then | 72 if [ "${ANDROID_HASH%% *}" != "${HOST_HASH}" ]; then |
50 adb push "$HOST_V8/$FILE" "$ANDROID_V8/$FILE" &> /dev/null | 73 adb push "$HOST_V8/$FILE" "$ANDROID_V8/$FILE" &> /dev/null |
51 fi | 74 fi |
52 echo -n "." | 75 echo -n "." |
53 } | 76 } |
54 | 77 |
55 function sync_dir { | 78 function sync_dir { |
56 local DIR=$1 | 79 local DIR=$1 |
57 echo -n "sync to $ANDROID_V8/$DIR" | 80 echo -n "sync to $ANDROID_V8/$DIR" |
58 for FILE in $(find "$HOST_V8/$DIR" -not -path "*.svn*" -type f); do | 81 for FILE in $(find "$HOST_V8/$DIR" -not -path "*.svn*" -type f); do |
59 local RELATIVE_FILE=${FILE:${#HOST_V8}} | 82 local RELATIVE_FILE=${FILE:${#HOST_V8}} |
(...skipping 13 matching lines...) Expand all Loading... |
73 sync_file tools/csvparser.js | 96 sync_file tools/csvparser.js |
74 sync_file tools/profile.js | 97 sync_file tools/profile.js |
75 sync_file tools/splaytree.js | 98 sync_file tools/splaytree.js |
76 sync_file tools/profile_view.js | 99 sync_file tools/profile_view.js |
77 sync_file tools/logreader.js | 100 sync_file tools/logreader.js |
78 sync_file tools/tickprocessor.js | 101 sync_file tools/tickprocessor.js |
79 echo "" | 102 echo "" |
80 sync_dir test/message | 103 sync_dir test/message |
81 sync_dir test/mjsunit | 104 sync_dir test/mjsunit |
82 sync_dir test/preparser | 105 sync_dir test/preparser |
OLD | NEW |