Bug #213629 - Create an EAPI.incompatible category and use it in cases
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 04:07:13 +0000 (04:07 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 04:07:13 +0000 (04:07 -0000)
where EAPI=0 and a slot atom is encountered.

svn path=/main/trunk/; revision=9524

bin/repoman
man/repoman.1

index df7c0c0e2f6f828a5d70892d9009fcb4aa85150f..f89e1de74e3b6b217450ff236b4b65263360407c 100755 (executable)
@@ -257,6 +257,7 @@ qahelp={
        "LICENSE.missing":"Ebuilds that have a missing or empty LICENSE variable",
        "DESCRIPTION.missing":"Ebuilds that have a missing or empty DESCRIPTION variable",
        "DESCRIPTION.toolong":"DESCRIPTION is over %d characters" % max_desc_len,
+       "EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI",
        "EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
        "SLOT.missing":"Ebuilds that have a missing or empty SLOT variable",
        "HOMEPAGE.missing":"Ebuilds that have a missing or empty HOMEPAGE variable",
@@ -974,6 +975,7 @@ for x in scanlist:
                        continue
 
                myaux = ebuild_metadata[y]
+               eapi = myaux["EAPI"]
 
                # Test for negative logic and bad words in the RESTRICT var.
                #for x in myaux[allvars.index("RESTRICT")].split():
@@ -1145,15 +1147,22 @@ for x in scanlist:
                                if myteststr.find(token) != -1:
                                        badsyntax.append("'%s' not separated by space" % (token))
 
-
                        if mytype in ("DEPEND", "RDEPEND", "PDEPEND"):
                                for token in mydepstr.split():
                                        if token in operator_tokens or \
                                                token.endswith("?"):
                                                continue
-                                       if not portage.isvalidatom(token, allow_blockers=True) or \
-                                               ":" in token and myaux["EAPI"] == "0":
+                                       if not portage.isvalidatom(token, allow_blockers=True):
                                                badsyntax.append("'%s' not a valid atom" % token)
+                                       else:
+                                               atom = token.lstrip("!")
+                                               if eapi == "0":
+                                                       if portage.dep.dep_getslot(atom):
+                                                               stats['EAPI.incompatible'] += 1
+                                                               fails['EAPI.incompatible'].append(
+                                                                       (relative_path + ": %s slot dependency" + \
+                                                                       " not supported with EAPI='%s':" + \
+                                                                       " '%s'") % (mytype, eapi, atom))
 
                        type_list.extend([mytype] * (len(badsyntax) - len(type_list)))
 
index 7956ab446e91cfc4456b9559dd6759afadce6e54..f217524251b9a9c26a80f3da077bfa1816374673 100644 (file)
@@ -102,6 +102,9 @@ Syntax error in DEPEND (usually an extra/missing space/parenthesis)
 .B DESCRIPTION.missing
 Ebuilds that have a missing or empty DESCRIPTION variable
 .TP
+.B EAPI.incompatible
+Ebuilds that use features that are only available with a different EAPI
+.TP
 .B EAPI.unsupported
 Ebuilds that have an unsupported EAPI version (you must upgrade portage)
 .TP