1#!/usr/bin/env python 2# Copyright (c) 2012 The Chromium Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6""" 7A simple utility function to merge data pack files into a single data pack. See 8http://dev.chromium.org/developers/design-documents/linuxresourcesandlocalizedstrings 9for details about the file format. 10""" 11 12import optparse 13import os 14import sys 15 16if __name__ == '__main__': 17 sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) 18 19import grit.format.data_pack 20 21 22def main(argv): 23 parser = optparse.OptionParser('usage: %prog [options] <output_filename>' 24 '<input_file1> [input_file2] ...') 25 parser.add_option('--whitelist', action='store', dest='whitelist', 26 default=None, help='Full path to the whitelist used to' 27 'filter output pak file resource IDs') 28 options, file_paths = parser.parse_args(argv) 29 30 if len(file_paths) < 2: 31 parser.error('Please specify output and at least one input filenames') 32 33 grit.format.data_pack.RePack(file_paths[0], file_paths[1:], 34 whitelist_file=options.whitelist) 35 36if '__main__' == __name__: 37 main(sys.argv[1:]) 38