'portage.dbapi._MergeProcess:MergeProcess',
'portage.dbapi._SyncfsProcess:SyncfsProcess',
'portage.dep:dep_getkey,isjustname,isvalidatom,match_from_list,' + \
- 'use_reduce,_get_slot_re,_slot_separator,_repo_separator',
+ 'use_reduce,_slot_separator,_repo_separator',
'portage.eapi:_get_eapi_attrs',
'portage.elog:collect_ebuild_messages,collect_messages,' + \
'elog_process,_merge_logentries',
'portage.util._eventloop.EventLoop:EventLoop',
'portage.util._eventloop.global_event_loop:global_event_loop',
'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,vercmp,' + \
- '_pkgsplit@pkgsplit,_pkg_str,_unknown_repo',
+ '_get_slot_re,_pkgsplit@pkgsplit,_pkg_str,_unknown_repo',
'subprocess',
'tarfile',
)
from portage.exception import InvalidAtom, InvalidData, InvalidDependString
from portage.localization import _
from portage.versions import catpkgsplit, catsplit, \
- vercmp, ververify, _cp, _cpv, _pkg_str, _unknown_repo
+ vercmp, ververify, _cp, _cpv, _pkg_str, _slot, _unknown_repo
import portage.cache.mappings
if sys.hexversion >= 0x3000000:
# PMS 3.1.3: A slot name may contain any of the characters [A-Za-z0-9+_.-].
# It must not begin with a hyphen or a dot.
_slot_separator = ":"
-_slot = r'([\w+][\w+.-]*)'
# loosly match SLOT, which may have an optional ABI part
_slot_loose = r'([\w+./*=-]+)'
_extended_cat = r'[\w+*][\w+.*-]*'
-_slot_re_cache = {}
-
-def _get_slot_re(eapi_attrs):
- cache_key = eapi_attrs.slot_operator
- slot_re = _slot_re_cache.get(cache_key)
- if slot_re is not None:
- return slot_re
-
- if eapi_attrs.slot_operator:
- slot_re = _slot + r'(/' + _slot + r')?'
- else:
- slot_re = _slot
-
- slot_re = re.compile('^' + slot_re + '$', re.VERBOSE | re.UNICODE)
-
- _slot_re_cache[cache_key] = slot_re
- return slot_re
-
_slot_dep_re_cache = {}
def _get_slot_dep_re(eapi_attrs):
from portage import _unicode_encode
import portage
portage.proxy.lazyimport.lazyimport(globals(),
- 'portage.dep:Atom,dep_getkey,isvalidatom,_get_slot_re',
+ 'portage.dep:Atom,dep_getkey,isvalidatom,match_from_list',
'portage.util:ConfigProtect,new_protect_filename,' + \
'normalize_path,write_atomic,writemsg',
+ 'portage.versions:_get_slot_re',
)
from portage.const import USER_CONFIG_PATH, VCS_DIRS
-from portage.dep import match_from_list
from portage.eapi import _get_eapi_attrs
from portage.exception import DirectoryNotFound, InvalidAtom, PortageException
from portage.localization import _
import portage
portage.proxy.lazyimport.lazyimport(globals(),
- 'portage.dep:_get_slot_re',
'portage.repository.config:_gen_valid_repo',
'portage.util:cmp_sort_key',
)
# \w is [a-zA-Z0-9_]
+# PMS 3.1.3: A slot name may contain any of the characters [A-Za-z0-9+_.-].
+# It must not begin with a hyphen or a dot.
+_slot = r'([\w+][\w+.-]*)'
+
# 2.1.1 A category name may contain any of the characters [A-Za-z0-9+_.-].
# It must not begin with a hyphen or a dot.
_cat = r'[\w+][\w+.-]*'
suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1}
endversion_keys = ["pre", "p", "alpha", "beta", "rc"]
+_slot_re_cache = {}
+
+def _get_slot_re(eapi_attrs):
+ cache_key = eapi_attrs.slot_operator
+ slot_re = _slot_re_cache.get(cache_key)
+ if slot_re is not None:
+ return slot_re
+
+ if eapi_attrs.slot_operator:
+ slot_re = _slot + r'(/' + _slot + r')?'
+ else:
+ slot_re = _slot
+
+ slot_re = re.compile('^' + slot_re + '$', re.VERBOSE | re.UNICODE)
+
+ _slot_re_cache[cache_key] = slot_re
+ return slot_re
+
_pv_re_cache = {}
def _get_pv_re(eapi_attrs):