summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorilevy@chromium.org <ilevy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 21:07:30 +0000
committerilevy@chromium.org <ilevy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 21:07:30 +0000
commit19cfda967ded48c88c7f8527fd8fcc6c6fbb9760 (patch)
tree9332752126cb35a374dd01c1f9f844e938a69974 /build
parente17b7c6a87763da5d2aec2eb0a607263083a9c96 (diff)
downloadchromium_src-19cfda967ded48c88c7f8527fd8fcc6c6fbb9760.zip
chromium_src-19cfda967ded48c88c7f8527fd8fcc6c6fbb9760.tar.gz
chromium_src-19cfda967ded48c88c7f8527fd8fcc6c6fbb9760.tar.bz2
Android device status: create out dir if needed
- I recently changed device status to run before gyp This exposed a dependence on the out directory existing and broke new android testers. TEST=Ran device status with --out-dir pointing to non-existent dir. R=bulach@chromium.org BUG= Review URL: https://codereview.chromium.org/10962022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/device_status_check.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/build/android/device_status_check.py b/build/android/device_status_check.py
index 673fbe8..b3447ca 100755
--- a/build/android/device_status_check.py
+++ b/build/android/device_status_check.py
@@ -58,9 +58,8 @@ def CheckForMissingDevices(options, adb_online_devs):
adb_online_devs: A list of serial numbers of the currently visible
and online attached devices.
"""
-
- last_devices_path = os.path.abspath(os.path.join(options.out_dir,
- '.last_devices'))
+ out_dir = os.path.abspath(options.out_dir)
+ last_devices_path = os.path.join(out_dir, '.last_devices')
last_devices = []
try:
with open(last_devices_path) as f:
@@ -89,8 +88,10 @@ def CheckForMissingDevices(options, adb_online_devs):
print ('New devices detected %s. And now back to your '
'regularly scheduled program.' % list(new_devs))
- # Write devices currently visible plus devices previously seen.
+ if not os.path.exists(out_dir):
+ os.makedirs(out_dir)
with open(last_devices_path, 'w') as f:
+ # Write devices currently visible plus devices previously seen.
f.write('\n'.join(set(adb_online_devs + last_devices)))