Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4528)

Unified Diff: build/android/pylib/android_commands.py

Issue 201443017: Replace GetHostSize with a cross-platform implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 4cf996f134a724e9ad7a17825cf69b57eb6804bd..f81a446867e38bdc5f3ba4bc0c19a47aee82b3a6 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -1001,10 +1001,7 @@ class AndroidCommands(object):
if host_path_mtime == os.stat(host_path).st_mtime:
return
- def GetHostSize(path):
- return int(cmd_helper.GetCmdOutput(['du', '-sb', path]).split()[0])
-
- size = GetHostSize(host_path)
+ size = os.stat(host_path).st_size
self._pushed_files.append(device_path)
self._potential_push_size += size
@@ -1039,7 +1036,7 @@ class AndroidCommands(object):
diff_size = 0
if len(changed_files) <= MAX_INDIVIDUAL_PUSHES:
- diff_size = sum(GetHostSize(f[0]) for f in changed_files)
+ diff_size = sum(os.stat(f[0]).st_size for f in changed_files)
craigdh 2014/03/24 19:19:54 This doesn't work for directories.
# TODO(craigdh): Replace this educated guess with a heuristic that
# approximates the push time for each method.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698