"DESCRIPTION.missing":"Ebuilds that have a missing or empty DESCRIPTION variable",
"DESCRIPTION.toolong":"DESCRIPTION is over %d characters" % max_desc_len,
"EAPI.definition":"EAPI is defined after an inherit call (must be defined before)",
+ "EAPI.deprecated":"Ebuilds that use features that are deprecated in the current EAPI",
"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.invalid":"Ebuilds that have a missing or invalid SLOT variable value",
"DEPEND.badmaskedindev","RDEPEND.badmaskedindev","PDEPEND.badmaskedindev",
"DEPEND.badtilde", "RDEPEND.badtilde", "PDEPEND.badtilde",
"DESCRIPTION.toolong",
+"EAPI.deprecated",
"HOMEPAGE.virtual",
"LICENSE.virtual",
"KEYWORDS.dropped",
.B EAPI.definition
EAPI is defined after an inherit call (must be defined before)
.TP
+.B EAPI.deprecated
+Ebuilds that use features that are deprecated in the current EAPI
+.TP
.B EAPI.incompatible
Ebuilds that use features that are only available with a different EAPI
.TP
from portage import os
from _emerge.Package import Package
from _emerge.PackageVirtualDbapi import PackageVirtualDbapi
+from portage.dbapi.vartree import vartree
if sys.hexversion >= 0x3000000:
long = int
-class FakeVartree(portage.vartree):
+class FakeVartree(vartree):
"""This is implements an in-memory copy of a vartree instance that provides
all the interfaces required for use by the depgraph. The vardb is locked
during the constructor call just long enough to read a copy of the
# $Id$
import sys
-import portage
+from portage.dbapi import dbapi
-class PackageVirtualDbapi(portage.dbapi):
+class PackageVirtualDbapi(dbapi):
"""
A dbapi-like interface class that represents the state of the installed
package database as new packages are installed, replacing any packages
internally (passed in via cpv_inject() and cpv_remove() calls).
"""
def __init__(self, settings):
- portage.dbapi.__init__(self)
+ dbapi.__init__(self)
self.settings = settings
self._match_cache = {}
self._cp_map = {}
result = self._match_cache.get(origdep)
if result is not None:
return result[:]
- result = portage.dbapi.match(self, origdep, use_cache=use_cache)
+ result = dbapi.match(self, origdep, use_cache=use_cache)
self._match_cache[origdep] = result
return result[:]
import portage
from portage import os
from portage import digraph
+from portage.dbapi import dbapi
from portage.dep import Atom
from portage.output import bold, blue, colorize, create_color_func, darkblue, \
darkgreen, green, nc_len, red, teal, turquoise, yellow
def get_runtime_pkg_mask(self):
return self._dynamic_config._runtime_pkg_mask.copy()
-class _dep_check_composite_db(portage.dbapi):
+class _dep_check_composite_db(dbapi):
"""
A dbapi-like interface that is optimized for use in dep_check() calls.
This is built on top of the existing depgraph package selection logic.
via dep_check().
"""
def __init__(self, depgraph, root):
- portage.dbapi.__init__(self)
+ dbapi.__init__(self)
self._depgraph = depgraph
self._root = root
self._match_cache = {}
'portage.data',
'portage.data:lchown,ostype,portage_gid,portage_uid,secpass,' + \
'uid,userland,userpriv_groups,wheelgid',
+ 'portage.dbapi',
+ 'portage.dbapi.bintree:bindbapi,binarytree',
+ 'portage.dbapi.porttree:close_portdbapi_caches,FetchlistDict,' + \
+ 'portagetree,portdbapi',
+ 'portage.dbapi.vartree:vardbapi,vartree,dblink',
+ 'portage.dbapi.virtual:fakedbapi',
'portage.dep',
'portage.dep:best_match_to_list,dep_getcpv,dep_getkey,' + \
'flatten,get_operator,isjustname,isspecific,isvalidatom,' + \
#getting categories from an external file now
categories = [grabfile(os.path.join(x, "categories")) for x in locations]
+ category_re = dbapi.dbapi._category_re
self.categories = tuple(sorted(
x for x in stack_lists(categories, incremental=1)
- if dbapi._category_re.match(x) is not None))
+ if category_re.match(x) is not None))
del categories
archlist = [grabfile(os.path.join(x, "arch.list")) for x in locations]
]
auxdbkeylen=len(auxdbkeys)
-from portage.dbapi import dbapi
-from portage.dbapi.virtual import fakedbapi
-from portage.dbapi.bintree import bindbapi, binarytree
-from portage.dbapi.vartree import vardbapi, vartree, dblink
-from portage.dbapi.porttree import FetchlistDict, \
- close_portdbapi_caches, portagetree, portdbapi
-
def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None,
vartree=None, prev_mtimes=None, blockers=None):
"""will merge a .tbz2 file, returning a list of runtime dependencies
def match(atom, dbapi, match_type="default"):
"""
- wrapper that calls revisionMatch() or portage.dbapi.match() depending on
+ wrapper that calls revisionMatch() or portage.dbapi.dbapi.match() depending on
the given atom.
@type atom: string
@param atom: a <~ or >~ atom or a normal portage atom that contains the atom to match against
- @type dbapi: portage.dbapi
+ @type dbapi: portage.dbapi.dbapi
@param dbapi: one of the portage databases to use as information source
@type match_type: string
@param match_type: if != "default" passed as first argument to dbapi.xmatch
@type revisionAtom: string
@param revisionAtom: a <~ or >~ atom that contains the atom to match against
- @type dbapi: portage.dbapi
+ @type dbapi: portage.dbapi.dbapi
@param dbapi: one of the portage databases to use as information source
@type match_type: string
@param match_type: if != "default" passed as first argument to portdb.xmatch
re = re.compile('^.*built_with_use')
error = errors.BUILT_WITH_USE
+# EAPI-3 checks
+class Eapi3DeprecatedFuncs(LineCheck):
+ repoman_check_name = 'EAPI.deprecated'
+ ignore_line = re.compile(r'(^\s*#)')
+ deprecated_commands_re = re.compile(r'^\s*(check_license)\b')
+
+ def new(self, pkg):
+ self.eapi = pkg.metadata['EAPI']
+
+ def check_eapi(self, eapi):
+ return self.eapi not in ('0', '1', '2')
+
+ def check(self, num, line):
+ m = self.deprecated_commands_re.match(line)
+ if m is not None:
+ return ("'%s'" % m.group(1)) + \
+ " has been deprecated in EAPI=3 on line: %d"
+
# EAPI-4 checks
class Eapi4IncompatibleFuncs(LineCheck):
repoman_check_name = 'EAPI.incompatible'
IUseUndefined, InheritAutotools,
EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded,
DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
- SrcCompileEconf, Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse)))
+ SrcCompileEconf, Eapi3DeprecatedFuncs,
+ Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse)))
_here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')