diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/python/package.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/python/package.py b/src/python/package.py index 4fecce98..35f45be2 100644 --- a/src/python/package.py +++ b/src/python/package.py @@ -71,7 +71,7 @@ def add_file(tf, fname, arcname, mode, mtime): with open(fname, "rb") as f: add_fileobj(tf, f, arcname, mode, mtime) -def package(pyabc_dir, extra_bin, extra_lib, abc_exe, abc_sh, pyabc, ofname, scripts_dir, use_sys): +def package(pyabc_dir, extra_bin, extra_lib, extra_files, abc_exe, abc_sh, pyabc, ofname, scripts_dir, use_sys): mtime = time.time() @@ -106,6 +106,9 @@ def package(pyabc_dir, extra_bin, extra_lib, abc_exe, abc_sh, pyabc, ofname, scr for lib in extra_lib: add_python_lib( tf, lib_dir, lib, mtime) + for file, dest in extra_files: + add_file(tf, file, '%s/%s'%(pyabc_dir, dest), 0666, mtime) + for entry in os.listdir(pyabc): if entry.endswith('.py'): add_file( tf, os.path.join(pyabc, entry), os.path.join("%s/lib"%pyabc_dir, entry), 0666, mtime) @@ -142,6 +145,7 @@ def main(args): parser.add_option("-d", "--pyabc_dir", dest="pyabc_dir", help="name of generated directory" ) parser.add_option("-b", "--extra_bin", dest="extra_bin", help="extra binaries to pack" ) parser.add_option("-l", "--extra_lib", dest="extra_lib", help="extra directories in lib to pack" ) + parser.add_option("-f", "--extra_files", dest="extra_files", help="additional files (comma separated pairs of file:dest" ) parser.add_option("-a", "--abc", dest="abc", help="location of the ABC exeutable") parser.add_option("-s", "--abc_sh", dest="abc_sh", help="location of the ABC setup script") parser.add_option("-p", "--pyabc", dest="pyabc", help="location of pyabc.py") @@ -161,8 +165,9 @@ def main(args): extra_bin = options.extra_bin.split(',') if options.extra_bin else [] extra_lib = options.extra_lib.split(',') if options.extra_lib else [] + extra_files = [ s.split(':') for s in options.extra_files.split(',')] if options.extra_files else [] - return package(options.pyabc_dir, extra_bin, extra_lib, options.abc, options.abc_sh, options.pyabc, options.out, options.scripts, options.sys) + return package(options.pyabc_dir, extra_bin, extra_lib, extra_files, options.abc, options.abc_sh, options.pyabc, options.out, options.scripts, options.sys) if __name__=="__main__": main(sys.argv) |