summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-09-30 08:13:03 +0200
committerZac Medico <zmedico@gentoo.org>2010-09-30 14:49:17 -0700
commit30c942f47d957f2cd659558fedeb97af74f8b893 (patch)
treea61585b93e8bbd2edf2b9241b0ee29de3689f048
parent7b25a0ee47f19ce41854ce60510da9c2dfa9a3cc (diff)
downloadportage-30c942f47d957f2cd659558fedeb97af74f8b893.tar.gz
portage-30c942f47d957f2cd659558fedeb97af74f8b893.tar.bz2
portage-30c942f47d957f2cd659558fedeb97af74f8b893.zip
Remove repos.conf handling from package/ebuild/config.py because it moved to repository/config.py
-rw-r--r--pym/portage/package/ebuild/config.py66
1 files changed, 1 insertions, 65 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 477444b3c..54876a98f 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -5,25 +5,18 @@ __all__ = [
'autouse', 'best_from_dict', 'check_config_instance', 'config',
]
-import codecs
import copy
-import errno
import logging
import re
import sys
import warnings
-try:
- from configparser import SafeConfigParser, ParsingError
-except ImportError:
- from ConfigParser import SafeConfigParser, ParsingError
-
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.data:portage_gid',
)
from portage import bsd_chflags, \
- load_mod, os, selinux, _encodings, _unicode_encode, _unicode_decode
+ load_mod, os, selinux, _unicode_decode
from portage.const import CACHE_PATH, \
DEPCACHE_PATH, INCREMENTALS, MAKE_CONF_FILE, \
MODULES_FILE_PATH, PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, \
@@ -113,26 +106,6 @@ class _iuse_implicit_match_cache(object):
self._cache[flag] = m
return m
-class _local_repo_config(object):
- __slots__ = ('aliases', 'eclass_overrides', 'masters', 'name',)
- def __init__(self, name, repo_opts):
- self.name = name
-
- aliases = repo_opts.get('aliases')
- if aliases is not None:
- aliases = tuple(aliases.split())
- self.aliases = aliases
-
- eclass_overrides = repo_opts.get('eclass-overrides')
- if eclass_overrides is not None:
- eclass_overrides = tuple(eclass_overrides.split())
- self.eclass_overrides = eclass_overrides
-
- masters = repo_opts.get('masters')
- if masters is not None:
- masters = tuple(masters.split())
- self.masters = masters
-
class config(object):
"""
This class encompasses the main portage configuration. Data is pulled from
@@ -216,8 +189,6 @@ class config(object):
self.local_config = local_config
- self._local_repo_configs = None
-
if clone:
# For immutable attributes, use shallow copy for
# speed and memory conservation.
@@ -602,41 +573,6 @@ class config(object):
for k, v in penvdict.items():
self._penvdict.setdefault(k.cp, {})[k] = v
- self._local_repo_configs = {}
- self._local_repo_conf_path = \
- os.path.join(abs_user_config, 'repos.conf')
-
- repo_conf_parser = SafeConfigParser()
- try:
- repo_conf_parser.readfp(
- codecs.open(
- _unicode_encode(self._local_repo_conf_path,
- encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['content'], errors='replace')
- )
- except EnvironmentError as e:
- if e.errno != errno.ENOENT:
- raise
- del e
- except ParsingError as e:
- writemsg_level(
- _("!!! Error parsing '%s': %s\n") % \
- (self._local_repo_conf_path, e),
- level=logging.ERROR, noiselevel=-1)
- del e
- else:
- repo_defaults = repo_conf_parser.defaults()
- if repo_defaults:
- self._local_repo_configs['DEFAULT'] = \
- _local_repo_config('DEFAULT', repo_defaults)
- for repo_name in repo_conf_parser.sections():
- repo_opts = repo_defaults.copy()
- for opt_name in repo_conf_parser.options(repo_name):
- repo_opts[opt_name] = \
- repo_conf_parser.get(repo_name, opt_name)
- self._local_repo_configs[repo_name] = \
- _local_repo_config(repo_name, repo_opts)
-
#getting categories from an external file now
self.categories = [grabfile(os.path.join(x, "categories")) \
for x in locations_manager.profile_and_user_locations]