Lines 987-992
Link Here
|
987 |
regex = regex.replace("\\.\\*", ".*") |
987 |
regex = regex.replace("\\.\\*", ".*") |
988 |
return regex |
988 |
return regex |
989 |
|
989 |
|
|
|
990 |
class _local_repo_config(object): |
991 |
__slots__ = ('eclass_overrides', 'name',) |
992 |
def __init__(self, name, repo_opts): |
993 |
self.name = name |
994 |
self.eclass_overrides = \ |
995 |
tuple(repo_opts.get('eclass-overrides', '').split()) |
996 |
|
990 |
class config(object): |
997 |
class config(object): |
991 |
""" |
998 |
""" |
992 |
This class encompasses the main portage configuration. Data is pulled from |
999 |
This class encompasses the main portage configuration. Data is pulled from |
Lines 1180-1191
Link Here
|
1180 |
|
1187 |
|
1181 |
self.user_profile_dir = None |
1188 |
self.user_profile_dir = None |
1182 |
self.local_config = local_config |
1189 |
self.local_config = local_config |
|
|
1190 |
self._local_repo_configs = None |
1191 |
self._local_repo_conf_path = None |
1183 |
|
1192 |
|
1184 |
if clone: |
1193 |
if clone: |
1185 |
self.incrementals = copy.deepcopy(clone.incrementals) |
1194 |
self.incrementals = copy.deepcopy(clone.incrementals) |
1186 |
self.profile_path = copy.deepcopy(clone.profile_path) |
1195 |
self.profile_path = copy.deepcopy(clone.profile_path) |
1187 |
self.user_profile_dir = copy.deepcopy(clone.user_profile_dir) |
1196 |
self.user_profile_dir = copy.deepcopy(clone.user_profile_dir) |
1188 |
self.local_config = copy.deepcopy(clone.local_config) |
1197 |
self.local_config = copy.deepcopy(clone.local_config) |
|
|
1198 |
self._local_repo_configs = \ |
1199 |
copy.deepcopy(clone._local_repo_configs) |
1200 |
self._local_repo_conf_path = \ |
1201 |
copy.deepcopy(clone._local_repo_conf_path) |
1189 |
|
1202 |
|
1190 |
self.module_priority = copy.deepcopy(clone.module_priority) |
1203 |
self.module_priority = copy.deepcopy(clone.module_priority) |
1191 |
self.modules = copy.deepcopy(clone.modules) |
1204 |
self.modules = copy.deepcopy(clone.modules) |
Lines 1628-1633
Link Here
|
1628 |
self._plicensedict[cp] = cp_dict |
1641 |
self._plicensedict[cp] = cp_dict |
1629 |
cp_dict[k] = self.expandLicenseTokens(v) |
1642 |
cp_dict[k] = self.expandLicenseTokens(v) |
1630 |
|
1643 |
|
|
|
1644 |
self._local_repo_configs = {} |
1645 |
self._local_repo_conf_path = \ |
1646 |
os.path.join(abs_user_config, 'repos.conf') |
1647 |
from ConfigParser import SafeConfigParser, ParsingError |
1648 |
repo_conf_parser = SafeConfigParser() |
1649 |
try: |
1650 |
repo_conf_parser.readfp( |
1651 |
codecs.open(self._local_repo_conf_path, |
1652 |
mode='r', errors='replace')) |
1653 |
except EnvironmentError, e: |
1654 |
if e.errno != errno.ENOENT: |
1655 |
raise |
1656 |
del e |
1657 |
except ParsingError, e: |
1658 |
portage.util.writemsg_level( |
1659 |
"!!! Error parsing '%s': %s\n" % \ |
1660 |
(self._local_repo_conf_path, e), |
1661 |
level=logging.ERROR, noiselevel=-1) |
1662 |
del e |
1663 |
else: |
1664 |
repo_defaults = repo_conf_parser.defaults() |
1665 |
if repo_defaults: |
1666 |
self._local_repo_configs['DEFAULT'] = \ |
1667 |
_local_repo_config('DEFAULT', repo_defaults) |
1668 |
for repo_name in repo_conf_parser.sections(): |
1669 |
repo_opts = repo_defaults.copy() |
1670 |
for opt_name in repo_conf_parser.options(repo_name): |
1671 |
repo_opts[opt_name] = \ |
1672 |
repo_conf_parser.get(repo_name, opt_name) |
1673 |
self._local_repo_configs[repo_name] = \ |
1674 |
_local_repo_config(repo_name, repo_opts) |
1675 |
|
1631 |
#getting categories from an external file now |
1676 |
#getting categories from an external file now |
1632 |
categories = [grabfile(os.path.join(x, "categories")) for x in locations] |
1677 |
categories = [grabfile(os.path.join(x, "categories")) for x in locations] |
1633 |
self.categories = tuple(sorted( |
1678 |
self.categories = tuple(sorted( |