def reload(self, sources_list=None, metadata=None):
""" reload package list """
# check if the sourcespart is there, if not, do a full reload
# this can happen when the "partner" repository is added, it
# will be in the main sources.list already and this means that
# aptsources will just enable it instead of adding a extra
# sources.list.d file (LP: #666956)
d = apt_pkg.config.find_dir("Dir::Etc::sourceparts")
if (not sources_list or
not os.path.exists(os.path.join(d, sources_list))):
sources_list = ""
try:
trans = yield self.aptd_client.update_cache(
sources_list=sources_list, defer=True)
yield self._run_transaction(trans, None, None, None, metadata)
except Exception as error:
self._on_trans_error(error)
# note that the cache re-open will happen via the connected
# "transaction-finished" signal
评论列表
文章目录