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

Side by Side Diff: build/android/gyp/util/build_utils.py

Issue 326393004: Check the path in the zip archive not the path to the file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import contextlib 5 import contextlib
6 import fnmatch 6 import fnmatch
7 import json 7 import json
8 import os 8 import os
9 import pipes 9 import pipes
10 import shlex 10 import shlex
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 raise Exception( 190 raise Exception(
191 'Path already exists from zip: %s %s %s' 191 'Path already exists from zip: %s %s %s'
192 % (zip_path, name, output_path)) 192 % (zip_path, name, output_path))
193 193
194 z.extractall(path=path) 194 z.extractall(path=path)
195 195
196 196
197 def DoZip(inputs, output, base_dir): 197 def DoZip(inputs, output, base_dir):
198 with zipfile.ZipFile(output, 'w') as outfile: 198 with zipfile.ZipFile(output, 'w') as outfile:
199 for f in inputs: 199 for f in inputs:
200 CheckZipPath(f) 200 CheckZipPath(os.path.relpath(f, base_dir))
201 outfile.write(f, os.path.relpath(f, base_dir)) 201 outfile.write(f, os.path.relpath(f, base_dir))
202 202
203 203
204 def PrintWarning(message): 204 def PrintWarning(message):
205 print 'WARNING: ' + message 205 print 'WARNING: ' + message
206 206
207 207
208 def PrintBigWarning(message): 208 def PrintBigWarning(message):
209 print '***** ' * 8 209 print '***** ' * 8
210 PrintWarning(message) 210 PrintWarning(message)
211 print '***** ' * 8 211 print '***** ' * 8
OLDNEW
« 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