aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-10-12 14:34:37 (GMT)
committerZac Medico <zmedico@gentoo.org>2010-10-12 15:36:07 (GMT)
commit13265b866e87e132ff6fb0726e3773f490a2b90c (patch)
tree74b3093de03c72166155ef389e5acb1c061128f7
parentFix indention error in repoman headerstring code. (diff)
downloadportage-13265b866e87e132ff6fb0726e3773f490a2b90c.zip
portage-13265b866e87e132ff6fb0726e3773f490a2b90c.tar.gz
portage-13265b866e87e132ff6fb0726e3773f490a2b90c.tar.bz2
Allow repository specs for atoms with wildcards
-rw-r--r--pym/portage/dep/__init__.py4
-rw-r--r--pym/portage/tests/dep/testAtom.py10
-rw-r--r--pym/portage/tests/resolver/test_multirepo.py10
3 files changed, 22 insertions, 2 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 268ebb6..b829e80 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -1010,7 +1010,7 @@ class Atom(_atom_base):
if cpv.find("**") != -1:
raise InvalidAtom(self)
slot = gdict['slot']
- repo = None
+ repo = gdict['repo']
use_str = None
extended_syntax = True
else:
@@ -1529,7 +1529,7 @@ _atom_re = re.compile('^(?P<without_use>(?:' +
_extended_cat = r'[\w+*][\w+.*-]*'
_extended_pkg = r'[\w+*][\w+*-]*?'
-_atom_wildcard_re = re.compile('(?P<simple>(' + _extended_cat + ')/(' + _extended_pkg + '))(:(?P<slot>' + _slot + '))?$')
+_atom_wildcard_re = re.compile('(?P<simple>(' + _extended_cat + ')/(' + _extended_pkg + '))(:(?P<slot>' + _slot + '))?(' + _repo_separator + '(?P<repo>' + _repo_name + '))?$')
_valid_use_re = re.compile(r'^[A-Za-z0-9][A-Za-z0-9+_@-]*$')
diff --git a/pym/portage/tests/dep/testAtom.py b/pym/portage/tests/dep/testAtom.py
index a1dea8c..092cacf 100644
--- a/pym/portage/tests/dep/testAtom.py
+++ b/pym/portage/tests/dep/testAtom.py
@@ -47,6 +47,15 @@ class TestAtom(TestCase):
('=*', 'sys-apps/portage', '2.1-r1', '0', '[doc]', 'repo_name'), False, True ),
( "sys-apps/portage:0::repo_name[doc]",
(None, 'sys-apps/portage', None, '0', '[doc]', 'repo_name'), False, True ),
+
+ ( "*/*::repo_name",
+ (None, '*/*', None, None, None, 'repo_name'), True, True ),
+ ( "sys-apps/*::repo_name",
+ (None, 'sys-apps/*', None, None, None, 'repo_name'), True, True ),
+ ( "*/portage::repo_name",
+ (None, '*/portage', None, None, None, 'repo_name'), True, True ),
+ ( "s*s-*/portage:1::repo_name",
+ (None, 's*s-*/portage', None, '1', None, 'repo_name'), True, True ),
)
tests_xfail = (
@@ -103,6 +112,7 @@ class TestAtom(TestCase):
( "=sys-apps/portage-2.1-r1:0::repo_name[doc,a=,!b=,c?,!d?,-e]", False, False ),
( "=sys-apps/portage-2.1-r1*:0::repo_name[doc]", False, False ),
( "sys-apps/portage:0::repo_name[doc]", False, False ),
+ ( "*/*::repo_name", True, False ),
)
for atom, parts, allow_wildcard, allow_repo in tests:
diff --git a/pym/portage/tests/resolver/test_multirepo.py b/pym/portage/tests/resolver/test_multirepo.py
index d44b042..e647576 100644
--- a/pym/portage/tests/resolver/test_multirepo.py
+++ b/pym/portage/tests/resolver/test_multirepo.py
@@ -155,6 +155,9 @@ class MultirepoTestCase(TestCase):
#package.unmask
"dev-libs/G-1": { },
"dev-libs/G-1::repo1": { },
+
+ #package.mask with wildcards
+ "dev-libs/Z-1::repo3": { },
}
user_config = {
@@ -176,6 +179,8 @@ class MultirepoTestCase(TestCase):
"dev-libs/H",
#needed for package.unmask test
"dev-libs/G",
+ #wildcard test
+ "*/*::repo3",
),
"package.properties":
(
@@ -242,6 +247,11 @@ class MultirepoTestCase(TestCase):
ResolverPlaygroundTestCase(
["dev-libs/H"],
success = False),
+
+ #package.mask with wildcards
+ ResolverPlaygroundTestCase(
+ ["dev-libs/Z"],
+ success = False),
)
playground = ResolverPlayground(ebuilds=ebuilds, user_config=user_config)