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')
评论列表
文章目录