aptd.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:x-mario-center 作者: fossasia 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号