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

Side by Side Diff: tools/data_pack/repack.py

Issue 27216: Handle repack.py and .pak files in the GYP-based build. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « chrome/chrome.gyp ('k') | 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 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2008 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2008 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A simple utility function to merge data pack files into a single data pack. 6 """A simple utility function to merge data pack files into a single data pack.
7 See base/pack_file* for details about the file format. 7 See base/pack_file* for details about the file format.
8 """ 8 """
9 9
10 import exceptions 10 import exceptions
(...skipping 12 matching lines...) Expand all
23 # Make sure we have no dups. 23 # Make sure we have no dups.
24 duplicate_keys = set(new_resources.keys()) & set(resources.keys()) 24 duplicate_keys = set(new_resources.keys()) & set(resources.keys())
25 if len(duplicate_keys) != 0: 25 if len(duplicate_keys) != 0:
26 raise exceptions.KeyError("Duplicate keys: " + str(list(duplicate_keys))) 26 raise exceptions.KeyError("Duplicate keys: " + str(list(duplicate_keys)))
27 27
28 resources.update(new_resources) 28 resources.update(new_resources)
29 29
30 data_pack.WriteDataPack(resources, output_file) 30 data_pack.WriteDataPack(resources, output_file)
31 31
32 def main(argv): 32 def main(argv):
33 if len(argv) < 4: 33 if len(argv) < 3:
34 print ("Usage:\n %s <output_filename> <input_file1> <input_file2> " 34 print ("Usage:\n %s <output_filename> <input_file1> [input_file2] ... " %
35 "[input_file3] ..." % argv[0]) 35 argv[0])
36 sys.exit(-1) 36 sys.exit(-1)
37 RePack(argv[1], argv[2:]) 37 RePack(argv[1], argv[2:])
38 38
39 if '__main__' == __name__: 39 if '__main__' == __name__:
40 main(sys.argv) 40 main(sys.argv)
OLDNEW
« no previous file with comments | « chrome/chrome.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698