dnf_backend.py 文件源码

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

项目:dnfdragora 作者: manatools 项目源码 文件源码
def _cacheProtected(self) :
        '''
        gets all the protected packages
        '''
        self._protected = []
        protected_conf_path='/etc/dnf/protected.d'
        conf_files = listdir(protected_conf_path)
        for f in conf_files :
            file_path = protected_conf_path + '/' + f
            with open(file_path, 'r') as content_file:
                for line in content_file:
                    if line.strip() :
                        match_all = False
                        newest_only = False
                        tags =""
                        pkgs = self.get_packages_by_name(line.strip(), newest_only)

                        for pkg in pkgs:
                            pkg_id = pkg.pkg_id
                            if (not pkg_id in self._protected) :
                                self._protected.append(pkg_id)
                        # TODO it would be better to get recursive require
                        #for pkg_id in self._protected:
                            #recursive_id = self.GetAttribute(pkg_id,'requires')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号