diff options
author | Hal Canary <halcanary@google.com> | 2018-02-05 15:58:03 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-06 19:48:55 +0000 |
commit | 703d9c47a8f3e47514eaefeb4939bc02004fef5e (patch) | |
tree | bb06ff6e11e76a84d80ac4a78932e49ed78f1e34 /tools/skqp | |
parent | 02dcf3280e018abfb527745ec6b9414e7438cb4a (diff) |
SkQP: download_model complains when files.checksum is missing
Change-Id: I4fad015181f15e4ffb9c9607723a1313a041621b
Reviewed-on: https://skia-review.googlesource.com/103763
Reviewed-by: Stephan Altmueller <stephana@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tools/skqp')
-rwxr-xr-x | tools/skqp/download_model | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/skqp/download_model b/tools/skqp/download_model index c18ebfa428..209f550590 100755 --- a/tools/skqp/download_model +++ b/tools/skqp/download_model @@ -43,11 +43,14 @@ def tmp(prefix): return path def main(): - os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, - 'platform_tools', 'android', 'apps', 'skqp', 'src', - 'main', 'assets')) + target_dir = os.path.join('platform_tools', 'android', 'apps', 'skqp', 'src', 'main', 'assets') + os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, target_dir)) + checksum_path = 'files.checksum' + if not os.path.isfile(checksum_path): + sys.stderr.write('Error: "%s" is missing.\n' % os.path.join(target_dir, checksum_path)) + sys.exit(1) file_list_file = tmp('files_') - with open('files.checksum', 'r') as f: + with open(checksum_path, 'r') as f: md5 = f.read().strip() assert(len(md5) == 32) download(md5, file_list_file) |