_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.startswith("portage-1")
+ allow_directories = any(x in _allow_directories
for x in layout_data['profile-formats'])
compat_mode = layout_data['profile-formats'] == ('portage-1-compat',)
from portage import _encodings
from portage import manifest
+_valid_profile_formats = frozenset(
+ ['pms', 'portage-1'])
+
_repo_name_sub_re = re.compile(r'[^\w-]')
def _gen_valid_repo(name):
raw_formats = ('portage-1-compat',)
else:
raw_formats = set(raw_formats.split())
- unknown = raw_formats.difference(['pms', 'portage-1'])
+ unknown = raw_formats.difference(_valid_profile_formats)
if unknown:
repo_name = _get_repo_name(repo_location, cached=repo_name)
warnings.warn((_("Repository named '%(repo_name)s' has unsupported "
layout_filename=layout_filename,
unknown_fmts=" ".join(unknown))),
DeprecationWarning)
- raw_formats = tuple(raw_formats.intersection(['pms', 'portage-1']))
+ raw_formats = tuple(raw_formats.intersection(_valid_profile_formats))
data['profile-formats'] = raw_formats
return data, layout_errors