From 429292b73250c9df497da780cac9c633207f3e83 Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Fri, 27 Jan 2006 04:43:30 +0000 Subject: Added a check for obsolete virtual/x11 usage in dependencies. svn path=/main/trunk/; revision=2587 --- bin/repoman | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/repoman b/bin/repoman index 3b396f438..0e92c4f9b 100755 --- a/bin/repoman +++ b/bin/repoman @@ -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 -- cgit v1.2.3-1-g7c22