OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Set of common operations/utilities for build archiving.""" | 5 """Set of common operations/utilities for build archiving.""" |
6 | 6 |
7 import glob | 7 import glob |
8 import os | 8 import os |
9 import platform | 9 import platform |
10 import re | 10 import re |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 return (len(archive_list) == 1 and | 130 return (len(archive_list) == 1 and |
131 (fileobj['filename'] == fileobj['archive'] or | 131 (fileobj['filename'] == fileobj['archive'] or |
132 fileobj.get('direct_archive'))) | 132 fileobj.get('direct_archive'))) |
133 | 133 |
134 def IsOptional(self, filename): | 134 def IsOptional(self, filename): |
135 """Determine if the given filename is marked optional for this config.""" | 135 """Determine if the given filename is marked optional for this config.""" |
136 found_optional = False | 136 found_optional = False |
137 for fileobj in self._files_list: | 137 for fileobj in self._files_list: |
138 if fileobj['filename'] == filename: | 138 if fileobj['filename'] == filename: |
139 found_optional = True | 139 found_optional = True |
140 if self._buildtype not in fileobj['optional']: | 140 if self._buildtype not in fileobj.get('optional', []): |
141 return False | 141 return False |
142 return found_optional | 142 return found_optional |
143 | 143 |
144 def ParseGroup(self, filegroup): | 144 def ParseGroup(self, filegroup): |
145 """Return the list of filenames in the given group (e.g. "symbols").""" | 145 """Return the list of filenames in the given group (e.g. "symbols").""" |
146 return [fileobj['filename'] for fileobj in self._files_list | 146 return [fileobj['filename'] for fileobj in self._files_list |
147 if (fileobj.get('filegroup') and filegroup in fileobj.get('filegroup')) | 147 if (fileobj.get('filegroup') and filegroup in fileobj.get('filegroup')) |
148 ] | 148 ] |
149 | 149 |
150 def ParseArchiveLists(self): | 150 def ParseArchiveLists(self): |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 raise_error=not allow_missing) | 325 raise_error=not allow_missing) |
326 if not os.path.exists(zip_file): | 326 if not os.path.exists(zip_file): |
327 raise StagingError('Failed to make zip package %s' % zip_file) | 327 raise StagingError('Failed to make zip package %s' % zip_file) |
328 | 328 |
329 if os.path.basename(zip_file) != archive_name: | 329 if os.path.basename(zip_file) != archive_name: |
330 orig_zip = zip_file | 330 orig_zip = zip_file |
331 zip_file = os.path.join(os.path.dirname(orig_zip), archive_name) | 331 zip_file = os.path.join(os.path.dirname(orig_zip), archive_name) |
332 print 'Renaming archive: "%s" -> "%s"' % (orig_zip, zip_file) | 332 print 'Renaming archive: "%s" -> "%s"' % (orig_zip, zip_file) |
333 chromium_utils.MoveFile(orig_zip, zip_file) | 333 chromium_utils.MoveFile(orig_zip, zip_file) |
334 return (zip_dir, zip_file) | 334 return (zip_dir, zip_file) |
OLD | NEW |