* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_ipc/, bin/, pym/portage/, doc/package/ebuild/eapi/, ...
@ 2012-01-15 23:57 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; only message in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-15 23:57 UTC (permalink / raw
To: gentoo-commits
commit: caf67ac8df3528382ff960b2de4cf853a14a0141
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jan 15 23:53:04 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jan 15 23:53:04 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=caf67ac8
Support repository dependencies in EAPI="4-python".
---
bin/portageq | 11 ++++--
doc/package/ebuild/eapi/4-python.docbook | 38 +++++++++++++++++++++-
pym/portage/dep/__init__.py | 8 +++-
pym/portage/eapi.py | 3 ++
pym/portage/package/ebuild/_ipc/QueryCommand.py | 9 +++--
5 files changed, 58 insertions(+), 11 deletions(-)
diff --git a/bin/portageq b/bin/portageq
index e532f1c..5ecbb21 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -42,6 +42,7 @@ except ImportError:
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',
@@ -88,8 +89,9 @@ def has_version(argv):
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],
@@ -100,7 +102,7 @@ def has_version(argv):
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") % \
@@ -135,8 +137,9 @@ def best_version(argv):
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],
@@ -147,7 +150,7 @@ def best_version(argv):
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") % \
diff --git a/doc/package/ebuild/eapi/4-python.docbook b/doc/package/ebuild/eapi/4-python.docbook
index c13debe..b4cbc1a 100644
--- a/doc/package/ebuild/eapi/4-python.docbook
+++ b/doc/package/ebuild/eapi/4-python.docbook
@@ -31,12 +31,46 @@ official EAPI 4-python Specification</ulink>.
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>
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 72411b7..389916f 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -1,5 +1,5 @@
# 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__ = [
@@ -38,7 +38,8 @@ portage.proxy.lazyimport.lazyimport(globals(),
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, \
@@ -1074,6 +1075,9 @@ class Atom(_atom_base):
_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:
diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index 65c99c7..c3c4f2d 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -51,3 +51,6 @@ def eapi_has_required_use(eapi):
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",)
diff --git a/pym/portage/package/ebuild/_ipc/QueryCommand.py b/pym/portage/package/ebuild/_ipc/QueryCommand.py
index fb6e61e..949a148 100644
--- a/pym/portage/package/ebuild/_ipc/QueryCommand.py
+++ b/pym/portage/package/ebuild/_ipc/QueryCommand.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import io
@@ -7,6 +7,7 @@ import portage
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
@@ -31,14 +32,16 @@ class QueryCommand(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))
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-01-15 23:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-15 23:57 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_ipc/, bin/, pym/portage/, doc/package/ebuild/eapi/, Arfrever Frehtes Taifersar Arahesis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox