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

Unified Diff: platform_tools/android/bin/android_setup.sh

Issue 1806343003: Fix gdb debugging for the latest NDK release. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « platform_tools/android/bin/android_gdbserver ('k') | platform_tools/android/bin/utils/setup_adb.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/bin/android_setup.sh
diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh
index 3af118ef65f4c09f463abe26d0142d8431e490d0..4b7a60f84a4d13055974f8d6035aa9a333efaef1 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -219,6 +219,11 @@ adb_push_if_needed() {
local HOST_SRC="$1"
local ANDROID_DST="$2"
+ # disable crashing on failed commands since newer (N+) versions of Android
+ # return an error when attempting to run ls on a directory or file that does
+ # not exist.
+ set +e
+
ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST`
HOST_LS=`ls -ld $HOST_SRC`
if [ "${ANDROID_LS:0:1}" == "d" -a "${HOST_LS:0:1}" == "-" ];
@@ -226,12 +231,11 @@ adb_push_if_needed() {
ANDROID_DST="${ANDROID_DST}/$(basename ${HOST_SRC})"
fi
-
- ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST`
+ ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST 2> /dev/null`
if [ "${ANDROID_LS:0:1}" == "-" ]; then
#get the MD5 for dst and src depending on OS and/or OS revision
- ANDROID_MD5_SUPPORT=`$ADB $DEVICE_SERIAL shell ls -ld /system/bin/md5`
- if [ "${ANDROID_MD5_SUPPORT:0:15}" != "/system/bin/md5" ]; then
+ ANDROID_MD5_SUPPORT=`$ADB $DEVICE_SERIAL shell ls -ld /system/bin/md5 2> /dev/null`
+ if [ "${ANDROID_MD5_SUPPORT:0:1}" == "-" ]; then
ANDROID_MD5=`$ADB $DEVICE_SERIAL shell md5 $ANDROID_DST`
else
ANDROID_MD5=`$ADB $DEVICE_SERIAL shell md5sum $ANDROID_DST`
@@ -262,6 +266,9 @@ adb_push_if_needed() {
$ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST
fi
fi
+
+ # turn error checking back on
+ set -e
}
setup_device "${DEVICE_ID}"
« no previous file with comments | « platform_tools/android/bin/android_gdbserver ('k') | platform_tools/android/bin/utils/setup_adb.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698