from portage.localization import _
from portage.util import ensure_dirs, grabfile, \
normalize_path, shlex_split, writemsg
-from portage.repository.config import parse_layout_conf
+from portage.repository.config import parse_layout_conf, \
+ _portage1_profiles_allow_directories
_PORTAGE1_DIRECTORIES = frozenset([
_profile_node = collections.namedtuple('_profile_node',
'location portage1_directories')
-_allow_directories = frozenset(
- ["portage-1-compat", "portage-1"])
-
class LocationsManager(object):
def __init__(self, config_root=None, eprefix=None, config_profile_path=None, local_config=True, \
# protect against nested repositories. Insane configuration, but the longest
# path will be the correct one.
repo_loc, layout_data = max(intersecting_repos, key=lambda x:len(x[0]))
- allow_directories = any(x in _allow_directories
+ allow_directories = any(x in _portage1_profiles_allow_directories
for x in layout_data['profile-formats'])
compat_mode = layout_data['profile-formats'] == ('portage-1-compat',)
_valid_profile_formats = frozenset(
['pms', 'portage-1'])
+_portage1_profiles_allow_directories = frozenset(
+ ["portage-1-compat", "portage-1"])
+
_repo_name_sub_re = re.compile(r'[^\w-]')
def _gen_valid_repo(name):
'sign-commit', 'sign-manifest', 'thin-manifest', 'update-changelog'):
setattr(self, value.lower().replace("-", "_"), layout_data[value])
- self.portage1_profiles = any(x.startswith("portage-1") \
+ self.portage1_profiles = any(x in _portage1_profiles_allow_directories
for x in layout_data['profile-formats'])
self.portage1_profiles_compat = layout_data['profile-formats'] == ('portage-1-compat',)