Chromium Code Reviews| Index: scripts/slave/zip_build.py |
| diff --git a/scripts/slave/zip_build.py b/scripts/slave/zip_build.py |
| index c02908bd4aac99a1520b69ae3689872ab78127eb..e5301aaf9e3a57ff52488083461c6afd45317918 100755 |
| --- a/scripts/slave/zip_build.py |
| +++ b/scripts/slave/zip_build.py |
| @@ -166,16 +166,19 @@ def WriteRevisionFile(dirname, build_revision): |
| except IOError: |
| print 'Writing to revision file in %s failed.' % dirname |
| - |
| def MakeUnversionedArchive(build_dir, staging_dir, zip_file_list, |
| - zip_file_name): |
| + zip_file_name, strip_files=None): |
| """Creates an unversioned full build archive. |
| Returns the path of the created archive.""" |
| + if strip_files: |
| + strip_files = [f.strip() for f in csv.reader([strip_files]).next()] |
| (zip_dir, zip_file) = chromium_utils.MakeZip(staging_dir, |
| zip_file_name, |
| zip_file_list, |
| build_dir, |
| - raise_error=True) |
| + raise_error=True, |
| + strip_files=strip_files) |
| + |
| chromium_utils.RemoveDirectory(zip_dir) |
| if not os.path.exists(zip_file): |
| raise StagingError('Failed to make zip package %s' % zip_file) |
| @@ -260,6 +263,7 @@ class PathMatcher(object): |
| self.regex_whitelist = FileRegexWhitelist(options) |
| self.regex_blacklist = FileRegexBlacklist(options) |
| self.exclude_unmatched = options.exclude_unmatched |
| + self.ignore_regex = options.ignore_regex |
| def __str__(self): |
| return '\n '.join([ |
| @@ -268,13 +272,17 @@ class PathMatcher(object): |
| 'Exclusions: %s' % self.exclusions, |
| "Whitelist regex: '%s'" % self.regex_whitelist, |
| "Blacklist regex: '%s'" % self.regex_blacklist, |
| - 'Zip unmatched files: %s' % (not self.exclude_unmatched)]) |
| + 'Zip unmatched files: %s' % (not self.exclude_unmatched), |
| + 'Ignore regex matches: %s' % (self.ignore_regex)]) |
| + |
| def Match(self, filename): |
| if filename in self.inclusions: |
| return True |
| if filename in self.exclusions: |
| return False |
| + if self.ignore_regex: |
| + return False |
| if re.match(self.regex_whitelist, filename): |
| return True |
| if re.match(self.regex_blacklist, filename): |
| @@ -286,10 +294,8 @@ def Archive(options): |
| build_dir = build_directory.GetBuildOutputDirectory( |
| options.src_dir, options.cros_board) |
| build_dir = os.path.abspath(os.path.join(build_dir, options.target)) |
| - |
| staging_dir = slave_utils.GetStagingDir(options.src_dir) |
| chromium_utils.MakeParentDirectoriesWorldReadable(staging_dir) |
| - |
| if not options.build_revision: |
| (build_revision, webkit_revision) = slave_utils.GetBuildRevisions( |
| options.src_dir, options.webkit_dir, options.revision_dir) |
| @@ -352,7 +358,7 @@ def Archive(options): |
| zip_file_list.extend(mojom_files) |
| zip_file = MakeUnversionedArchive(build_dir, staging_dir, zip_file_list, |
| - unversioned_base_name) |
| + unversioned_base_name, strip_files=options.strip_files) |
|
RobertoCN
2016/08/03 20:49:49
Is this line over 80 chars, or is it the coderevie
miimnk
2016/08/03 21:37:12
Fixed
|
| zip_base, zip_ext, versioned_file = MakeVersionedArchive( |
| zip_file, version_suffix, options) |
| @@ -399,6 +405,8 @@ def main(argv): |
| option_parser.add_option('--include-files', default='', |
| help='Comma separated list of files that should ' |
| 'always be included in the zip.') |
| + option_parser.add_option('--ignore_regex', action='store_true', |
| + default=False, help='Ignores regex matches') |
| option_parser.add_option('--master-name', help='Name of the buildbot master.') |
| option_parser.add_option('--slave-name', help='Name of the buildbot slave.') |
| option_parser.add_option('--build-number', type=int, |
| @@ -430,6 +438,9 @@ def main(argv): |
| default=False, help='Add also dSYM files.') |
| option_parser.add_option('--append-deps-patch-sha', action='store_true') |
| option_parser.add_option('--gs-acl') |
| + option_parser.add_option('--strip_files', default='', |
| + help='Comma separated list of files that should ' |
| + 'be stripped in the zip.') |
|
RobertoCN
2016/08/03 20:49:49
stripped of symbols
|
| option_parser.add_option('--json-urls', |
| help=('Path to json file containing uploaded ' |
| 'archive urls. If this is omitted then ' |