Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: tools/android-sync.sh

Issue 10806063: Android test runner: Make android-sync.sh work on Mac (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android-sync.sh
===================================================================
--- tools/android-sync.sh (revision 12171)
+++ tools/android-sync.sh (working copy)
@@ -33,7 +33,7 @@
# The fourth argument is the absolute path to the V8 directory on the device.
if [ ${#@} -lt 4 ] ; then
- echo "Error: need 4 arguments"
+ echo "$0: Error: need 4 arguments"
exit 1
fi
@@ -42,11 +42,34 @@
HOST_V8=$3
ANDROID_V8=$4
+function LINUX_MD5 {
+ local HASH=$(md5sum $1)
+ echo ${HASH%% *}
+}
+
+function DARWIN_MD5 {
+ local HASH=$(md5 $1)
+ echo ${HASH} | cut -f2 -d "=" | cut -f2 -d " "
+}
+
+host_os=$(uname -s)
+case "${host_os}" in
+ "Linux")
+ MD5=LINUX_MD5
+ ;;
+ "Darwin")
+ MD5=DARWIN_MD5
+ ;;
+ *)
+ echo "$0: Host platform ${host_os} is not supported" >& 2
+ exit 1
+esac
+
function sync_file {
local FILE=$1
local ANDROID_HASH=$(adb shell "md5 \"$ANDROID_V8/$FILE\"")
- local HOST_HASH=$(md5sum "$HOST_V8/$FILE")
- if [ "${ANDROID_HASH%% *}" != "${HOST_HASH%% *}" ]; then
+ local HOST_HASH=$($MD5 "$HOST_V8/$FILE")
+ if [ "${ANDROID_HASH%% *}" != "${HOST_HASH}" ]; then
adb push "$HOST_V8/$FILE" "$ANDROID_V8/$FILE" &> /dev/null
fi
echo -n "."
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698