def init_channels(self, binaries=()):
"""Initialize the Apt channels as needed.
@param binaries: A possibly empty list of 3-tuples of the form
(hash, id, deb), holding the hash, the id and the content of
additional Debian packages that should be loaded in the channels.
"""
binaries_path = self._config.binaries_path
# Clean up the binaries we wrote in former runs
self._clear_binaries()
if binaries:
hash_ids = {}
for hash, id, deb in binaries:
create_binary_file(os.path.join(binaries_path, "%d.deb" % id),
base64.decodestring(deb))
hash_ids[hash] = id
self._store.set_hash_ids(hash_ids)
self._facade.add_channel_deb_dir(binaries_path)
self._facade.reload_channels(force_reload_binaries=True)
self._facade.ensure_channels_reloaded()
评论列表
文章目录