Atom: support *_beta* wildcard, bug #437872
authorZac Medico <zmedico@gentoo.org>
Wed, 10 Oct 2012 19:12:18 +0000 (12:12 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 10 Oct 2012 19:12:18 +0000 (12:12 -0700)
man/portage.5
pym/portage/dep/__init__.py
pym/portage/tests/dep/testAtom.py
pym/portage/tests/dep/test_best_match_to_list.py

index 705d0d9437ab90b61d7fe96733f6025e6bbd0162..12938e2000e35e6b23abbd18e31d58dcdc2b9fc9 100644 (file)
@@ -1,4 +1,4 @@
-.TH "PORTAGE" "5" "Sep 2012" "Portage VERSION" "Portage"
+.TH "PORTAGE" "5" "Oct 2012" "Portage VERSION" "Portage"
 .SH NAME
 portage \- the heart of Gentoo
 .SH "DESCRIPTION"
@@ -173,6 +173,8 @@ next to each other.
 # match anything with a version containing 9999, which can be used in
 # package.mask to prevent emerge --autounmask from selecting live ebuilds
 =*/*-*9999*
+# match anything with a version containing _beta
+=*/*-*_beta*
 # match anything from the 'sys\-apps' category
 sys\-apps/*
 # match packages named 'zlib' from any category
index 6e030047c87ca614495db90f6331b194dd126dcf..b1a46b8aaf5af01c4156a2390f62a969fc649622 100644 (file)
@@ -143,7 +143,7 @@ def _get_atom_wildcard_re(eapi_attrs):
 
        atom_re = re.compile(r'((?P<simple>(' +
                _extended_cat + r')/(' + pkg_re + r'))' + \
-               '|(?P<star>=((' + _extended_cat + r')/(' + pkg_re + r'))-(?P<version>\*\d+\*)))' + \
+               '|(?P<star>=((' + _extended_cat + r')/(' + pkg_re + r'))-(?P<version>\*\w+\*)))' + \
                '(:(?P<slot>' + _slot_loose + r'))?(' +
                _repo_separator + r'(?P<repo>' + _repo_name + r'))?$', re.UNICODE)
 
@@ -2134,7 +2134,7 @@ def match_from_list(mydep, candidate_list):
 
                        candidate_list = mylist
                        mylist = []
-                       # Currently, only \*\d+\* is supported.
+                       # Currently, only \*\w+\* is supported.
                        ver = mydep.version[1:-1]
 
                        for x in candidate_list:
index 094538dab5d929434bde7744737237f8acd4e2fd..948166d8e6125813f3a360623b5b3f4b0729a815 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2006, 2010 Gentoo Foundation
+# Copyright 2006-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -24,6 +24,10 @@ class TestAtom(TestCase):
                                ('=*',  '*/*', '*9999*', None, None, None), True, False ),
                        ( "=*/*-*9999*:0::repo_name",
                                ('=*',  '*/*', '*9999*', '0', None, 'repo_name'), True, True ),
+                       ( "=*/*-*_beta*",
+                               ('=*',  '*/*', '*_beta*', None, None, None), True, False ),
+                       ( "=*/*-*_beta*:0::repo_name",
+                               ('=*',  '*/*', '*_beta*', '0', None, 'repo_name'), True, True ),
                        ( "sys-apps/*",
                                (None,  'sys-apps/*', None, None, None, None), True, False ),
                        ( "*/portage",
index 8a14038280b3070362ca789ae3e0185ae805cdfe..0ea834238fc8822a2daa5b91f2792fc351736168 100644 (file)
@@ -1,5 +1,5 @@
 # test_best_match_to_list.py -- Portage Unit Testing Functionality
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from itertools import permutations
@@ -40,6 +40,10 @@ class Test_best_match_to_list(TestCase):
                                                [Atom("=dev-libs/A-1:0"), Atom("dev-libs/*", allow_wildcard=True)], True),
                                        ("dev-libs/A-4.9999-r1", [Atom("dev-libs/*", allow_wildcard=True), Atom("=*/*-*9999*", allow_wildcard=True)], \
                                                [Atom("=*/*-*9999*", allow_wildcard=True), Atom("dev-libs/*", allow_wildcard=True)], True),
+                                       ("dev-libs/A-4_beta-r1", [Atom("dev-libs/*", allow_wildcard=True), Atom("=*/*-*_beta*", allow_wildcard=True)], \
+                                               [Atom("=*/*-*_beta*", allow_wildcard=True), Atom("dev-libs/*", allow_wildcard=True)], True),
+                                       ("dev-libs/A-4_beta1-r1", [Atom("dev-libs/*", allow_wildcard=True), Atom("=*/*-*_beta*", allow_wildcard=True)], \
+                                               [Atom("=*/*-*_beta*", allow_wildcard=True), Atom("dev-libs/*", allow_wildcard=True)], True),
                                        ("dev-libs/A-1:0", [Atom("dev-*/*", allow_wildcard=True), Atom("dev-*/*:0", allow_wildcard=True),\
                                                Atom("dev-libs/A"), Atom("<=dev-libs/A-2"), Atom("dev-libs/A:0"), \
                                                Atom("=dev-libs/A-1*"), Atom("~dev-libs/A-1"), Atom("=dev-libs/A-1")], \