| Index: tools/data_pack/repack.py
|
| ===================================================================
|
| --- tools/data_pack/repack.py (revision 101223)
|
| +++ tools/data_pack/repack.py (working copy)
|
| @@ -20,30 +20,18 @@
|
| """Write a new data pack to |output_file| based on a list of filenames
|
| (|input_files|)"""
|
| resources = {}
|
| - encoding = None
|
| for filename in input_files:
|
| - new_content = data_pack.ReadDataPack(filename)
|
| + new_resources = data_pack.ReadDataPack(filename)
|
|
|
| # Make sure we have no dups.
|
| - duplicate_keys = set(new_content.resources.keys()) & set(resources.keys())
|
| + duplicate_keys = set(new_resources.keys()) & set(resources.keys())
|
| if len(duplicate_keys) != 0:
|
| raise exceptions.KeyError("Duplicate keys: " + str(list(duplicate_keys)))
|
|
|
| - # Make sure encoding is consistent.
|
| - if encoding in (None, data_pack.BINARY):
|
| - encoding = new_content.encoding
|
| - elif new_content.encoding not in (data_pack.BINARY, encoding):
|
| - raise exceptions.KeyError("Inconsistent encodings: " +
|
| - str(encoding) + " vs " +
|
| - str(new_content.encoding))
|
| + resources.update(new_resources)
|
|
|
| - resources.update(new_content.resources)
|
| + data_pack.WriteDataPack(resources, output_file)
|
|
|
| - # Encoding is 0 for BINARY, 1 for UTF8 and 2 for UTF16
|
| - if encoding is None:
|
| - encoding = data_pack.BINARY
|
| - data_pack.WriteDataPack(resources, output_file, encoding)
|
| -
|
| def main(argv):
|
| if len(argv) < 3:
|
| print ("Usage:\n %s <output_filename> <input_file1> [input_file2] ... " %
|
|
|