Index: build/android/play_services/update.py |
diff --git a/build/android/play_services/update.py b/build/android/play_services/update.py |
index 0c48f6f265cbbd7d1c71725508431052094d1e5f..49ededa6077c02b630f043a3f6d724b2f39c1c52 100755 |
--- a/build/android/play_services/update.py |
+++ b/build/android/play_services/update.py |
@@ -29,9 +29,6 @@ import breakpad |
import download_from_google_storage |
import upload_to_google_storage |
-sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'tools')) |
-import yes_no # pylint: disable=import-error |
- |
# Directory where the SHA1 files for the zip and the license are stored |
# It should be managed by git to provided information about new versions. |
@@ -176,10 +173,10 @@ def Download(args): |
_DownloadFromBucket(bucket_path, license_sha1, new_license, |
args.verbose, args.dry_run) |
if not _CheckLicenseAgreement(new_license, old_license): |
- logging.warning('Your version of the Google Play services library is ' |
- 'not up to date. You might run into issues building ' |
- 'or running the app. Please run `%s download` to ' |
- 'retry downloading it.', __file__) |
+ logging.warning(utils.EmphasizeMessage( |
+ 'Your version of the Google Play services library is not up to ' |
+ 'date. You might run into issues building or running the app. ' |
+ 'Please run `%s download` to retry downloading it.'), __file__) |
return 0 |
new_lib_zip = os.path.join(tmp_root, LIBRARY_FILE_NAME) |
@@ -392,9 +389,18 @@ def _CheckLicenseAgreement(expected_license_path, actual_license_path): |
return True |
with open(expected_license_path) as license_file: |
- print license_file.read().replace('\\n', os.linesep) |
- |
- return yes_no.YesNo('Do you accept the license? [y/n]: ') |
dgn
2015/10/28 13:54:33
Didn't work very well from inside the hook runner.
jbudorick
2015/10/28 14:08:25
That's odd. Does that still happen when printing l
dgn
2015/10/28 14:27:13
Yes. In both cases it outputs something like:
```
jbudorick
2015/10/28 14:28:53
yikes, that seems like a bug.
|
+ # The output is buffered when running as part of gclient hooks. We split |
+ # the text here and flush is explicitely to avoid having part of it dropped |
jbudorick
2015/10/28 14:08:25
nit: explicitly
dgn
2015/10/28 16:32:58
Addressed in https://codereview.chromium.org/14185
|
+ # out. |
+ for license_part in license_file.read().split('\\n'): |
jbudorick
2015/10/28 14:08:25
nit: splitlines()
dgn
2015/10/28 16:32:58
Addressed in https://codereview.chromium.org/14185
|
+ print license_part |
+ sys.stdout.flush() |
+ |
+ # Need to put the prompt on a separate line otherwise the gclient hook buffer |
+ # only prints it after we received an input. |
+ print 'Do you accept the license? [y/n]: ' |
+ sys.stdout.flush() |
+ return raw_input('> ') in ('Y', 'y') |
def _VerifyBucketPathFormat(bucket_name, version_number, is_dry_run): |