@@ -0,0 +1,117 @@
+--- dumpMetadata.py
++++ dumpMetadata.py
+@@ -267,14 +267,10 @@
+ return returnflags
+
+ if type(flags) is not types.ListType:
+- newflag = flags & 0xf
+- returnflags.append(newflag)
++ returnflags.append(flags)
+ else:
+ for flag in flags:
+- newflag = flag
+- if flag is not None:
+- newflag = flag & 0xf
+- returnflags.append(newflag)
++ returnflags.append(flag)
+ return returnflags
+
+ def _checkPreReq(self, flags):
+@@ -516,36 +512,48 @@
+ lst = zip(names, flags, ver, prereq)
+ return self._uniq(lst)
+
+- def obsoletesList(self):
++ def tagsList(self, name, flags, version):
+ lst = []
+- names = self.hdr[rpm.RPMTAG_OBSOLETENAME]
+- tmpflags = self.hdr[rpm.RPMTAG_OBSOLETEFLAGS]
++ names = self.hdr[name]
++ tmpflags = self.hdr[flags]
+ flags = self._correctFlags(tmpflags)
+- ver = self._correctVersion(self.hdr[rpm.RPMTAG_OBSOLETEVERSION])
++ ver = self._correctVersion(self.hdr[version])
+ if names is not None:
+ lst = zip(names, flags, ver)
+ return self._uniq(lst)
+
++ def obsoletesList(self):
++ return self.tagsList(rpm.RPMTAG_OBSOLETENAME, rpm.RPMTAG_OBSOLETEFLAGS,
++ rpm.RPMTAG_OBSOLETEVERSION)
++
+ def conflictsList(self):
+- lst = []
+- names = self.hdr[rpm.RPMTAG_CONFLICTNAME]
+- tmpflags = self.hdr[rpm.RPMTAG_CONFLICTFLAGS]
+- flags = self._correctFlags(tmpflags)
+- ver = self._correctVersion(self.hdr[rpm.RPMTAG_CONFLICTVERSION])
+- if names is not None:
+- lst = zip(names, flags, ver)
+- return self._uniq(lst)
++ return self.tagsList(rpm.RPMTAG_CONFLICTNAME, rpm.RPMTAG_CONFLICTFLAGS,
++ rpm.RPMTAG_CONFLICTVERSION)
+
+ def providesList(self):
+- lst = []
+- names = self.hdr[rpm.RPMTAG_PROVIDENAME]
+- tmpflags = self.hdr[rpm.RPMTAG_PROVIDEFLAGS]
+- flags = self._correctFlags(tmpflags)
+- ver = self._correctVersion(self.hdr[rpm.RPMTAG_PROVIDEVERSION])
+- if names is not None:
+- lst = zip(names, flags, ver)
+- return self._uniq(lst)
++ return self.tagsList(rpm.RPMTAG_PROVIDENAME, rpm.RPMTAG_PROVIDEFLAGS,
++ rpm.RPMTAG_PROVIDEVERSION)
+
++ def enhancesList(self):
++ lst = self.tagsList(rpm.RPMTAG_ENHANCESNAME, rpm.RPMTAG_ENHANCESFLAGS,
++ rpm.RPMTAG_ENHANCESVERSION)
++ return [ l for l in lst if not l[1] & rpm.RPMSENSE_STRONG ]
++
++ def supplementsList(self):
++ lst = self.tagsList(rpm.RPMTAG_ENHANCESNAME, rpm.RPMTAG_ENHANCESFLAGS,
++ rpm.RPMTAG_ENHANCESVERSION)
++ return [ l for l in lst if l[1] & rpm.RPMSENSE_STRONG ]
++
++ def suggestsList(self):
++ lst = self.tagsList(rpm.RPMTAG_SUGGESTSNAME, rpm.RPMTAG_SUGGESTSFLAGS,
++ rpm.RPMTAG_SUGGESTSVERSION)
++ return [ l for l in lst if not l[1] & rpm.RPMSENSE_STRONG ]
++
++ def recommendsList(self):
++ lst = self.tagsList(rpm.RPMTAG_SUGGESTSNAME, rpm.RPMTAG_SUGGESTSFLAGS,
++ rpm.RPMTAG_SUGGESTSVERSION)
++ return [ l for l in lst if l[1] & rpm.RPMSENSE_STRONG ]
++
+ def changelogLists(self):
+ lst = []
+ names = self.listTagByName('changelogname')
+@@ -629,12 +637,18 @@
+ hr.newProp('end', str(rpmObj.rangeend))
+ for (lst, nodename) in [(rpmObj.providesList(), 'provides'),
+ (rpmObj.conflictsList(), 'conflicts'),
+- (rpmObj.obsoletesList(), 'obsoletes')]:
++ (rpmObj.obsoletesList(), 'obsoletes'),
++ (rpmObj.enhancesList(), 'enhances'),
++ (rpmObj.supplementsList(), 'supplements'),
++ (rpmObj.suggestsList(), 'suggests'),
++ (rpmObj.recommendsList(), 'recommends')]:
+ if len(lst) > 0:
+ rpconode = format.newChild(formatns, nodename, None)
+ for (name, flags, (e,v,r)) in lst:
+ entry = rpconode.newChild(formatns, 'entry', None)
+ entry.newProp('name', name)
++ if flags is not None:
++ flags = flags & 0xf
+ if flags != 0:
+ if flags == 2: arg = 'LT'
+ if flags == 4: arg = 'GT'
+@@ -656,6 +670,8 @@
+ for (name, flags, (e,v,r), prereq) in depsList:
+ entry = rpconode.newChild(formatns, 'entry', None)
+ entry.newProp('name', name)
++ if flags is not None:
++ flags = flags & 0xf
+ if flags != 0:
+ if flags == 2: arg = 'LT'
+ if flags == 4: arg = 'GT'
|