summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2009-04-20 07:48:18 -0700
committerAndy McFadden <fadden@android.com>2009-04-20 13:15:23 -0700
commit0acb6a4bccfc876b0ea35dd4665986185ed3a0e1 (patch)
tree848f3a1e7b38a4229d5b0a544b46a136f5656efc /tools
parent8e319e8c2faafb8b03d1e44f9d83673c1024a089 (diff)
downloadandroid_dalvik-0acb6a4bccfc876b0ea35dd4665986185ed3a0e1.tar.gz
android_dalvik-0acb6a4bccfc876b0ea35dd4665986185ed3a0e1.tar.bz2
android_dalvik-0acb6a4bccfc876b0ea35dd4665986185ed3a0e1.zip
Correctly handle "permission denied" on device side.
Return nonzero exit status on failure. Change tabs to spaces.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dexcheck21
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/dexcheck b/tools/dexcheck
index 6495d50bc..76662e86d 100755
--- a/tools/dexcheck
+++ b/tools/dexcheck
@@ -6,6 +6,12 @@
# Get the list of files. Use "sed" to drop the trailing carriage return.
files=`adb shell "cd /data/dalvik-cache; echo *" | sed -e s/.$//`
+if [ "$files" = "*" ]; then
+ echo 'ERROR: commands must run as root on device (try "adb root" first?)'
+ exit 1
+fi
+
+failure=0
# Check each file in turn. This is much faster with "dexdump -c", but that
# was added post-cupcake.
@@ -13,13 +19,14 @@ files=`adb shell "cd /data/dalvik-cache; echo *" | sed -e s/.$//`
# The dexdump found in older builds does not stop on checksum failures and
# will likely crash.
for file in $files; do
- echo $file
- errout=`adb shell "dexdump /data/dalvik-cache/$file > dev/null"`
- errcount=`echo $errout | wc -w` > /dev/null
- if [ $errcount != "0" ]; then
- echo " Failure in $file: $errout"
- fi
+ echo $file
+ errout=`adb shell "dexdump /data/dalvik-cache/$file > dev/null"`
+ errcount=`echo $errout | wc -w` > /dev/null
+ if [ $errcount != "0" ]; then
+ echo " Failure in $file: $errout"
+ failure=1
+ fi
done
-exit 0
+exit $failure