From: Zac Medico Date: Tue, 18 Sep 2012 20:17:34 +0000 (-0700) Subject: Atom: don't allow :slot* syntax X-Git-Tag: v2.2.0_alpha130~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=61406033e6ae182d9f4a7fceea81871e74f9b0b6;p=portage.git Atom: don't allow :slot* syntax This syntax is useless, and PMS doesn't discuss it. --- diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 4d85f945b..b4b240d43 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -1333,6 +1333,8 @@ class Atom(_unicode): sub_slot = sub_slot[:-1] self.__dict__['sub_slot'] = sub_slot self.__dict__['slot_operator'] = slot_operator + if self.slot is not None and self.slot_operator == "*": + raise InvalidAtom(self) else: self.__dict__['slot'] = slot self.__dict__['sub_slot'] = None diff --git a/pym/portage/tests/dep/testAtom.py b/pym/portage/tests/dep/testAtom.py index 0c72fd0e6..094538dab 100644 --- a/pym/portage/tests/dep/testAtom.py +++ b/pym/portage/tests/dep/testAtom.py @@ -155,7 +155,6 @@ class TestAtom(TestCase): ("virtual/ffmpeg:=", "4-slot-abi", {"slot": None, "sub_slot": None, "slot_operator": "="}), ("virtual/ffmpeg:0=", "4-slot-abi", {"slot": "0", "sub_slot": None, "slot_operator": "="}), ("virtual/ffmpeg:*", "4-slot-abi", {"slot": None, "sub_slot": None, "slot_operator": "*"}), - ("virtual/ffmpeg:0*", "4-slot-abi", {"slot": "0", "sub_slot": None, "slot_operator": "*"}), ("virtual/ffmpeg:0", "4-slot-abi", {"slot": "0", "sub_slot": None, "slot_operator": None}), ("virtual/ffmpeg", "4-slot-abi", {"slot": None, "sub_slot": None, "slot_operator": None}), ) diff --git a/pym/portage/tests/dep/test_isvalidatom.py b/pym/portage/tests/dep/test_isvalidatom.py index abcec755e..625bde5d4 100644 --- a/pym/portage/tests/dep/test_isvalidatom.py +++ b/pym/portage/tests/dep/test_isvalidatom.py @@ -141,7 +141,7 @@ class IsValidAtom(TestCase): IsValidAtomTestCase("virtual/ffmpeg:=", True), IsValidAtomTestCase("virtual/ffmpeg:0=", True), IsValidAtomTestCase("virtual/ffmpeg:*", True), - IsValidAtomTestCase("virtual/ffmpeg:0*", True), + IsValidAtomTestCase("virtual/ffmpeg:0*", False), IsValidAtomTestCase("virtual/ffmpeg:0", True), ) diff --git a/pym/portage/tests/dep/test_match_from_list.py b/pym/portage/tests/dep/test_match_from_list.py index 2a1945b08..4a6ab3b48 100644 --- a/pym/portage/tests/dep/test_match_from_list.py +++ b/pym/portage/tests/dep/test_match_from_list.py @@ -108,13 +108,11 @@ class Test_match_from_list(TestCase): ("virtual/ffmpeg:=", [Package("=virtual/ffmpeg-0.10.3:0/53")], ["virtual/ffmpeg-0.10.3"] ), ("virtual/ffmpeg:0=", [Package("=virtual/ffmpeg-0.10.3:0/53")], ["virtual/ffmpeg-0.10.3"] ), ("virtual/ffmpeg:*", [Package("=virtual/ffmpeg-0.10.3:0/53")], ["virtual/ffmpeg-0.10.3"] ), - ("virtual/ffmpeg:0*", [Package("=virtual/ffmpeg-0.10.3:0/53")], ["virtual/ffmpeg-0.10.3"] ), ("virtual/ffmpeg:0", [Package("=virtual/ffmpeg-0.10.3:0/53")], ["virtual/ffmpeg-0.10.3"] ), ("sys-libs/db:4.8/4.8", [Package("=sys-libs/db-4.8.30:4.8")], ["sys-libs/db-4.8.30"] ), ("sys-libs/db:4.8/4.8=", [Package("=sys-libs/db-4.8.30:4.8")], ["sys-libs/db-4.8.30"] ), ("sys-libs/db:4.8=", [Package("=sys-libs/db-4.8.30:4.8")], ["sys-libs/db-4.8.30"] ), - ("sys-libs/db:4.8*", [Package("=sys-libs/db-4.8.30:4.8")], ["sys-libs/db-4.8.30"] ), ("sys-libs/db:*", [Package("=sys-libs/db-4.8.30:4.8")], ["sys-libs/db-4.8.30"] ), ("sys-libs/db:4.8/0", [Package("=sys-libs/db-4.8.30:4.8")], [] ), ("sys-libs/db:4.8/0=", [Package("=sys-libs/db-4.8.30:4.8")], [] ),