Make file capabilities available in PkgFile (rpm >= 4.7.0, Ludwig Nussel).

git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1813 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
Ville Skyttä 2010-11-04 16:44:11 +00:00
parent ba1ffcbb97
commit 5b31f7ebd0
1 changed files with 7 additions and 0 deletions

7
Pkg.py
View File

@ -603,6 +603,10 @@ class Pkg:
provides = self.header[rpm.RPMTAG_FILEPROVIDE]
files = self.header[rpm.RPMTAG_FILENAMES]
magics = self.header[rpm.RPMTAG_FILECLASS]
try: # rpm >= 4.7.0
filecaps = self.header[rpm.RPMTAG_FILECAPS]
except:
filecaps = None
# rpm-python < 4.6 does not return a list for this (or FILEDEVICES,
# FWIW) for packages containing exactly one file
@ -641,6 +645,8 @@ class Pkg:
# for example Fedora's rpmbuild as of F-11's 4.7.1 is
# patched so it generates them.
pkgfile.magic = ''
if filecaps:
pkgfile.filecaps = filecaps[idx]
self._files[pkgfile.name] = pkgfile
# API to access dependency information
@ -806,6 +812,7 @@ class PkgFile(object):
self.provides = []
self.lang = ''
self.magic = ''
self.filecaps = None
# TODO: decompression support