From: Zac Medico Date: Fri, 9 Oct 2009 20:14:03 +0000 (-0000) Subject: Handle AUTOCLEAN and NOCOLOR case insensitivity inside config. X-Git-Tag: v2.2_rc45~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=32f6f79fb99b6ac92d8e9b106a909ea3e99ccdd1;p=portage.git Handle AUTOCLEAN and NOCOLOR case insensitivity inside config. svn path=/main/trunk/; revision=14528 --- 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)