Index: build/android/pylib/utils/md5sum.py |
diff --git a/build/android/pylib/utils/md5sum.py b/build/android/pylib/utils/md5sum.py |
index da3cd15c785b0da5a2382816078d6817f63fc7aa..9d9d3caa50cfad65e71b6aa8190ced2d2a4a1475 100644 |
--- a/build/android/pylib/utils/md5sum.py |
+++ b/build/android/pylib/utils/md5sum.py |
@@ -33,9 +33,13 @@ def CalculateHostMd5Sums(paths): |
if isinstance(paths, basestring): |
paths = [paths] |
+ md5sum_bin_host_path = os.path.join( |
+ constants.GetOutDirectory(), 'md5sum_bin_host') |
+ if not os.path.exists(md5sum_bin_host_path): |
+ raise OSError('File not built: %s' % md5sum_bin_host_path) |
+ |
out = cmd_helper.GetCmdOutput( |
- [os.path.join(constants.GetOutDirectory(), 'md5sum_bin_host')] + |
- [p for p in paths]) |
+ [md5sum_bin_host_path] + [p for p in paths]) |
return [HashAndPath(*l.split(None, 1)) for l in out.splitlines()] |
@@ -50,10 +54,12 @@ def CalculateDeviceMd5Sums(paths, device): |
if isinstance(paths, basestring): |
paths = [paths] |
+ md5sum_dist_path = os.path.join(constants.GetOutDirectory(), 'md5sum_dist') |
+ if not os.path.exists(md5sum_dist_path): |
+ raise OSError('File not built: %s' % md5sum_dist_path) |
+ |
if not device.FileExists(MD5SUM_DEVICE_BIN_PATH): |
- device.adb.Push( |
- os.path.join(constants.GetOutDirectory(), 'md5sum_dist'), |
- MD5SUM_DEVICE_LIB_PATH) |
+ device.adb.Push(md5sum_dist_path, MD5SUM_DEVICE_LIB_PATH) |
out = [] |