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..9dad097312f4570fd2a854f5bd1cdf1113a9d766 100644 |
--- a/build/android/pylib/utils/md5sum.py |
+++ b/build/android/pylib/utils/md5sum.py |
@@ -5,6 +5,7 @@ |
import collections |
import logging |
import os |
+import re |
import tempfile |
import types |
@@ -21,6 +22,8 @@ MD5SUM_DEVICE_SCRIPT_FORMAT = ( |
'test -f {path} -o -d {path} ' |
'&& LD_LIBRARY_PATH={md5sum_lib} {device_pie_wrapper} {md5sum_bin} {path}') |
+_STARTS_WITH_CHECKSUM_RE = re.compile(r'^\s*[0-9a-fA-f]{32}\s+') |
+ |
def CalculateHostMd5Sums(paths): |
"""Calculates the MD5 sum value for all items in |paths|. |
@@ -72,5 +75,7 @@ def CalculateDeviceMd5Sums(paths, device): |
device.adb.Push(md5sum_script_file.name, md5sum_device_script_file.name) |
out = device.RunShellCommand(['sh', md5sum_device_script_file.name]) |
- return [HashAndPath(*l.split(None, 1)) for l in out if l] |
+ return [HashAndPath(*l.split(None, 1)) |
+ for l in out |
+ if l and _STARTS_WITH_CHECKSUM_RE.match(l)] |