Added a check for obsolete virtual/x11 usage in dependencies.
authorJason Stubbs <jstubbs@gentoo.org>
Fri, 27 Jan 2006 04:43:30 +0000 (04:43 -0000)
committerJason Stubbs <jstubbs@gentoo.org>
Fri, 27 Jan 2006 04:43:30 +0000 (04:43 -0000)
svn path=/main/trunk/; revision=2587

bin/repoman

index 3b396f4388d6036ec89e810b4a5f2291b4c4addd..0e92c4f9b9c9d26c5d6e148c4dd2fcd14081e630 100755 (executable)
@@ -136,7 +136,8 @@ qahelp={
        "metadata.bad":"Bad metadata.xml files",
        "virtual.versioned":"PROVIDE contains virtuals with versions",
        "virtual.exists":"PROVIDE contains existing package names",
-       "virtual.unavailable":"PROVIDE contains a virtual which contains no profile default"
+       "virtual.unavailable":"PROVIDE contains a virtual which contains no profile default",
+       "usage.obsolete":"The ebuild makes use of an obsolete construct"
 }
 
 qacats = qahelp.keys()
@@ -660,6 +661,27 @@ else:
        xmllint_capable=True
 
 
+def x11_deprecation_check(depstr):
+       if depstr.find("virtual/x11") == -1:
+               return False
+       depsplit = depstr.split()
+       ok_stack = []
+       ok = False
+       for token in depsplit:
+               if token == "(":
+                       ok_stack.append(ok)
+                       ok = False
+               elif token == ")":
+                       ok = ok_stack.pop()
+               elif token == "||":
+                       ok = True
+               else:
+                       ok = False
+                       if token.find("virtual/x11") != -1 and (not ok_stack or not ok_stack[-1]):
+                               return True
+       return False
+
+
 arch_caches={}
 for x in scanlist:
        #ebuilds and digests added to cvs respectively.
@@ -1027,6 +1049,11 @@ for x in scanlist:
                badlicsyntax = badlicsyntax > 0
                badprovsyntax = badprovsyntax > 0
 
+               if not baddepsyntax:
+                       if x11_deprecation_check(" ".join([myaux["DEPEND"], myaux["RDEPEND"], myaux["PDEPEND"]])):
+                               stats["usage.obsolete"] += 1
+                               fails["usage.obsolete"].append("%s/%s.ebuild: not migrated to modular X" % (x, y))
+
                for keyword,arch,groups in arches:
                        portage.groups=groups