summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorChirayu Desai <cdesai@cyanogenmod.org>2012-12-26 10:53:58 +0530
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2013-01-08 20:58:29 -0800
commitfdc7dc5bebcced20d13b3e0630352990a0aaa039 (patch)
tree2ad049e66c2f18a8e3a36416ed59977a0a6c7bd2 /envsetup.sh
parent01a61843642f409d2afdd3f79a88a71f3e0ec766 (diff)
downloadbuild-fdc7dc5bebcced20d13b3e0630352990a0aaa039.zip
build-fdc7dc5bebcced20d13b3e0630352990a0aaa039.tar.gz
build-fdc7dc5bebcced20d13b3e0630352990a0aaa039.tar.bz2
envsetup: push to connected device only if it is $CM_BUILD
Change-Id: Icce057cb31d6fbc9abb0292311c88c32fea3540c
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 15faab9..a885643 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -672,6 +672,8 @@ function eat()
done
echo "Device Found.."
fi
+ if (adb shell cat /system/build.prop | grep -q "ro.cm.device=$CM_BUILD");
+ then
# if adbd isn't root we can't write to /cache/recovery/
adb root
sleep 1
@@ -694,6 +696,9 @@ EOF
return 1
fi
return $?
+ else
+ echo "The connected device does not appear to be $CM_BUILD, run away!"
+ fi
}
function omnom
@@ -1754,6 +1759,8 @@ function dopush()
echo "Device Found."
fi
+ if (adb shell cat /system/build.prop | grep -q "ro.cm.device=$CM_BUILD");
+ then
adb root &> /dev/null
sleep 0.3
adb wait-for-device &> /dev/null
@@ -1792,6 +1799,9 @@ function dopush()
done
rm -f $OUT/.log
return 0
+ else
+ echo "The connected device does not appear to be $CM_BUILD, run away!"
+ fi
}
alias mmp='dopush mm'