Home | History | Annotate | Download | only in build_tools

Lines Matching defs:Archive

21 # Valid values for the archive.host_os field
62 '''Download the archive data from from-stream and generate sha1 and
75 A tuple (sha1, size) where sha1 is a sha1-hash for the archive data and
76 size is the size of the archive data in bytes.'''
105 class Archive(dict):
106 """A placeholder for sdk archive information. We derive Archive from
110 """ Create a new archive for the given host-os name. """
111 super(Archive, self).__init__()
115 """Update the content of the archive by copying values from the given
119 src: The dictionary whose values must be copied to the archive."""
124 """Validate the content of the archive object. Raise an Error if
129 found in the archive.
133 raise Error('Invalid host-os name in archive')
138 raise Error('Archive "%s" has no URL' % host_os)
140 raise Error('Archive "%s" has no size' % host_os)
143 raise Error('Archive "%s" has no checksum' % host_os)
145 raise Error('Archive "%s" has a checksum, but it is not a dict' % host_os)
147 raise Error('Archive "%s" has an empty checksum dict' % host_os)
152 raise Error('Archive "%s" has invalid attribute "%s"' % (
156 """Update the size and checksum information for this archive
200 """Returns a given cryptographic checksum of the archive"""
231 for archive in v:
232 self.get(k, []).append(archive)
262 new_archive = Archive(a['host_os'])
306 for archive in self[ARCHIVES_KEY]:
307 if add_missing_info and 'size' not in archive:
308 archive.UpdateVitals(self[REVISION_KEY])
309 archive.Validate(error_on_unknown_keys)
312 """Retrieve the archive for the given host os.
315 host_os_name: name of host os whose archive must be retrieved.
317 An Archive instance or None if it doesn't exist."""
318 for archive in self[ARCHIVES_KEY]:
319 if archive.host_os == host_os_name or archive.host_os == 'all':
320 return archive
324 """Retrieve the archive for the current host os."""
330 return [archive for archive in self.GetArchives()
331 if archive.host_os in (GetHostOS(), 'all')]
337 def AddArchive(self, archive):
338 """Add an archive to this bundle."""
339 self[ARCHIVES_KEY].append(archive)
346 """Remove an archive from this Bundle."""
350 for i, archive in enumerate(self[ARCHIVES_KEY]):
351 if archive.host_os == host_os_name:
399 for archive in self[key]:
400 if archive != bundle.GetArchive(archive.host_os):