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

Unified Diff: build/android/gyp/apk_install.py

Issue 13489004: Make apk_install.py check input md5 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/gyp/apk_install.py
diff --git a/build/android/gyp/apk_install.py b/build/android/gyp/apk_install.py
index bdbfbf9213a3e07c416144429056207ea623c64e..f8e7caab8d562ec2923e2071c995544307e6dd94 100755
--- a/build/android/gyp/apk_install.py
+++ b/build/android/gyp/apk_install.py
@@ -14,7 +14,12 @@ import subprocess
import sys
from util import build_utils
+from util import md5_check
newt (away) 2013/04/04 03:07:08 is this a new file? did you forget to upload it?
cjhopman 2013/04/04 15:29:59 This was added with https://codereview.chromium.or
+BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
+sys.path.append(BUILD_ANDROID_DIR)
+
+from pylib import android_commands
def main(argv):
parser = optparse.OptionParser()
@@ -32,7 +37,14 @@ def main(argv):
'install', '-r',
options.apk_path]
- build_utils.CheckCallDie(install_cmd)
+ serial_number = android_commands.AndroidCommands().Adb().GetSerialNumber()
+ md5_stamp = '%s.%s.md5' % (options.apk_path, serial_number)
+
+ md5_checker = md5_check.Md5Checker(
+ stamp=md5_stamp, inputs=[options.apk_path], command=install_cmd)
+ if md5_checker.IsStale():
+ build_utils.CheckCallDie(install_cmd)
+ md5_checker.Write()
if options.stamp:
build_utils.Touch(options.stamp)
« 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