Re: Provide Flags
seth vidal <skvidal-c/MNwgJ9CEH2fBVCVOL8/[email protected]> Wed, 31 Mar 2004 14:33:54 -0500
| Newsgroups | gmane.linux.redhat.rpm.python |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2004-03-31 at 14:23, Adam T. Gautier wrote:
> Does anyone know or where I can find some information out about the
> values of the rpm flags rpm.PROVIDEFLAGS, rpm.REQUIREFLAGS,
> rpm.CONFLICTFLAGS, and rpm.OBSOLETEFLAGS? I am looking for some sort of
> map between the flag values and description.
>
http://devel.linux.duke.edu/cgi-bin/viewcvs.cgi/generate/dumpMetadata.py?rev=1.10&cvsroot=metadata&content-type=text/vnd.viewcvs-markup
Look at:
def _correctFlags(self, flags):
returnflags=[]
if flags is None:
return returnflags
if type(flags) is not types.ListType:
newflag = flags & 0xf
returnflags.append(newflag)
else:
for flag in flags:
newflag = flag
if flag is not None:
newflag = flag & 0xf
returnflags.append(newflag)
return returnflags
and
if flags != 0:
if flags == 2: arg = 'LT'
if flags == 4: arg = 'GT'
if flags == 8: arg = 'EQ'
if flags == 10: arg = 'LE'
if flags == 12: arg = 'GE'
in that code.
you convert the flag to dump out things that might be there that you don't need
then you check the flag number and the little if above is the mapping.
-sv