diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-11-12 23:34:36 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-11-12 23:34:36 +0000 |
commit | c281261a8c23137d09c616e1fd5f08e20c78ab39 (patch) | |
tree | 768365f0ab90e95f01a55e285e3db86360c2b1a6 | |
parent | d01a91cbd8033b4dda59e404d005a8ea62eb4692 (diff) | |
download | portage-c281261a8c23137d09c616e1fd5f08e20c78ab39.tar.gz portage-c281261a8c23137d09c616e1fd5f08e20c78ab39.tar.bz2 portage-c281261a8c23137d09c616e1fd5f08e20c78ab39.zip |
Bug #292820 - Make the Package constructor handle invalid SLOT values.
svn path=/main/trunk/; revision=14819
-rwxr-xr-x | bin/repoman | 1 | ||||
-rw-r--r-- | man/repoman.1 | 2 | ||||
-rw-r--r-- | pym/_emerge/Package.py | 6 |
3 files changed, 7 insertions, 2 deletions
diff --git a/bin/repoman b/bin/repoman index 74bbdab92..0df7c00ae 100755 --- a/bin/repoman +++ b/bin/repoman @@ -283,6 +283,7 @@ qahelp={ "EAPI.definition":"EAPI is defined after an inherit call (must be defined before)", "EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI", "EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)", + "SLOT.invalid":"Ebuilds that have an invalid SLOT variable value", "SLOT.missing":"Ebuilds that have a missing or empty SLOT variable", "HOMEPAGE.missing":"Ebuilds that have a missing or empty HOMEPAGE variable", "DEPEND.bad":"User-visible ebuilds with bad DEPEND settings (matched against *visible* ebuilds)", diff --git a/man/repoman.1 b/man/repoman.1 index 4ca110fab..5fab376b6 100644 --- a/man/repoman.1 +++ b/man/repoman.1 @@ -206,6 +206,8 @@ Syntax error in PROPERTIES (usually an extra/missing space/parenthesis) .TP .B RESTRICT.syntax Syntax error in RESTRICT (usually an extra/missing space/parenthesis) +.B SLOT.invalid +Ebuilds that have an invalid SLOT variable value .TP .B SLOT.missing Ebuilds that have a missing or empty SLOT variable diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index d6970b5f2..dc8b975e6 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -8,7 +8,7 @@ from itertools import chain import portage from portage.cache.mappings import slot_dict_class from portage.dep import paren_reduce, use_reduce, \ - paren_normalize, paren_enclose + paren_normalize, paren_enclose, _slot_re from _emerge.Task import Task if sys.hexversion >= 0x3000000: @@ -40,7 +40,9 @@ class Package(Task): self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '') self.cp = portage.cpv_getkey(self.cpv) slot = self.slot - if not slot: + if _slot_re.match(slot) is None: + self._invalid_metadata('SLOT.invalid', + "SLOT: invalid value: '%s'" % slot) # Avoid an InvalidAtom exception when creating slot_atom. # This package instance will be masked due to empty SLOT. slot = '0' |