The PMS says in section 3.1 about category names: A category name may contain any of the characters [A-Za-z0-9+_.-]. It must not begin with a hyphen, a dot or a plus sign. and about package names: A package name may contain any of the characters [A-Za-z0-9+_-]. It must not begin with a hyphen or a plus sign, and must not end in a hyphen followed by anything matching the version syntax described in section 3.2. Portage allows the plus sign, though. In pym/portage/versions.py: _cat = r'[\w+][\w+.-]*' _pkg = { "dots_disallowed_in_PN": r'[\w+][\w+-]*?', "dots_allowed_in_PN": r'[\w+][\w+.-]*?', }
Same for SLOT, the spec forbids that it starts with a plus sign. _slot = r'([\w+][\w+.-]*)'
I'm not really convinced about this. Repoman warning about invalid package name, sure. But as long as portage itself can handle such a name, I don't think we should prohibit users from using it locally.
(In reply to Michał Górny from comment #2) > I'm not really convinced about this. Repoman warning about invalid package > name, sure. But as long as portage itself can handle such a name, I don't > think we should prohibit users from using it locally. Is there any real world example for the latter? Otherwise, I'd suggest that we go for the simple solution, namely fixing the regexps in versions.py.