Handle AUTOCLEAN and NOCOLOR case insensitivity inside config.
authorZac Medico <zmedico@gentoo.org>
Fri, 9 Oct 2009 20:14:03 +0000 (20:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 9 Oct 2009 20:14:03 +0000 (20:14 -0000)
svn path=/main/trunk/; revision=14528

pym/_emerge/actions.py
pym/portage/__init__.py

index 5fc43bd7b909a6633b1d984dd6c9150c0e06d37a..9788c08577dc83c2d85dff5063efae706a4978f6 100644 (file)
@@ -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')
index c4c20eee165df1d3ceafb06764adca02604dd6bd..a0c9277a96d24c01a764b967dcd7e4f970572cdd 100644 (file)
@@ -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)