diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-10-09 20:14:03 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-10-09 20:14:03 +0000 |
commit | 32f6f79fb99b6ac92d8e9b106a909ea3e99ccdd1 (patch) | |
tree | aef14d740b496529e8d76ad7039f6ce88d46830f | |
parent | fe4a919336b31cfbcb36e050e846f265f36b1c09 (diff) | |
download | portage-32f6f79fb99b6ac92d8e9b106a909ea3e99ccdd1.tar.gz portage-32f6f79fb99b6ac92d8e9b106a909ea3e99ccdd1.tar.bz2 portage-32f6f79fb99b6ac92d8e9b106a909ea3e99ccdd1.zip |
Handle AUTOCLEAN and NOCOLOR case insensitivity inside config.
svn path=/main/trunk/; revision=14528
-rw-r--r-- | pym/_emerge/actions.py | 8 | ||||
-rw-r--r-- | pym/portage/__init__.py | 9 |
2 files changed, 9 insertions, 8 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 5fc43bd7b..9788c0857 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2316,14 +2316,6 @@ def action_uninstall(settings, trees, ldpath_mtimes, def adjust_config(myopts, settings): """Make emerge specific adjustments to the config.""" - # To enhance usability, make some vars case insensitive by forcing them to - # lower case. - for myvar in ("AUTOCLEAN", "NOCOLOR"): - if myvar in settings: - settings[myvar] = settings[myvar].lower() - settings.backup_changes(myvar) - del myvar - # Kill noauto as it will break merges otherwise. if "noauto" in settings.features: settings.features.remove('noauto') diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index c4c20eee1..a0c9277a9 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1485,6 +1485,10 @@ class config(object): ('ACCEPT_PROPERTIES', '*'), ) + # To enhance usability, make some vars case insensitive + # by forcing them to lower case. + _case_insensitive_vars = ('AUTOCLEAN', 'NOCOLOR',) + def __init__(self, clone=None, mycpv=None, config_profile_path=None, config_incrementals=None, config_root=None, target_root=None, local_config=True, env=None): @@ -2207,6 +2211,11 @@ class config(object): self._init_dirs() + for k in self._case_insensitive_vars: + if k in self: + self[k] = self[k].lower() + self.backup_changes(k) + if mycpv: self.setcpv(mycpv) |