From 5ab20de55cfd4edbf9b3543961df7c6a87235411 Mon Sep 17 00:00:00 2001 From: Philipp Kraus Date: Fri, 12 Apr 2013 23:07:01 +0200 Subject: add optional ziproot --- .hgignore | 2 ++ src/engine/SCons/Tool/zip.py | 5 +++-- src/engine/SCons/Tool/zip.xml | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.hgignore b/.hgignore index cf42e1a..8e18199 100644 --- a/.hgignore +++ b/.hgignore @@ -5,4 +5,6 @@ syntax:glob *.py[co] .sconsign* .svn +.git *~ +*.xcodeproj diff --git a/src/engine/SCons/Tool/zip.py b/src/engine/SCons/Tool/zip.py index 8e6028e..1cfe541 100644 --- a/src/engine/SCons/Tool/zip.py +++ b/src/engine/SCons/Tool/zip.py @@ -57,9 +57,9 @@ if internal_zip: for fname in filenames: path = os.path.join(dirpath, fname) if os.path.isfile(path): - zf.write(path) + zf.write(path, os.path.relpath(path, env.get('ZIPROOT', ''))) else: - zf.write(str(s)) + zf.write(str(s), os.path.relpath(str(s), env.get('ZIPROOT', ''))) zf.close() else: zipcompression = 0 @@ -88,6 +88,7 @@ def generate(env): env['ZIPCOM'] = zipAction env['ZIPCOMPRESSION'] = zipcompression env['ZIPSUFFIX'] = '.zip' + env['ZIPROOT'] = SCons.Util.CLVar('') def exists(env): return internal_zip or env.Detect('zip') diff --git a/src/engine/SCons/Tool/zip.xml b/src/engine/SCons/Tool/zip.xml index 87b8de0..85b3d52 100644 --- a/src/engine/SCons/Tool/zip.xml +++ b/src/engine/SCons/Tool/zip.xml @@ -107,3 +107,9 @@ General options passed to the zip utility. The suffix used for zip file names. + + + +An optional zip root directory (default empty). + + -- cgit v0.12