Index: scripts/slave/zip_build.py |
diff --git a/scripts/slave/zip_build.py b/scripts/slave/zip_build.py |
index e379cc72631d86e6723bd3b6ab0a96ae30a0f269..c61f6b304f076966dea6c29a4275f2049cd86d32 100755 |
--- a/scripts/slave/zip_build.py |
+++ b/scripts/slave/zip_build.py |
@@ -194,14 +194,30 @@ def WriteRevisionFile(dirname, build_revision): |
def MakeUnversionedArchive(build_dir, staging_dir, zip_file_list, |
- zip_file_name): |
+ zip_file_name, filters): |
"""Creates an unversioned full build archive. |
Returns the path of the created archive.""" |
+ replacements = [] |
+ if 'asan' in filters: |
+ def ASANFilter(path): |
+ parts = path.split('.', 1) |
+ if len(parts) == 1: |
+ return path |
+ if parts[-1].startswith('asan'): # skip 'foo.asan.exe' entirely |
+ return None |
+ parts.insert(1, 'asan') |
+ asan_path = '.'.join(parts) |
+ if os.path.exists(asan_path): |
+ return asan_path |
+ return path |
+ replacements.append(ASANFilter) |
+ |
(zip_dir, zip_file) = chromium_utils.MakeZip(staging_dir, |
zip_file_name, |
zip_file_list, |
build_dir, |
- raise_error=True) |
+ raise_error=True, |
+ replacements=replacements) |
chromium_utils.RemoveDirectory(zip_dir) |
if not os.path.exists(zip_file): |
raise StagingError('Failed to make zip package %s' % zip_file) |
@@ -319,7 +335,7 @@ def Archive(options): |
zip_file_list = [f for f in root_files if path_filter.Match(f)] |
zip_file = MakeUnversionedArchive(build_dir, staging_dir, zip_file_list, |
- unversioned_base_name) |
+ unversioned_base_name, options.filters) |
zip_base, zip_ext = MakeVersionedArchive(zip_file, version_suffix, options) |
PruneOldArchives(staging_dir, zip_base, zip_ext) |
@@ -349,6 +365,9 @@ def main(argv): |
'always be included in the zip.')) |
option_parser.add_option('--webkit-dir', |
help='webkit directory path, relative to --src-dir') |
+ option_parser.add_option('--filters', action='append', default=[], |
+ help='Filters to apply to build zip ' |
+ '(avail: "asan").') |
chromium_utils.AddPropertiesOptions(option_parser) |
options, args = option_parser.parse_args(argv) |
@@ -364,6 +383,10 @@ def main(argv): |
if args[1:]: |
print 'Warning -- unknown arguments' % args[1:] |
+ if options.factory_properties.get('asan'): |
+ options.filters.append('asan') |
+ options.filters = set(options.filters) |
+ |
return Archive(options) |
if '__main__' == __name__: |