2017-09-28 22:18:14 +02:00
|
|
|
Index: rpmlint-rpmlint-1.10/Pkg.py
|
|
|
|
===================================================================
|
2017-09-28 13:35:09 +02:00
|
|
|
--- rpmlint-rpmlint-1.10.orig/Pkg.py
|
|
|
|
+++ rpmlint-rpmlint-1.10/Pkg.py
|
|
|
|
@@ -494,6 +494,10 @@ class Pkg(AbstractPkg):
|
2009-08-28 22:12:54 +02:00
|
|
|
self._missingok_files = None
|
|
|
|
self._files = None
|
|
|
|
self._requires = None
|
|
|
|
+ self._suggests = None
|
|
|
|
+ self._supplements = None
|
|
|
|
+ self._enhances = None
|
|
|
|
+ self._recommends = None
|
|
|
|
self._req_names = -1
|
2008-05-01 14:19:31 +02:00
|
|
|
|
|
|
|
if header:
|
2017-09-28 13:35:09 +02:00
|
|
|
@@ -771,6 +775,22 @@ class Pkg(AbstractPkg):
|
2008-05-01 14:19:31 +02:00
|
|
|
self._gatherDepInfo()
|
|
|
|
return self._requires
|
|
|
|
|
|
|
|
+ def recommends(self):
|
|
|
|
+ self._gatherDepInfo()
|
|
|
|
+ return self._recommends
|
|
|
|
+
|
|
|
|
+ def suggests(self):
|
|
|
|
+ self._gatherDepInfo()
|
|
|
|
+ return self._suggests
|
|
|
|
+
|
|
|
|
+ def supplements(self):
|
|
|
|
+ self._gatherDepInfo()
|
|
|
|
+ return self._supplements
|
|
|
|
+
|
|
|
|
+ def enhances(self):
|
|
|
|
+ self._gatherDepInfo()
|
|
|
|
+ return self._enhances
|
|
|
|
+
|
|
|
|
def prereq(self):
|
2017-09-28 13:35:09 +02:00
|
|
|
"""
|
|
|
|
Get package PreReqs as list of
|
|
|
|
@@ -845,7 +865,7 @@ class Pkg(AbstractPkg):
|
2008-05-01 14:19:31 +02:00
|
|
|
|
|
|
|
# internal function to gather dependency info used by the above ones
|
2010-10-14 14:32:03 +02:00
|
|
|
def _gather_aux(self, header, list, nametag, flagstag, versiontag,
|
2015-04-10 16:35:46 +02:00
|
|
|
- prereq=None):
|
2010-04-01 16:20:38 +02:00
|
|
|
+ prereq = None, strong_only = False, weak_only = False):
|
2008-05-01 14:19:31 +02:00
|
|
|
names = header[nametag]
|
|
|
|
flags = header[flagstag]
|
2010-10-14 14:32:03 +02:00
|
|
|
versions = header[versiontag]
|
2017-09-28 13:35:09 +02:00
|
|
|
@@ -856,7 +876,11 @@ class Pkg(AbstractPkg):
|
2015-04-10 16:35:46 +02:00
|
|
|
evr = stringToVersion(b2s(versions[loop]))
|
2009-08-28 22:12:54 +02:00
|
|
|
if prereq is not None and flags[loop] & PREREQ_FLAG:
|
2014-02-21 15:54:14 +01:00
|
|
|
prereq.append((name, flags[loop] & (~PREREQ_FLAG), evr))
|
2008-05-01 14:19:31 +02:00
|
|
|
- else:
|
|
|
|
+ elif strong_only and flags[loop] & rpm.RPMSENSE_STRONG:
|
|
|
|
+ list.append((names[loop], versions[loop], flags[loop] & (~rpm.RPMSENSE_STRONG)))
|
2010-04-01 16:20:38 +02:00
|
|
|
+ elif weak_only and not (flags[loop] & rpm.RPMSENSE_STRONG):
|
2008-05-01 14:19:31 +02:00
|
|
|
+ list.append((names[loop], versions[loop], flags[loop]))
|
|
|
|
+ elif not (weak_only or strong_only):
|
2014-02-24 13:07:04 +01:00
|
|
|
list.append((name, flags[loop], evr))
|
2008-05-01 14:19:31 +02:00
|
|
|
|
|
|
|
def _gatherDepInfo(self):
|
2017-09-28 13:35:09 +02:00
|
|
|
@@ -924,6 +948,7 @@ class Pkg(AbstractPkg):
|
2015-11-26 11:24:13 +01:00
|
|
|
return prog
|
2015-04-10 16:35:46 +02:00
|
|
|
|
2012-09-13 18:07:20 +02:00
|
|
|
|
2010-10-14 14:32:03 +02:00
|
|
|
+
|
2008-05-01 14:19:31 +02:00
|
|
|
def getInstalledPkgs(name):
|
|
|
|
"""Get list of installed package objects by name."""
|
2010-10-14 14:32:03 +02:00
|
|
|
|
2017-09-28 13:35:09 +02:00
|
|
|
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
|
|
|
===================================================================
|
|
|
|
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
|
|
|
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
2017-09-28 22:18:14 +02:00
|
|
|
@@ -889,8 +889,27 @@ class TagsCheck(AbstractCheck.AbstractCh
|
2015-04-10 16:35:46 +02:00
|
|
|
value = Pkg.formatRequire(*c)
|
|
|
|
self._unexpanded_macros(pkg, 'Conflicts %s' % (value,), value)
|
|
|
|
|
|
|
|
+ for i in pkg.supplements():
|
|
|
|
+ value = Pkg.formatRequire(*i)
|
|
|
|
+ self._unexpanded_macros(pkg, 'Supplements %s' % (value,), value)
|
|
|
|
+
|
|
|
|
+ for i in pkg.suggests():
|
|
|
|
+ value = Pkg.formatRequire(*i)
|
|
|
|
+ self._unexpanded_macros(pkg, 'Suggests %s' % (value,), value)
|
|
|
|
+
|
|
|
|
+ for i in pkg.enhances():
|
|
|
|
+ value = Pkg.formatRequire(*i)
|
|
|
|
+ self._unexpanded_macros(pkg, 'Enhances %s' % (value,), value)
|
|
|
|
+
|
|
|
|
+ for i in pkg.recommends():
|
|
|
|
+ value = Pkg.formatRequire(*i)
|
|
|
|
+ self._unexpanded_macros(pkg, 'Recommends %s' % (value,), value)
|
|
|
|
+
|
|
|
|
obss = pkg.obsoletes()
|
|
|
|
if obss:
|
|
|
|
+ for obs in obss:
|
|
|
|
+ value = Pkg.formatRequire(*obs)
|
|
|
|
+ self._unexpanded_macros(pkg, 'Obsoletes %s' % (value,), value)
|
|
|
|
provs = pkg.provides()
|
|
|
|
for prov in provs:
|
|
|
|
for obs in obss:
|