summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 268ebb643..b829e8045 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 a1dea8c1f..092cacf84 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 d44b0424c..e6475762d 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)