del pym_path
from portage import os
+from portage.eapi import eapi_has_repo_deps
from portage.util import writemsg, writemsg_stdout
portage.proxy.lazyimport.lazyimport(globals(),
'subprocess',
warnings = []
+ allow_repo = atom_validate_strict is False or eapi_has_repo_deps(eapi)
try:
- atom = portage.dep.Atom(argv[1])
+ atom = portage.dep.Atom(argv[1], allow_repo=allow_repo)
except portage.exception.InvalidAtom:
if atom_validate_strict:
portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1],
else:
if atom_validate_strict:
try:
- atom = portage.dep.Atom(argv[1], eapi=eapi)
+ atom = portage.dep.Atom(argv[1], allow_repo=allow_repo, eapi=eapi)
except portage.exception.InvalidAtom as e:
warnings.append(
portage._unicode_decode("QA Notice: %s: %s") % \
warnings = []
+ allow_repo = atom_validate_strict is False or eapi_has_repo_deps(eapi)
try:
- atom = portage.dep.Atom(argv[1])
+ atom = portage.dep.Atom(argv[1], allow_repo=allow_repo)
except portage.exception.InvalidAtom:
if atom_validate_strict:
portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1],
else:
if atom_validate_strict:
try:
- atom = portage.dep.Atom(argv[1], eapi=eapi)
+ atom = portage.dep.Atom(argv[1], allow_repo=allow_repo, eapi=eapi)
except portage.exception.InvalidAtom as e:
warnings.append(
portage._unicode_decode("QA Notice: %s: %s") % \
The "." character is allowed in USE flags.
</para>
</section>
-<section id='package-ebuild-eapi-4-python-repository'>
-<title>REPOSITORY</title>
+<section id='package-ebuild-eapi-4-python-repository-variable'>
+<title>REPOSITORY Variable</title>
<para>
The new REPOSITORY variable is set in ebuild environment. This variable contains name of repository, which contains currently used ebuild.
</para>
</section>
+<section id='package-ebuild-eapi-4-python-repository-dependencies'>
+<title>Repository Dependencies</title>
+<para>
+Repository dependencies are supported in atoms in DEPEND, PDEPEND and RDEPEND and atoms passed to best_version and has_version functions.
+Repository dependency is specified by two colons followed by repository name.
+</para>
+<table><title>Repository Dependency Examples</title>
+<tgroup cols='1' align='left' >
+<colspec colname='atom'/>
+<thead>
+<row>
+<entry>Atom</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry>dev-lang/python::progress</entry>
+</row>
+<row>
+<entry>>=dev-lang/python-3.2::progress</entry>
+</row>
+<row>
+<entry>dev-lang/python:3.2::progress</entry>
+</row>
+<row>
+<entry>dev-lang/python::progress[xml]</entry>
+</row>
+<row>
+<entry>dev-lang/python:3.2::progress[xml]</entry>
+</row>
+</tbody>
+</tgroup>
+</table>
+</section>
<section id='package-ebuild-eapi-4-python-repo-level-config'>
<title>Extended Repository-Level Configuration</title>
<para>
# deps.py -- Portage dependency resolution functions
-# Copyright 2003-2011 Gentoo Foundation
+# Copyright 2003-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = [
from portage import _unicode_decode
from portage.eapi import eapi_has_slot_deps, eapi_has_src_uri_arrows, \
- eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_use_dep_defaults
+ eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_use_dep_defaults, \
+ eapi_has_repo_deps
from portage.exception import InvalidAtom, InvalidData, InvalidDependString
from portage.localization import _
from portage.versions import catpkgsplit, catsplit, \
_atom_base.__init__(s)
+ if eapi_has_repo_deps(eapi):
+ allow_repo = True
+
if "!" == s[:1]:
blocker = self._blocker(forbid_overlap=("!" == s[1:2]))
if blocker.overlap.forbid:
def eapi_has_use_dep_defaults(eapi):
return eapi not in ("0", "1", "2", "3")
+
+def eapi_has_repo_deps(eapi):
+ return eapi in ("4-python",)
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import io
from portage import os
from portage import _unicode_decode
from portage.dep import Atom
+from portage.eapi import eapi_has_repo_deps
from portage.elog import messages as elog_messages
from portage.exception import InvalidAtom
from portage.package.ebuild._ipc.IpcCommand import IpcCommand
cmd, root, atom_str = argv
+ eapi = self.settings.get('EAPI')
+ allow_repo = eapi_has_repo_deps(eapi)
try:
- atom = Atom(atom_str)
+ atom = Atom(atom_str, allow_repo=allow_repo)
except InvalidAtom:
return ('', 'invalid atom: %s\n' % atom_str, 2)
warnings = []
try:
- atom = Atom(atom_str, eapi=self.settings.get('EAPI'))
+ atom = Atom(atom_str, allow_repo=allow_repo, eapi=eapi)
except InvalidAtom as e:
warnings.append(_unicode_decode("QA Notice: %s: %s") % (cmd, e))