summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-09-02 13:33:06 -0700
committerZac Medico <zmedico@gentoo.org>2012-09-02 13:33:06 -0700
commitb7d972b4d18ad726c70f35b8026cbd94b2dc3b5f (patch)
treea0b70f6ad6f60d0170f5b7bf9a02251ea897586c
parentce16249658fa99a8b2051a19091b85f712f5dac1 (diff)
downloadportage-b7d972b4d18ad726c70f35b8026cbd94b2dc3b5f.tar.gz
portage-b7d972b4d18ad726c70f35b8026cbd94b2dc3b5f.tar.bz2
portage-b7d972b4d18ad726c70f35b8026cbd94b2dc3b5f.zip
emaint cleanconfmem: handle ROOT
-rw-r--r--pym/portage/emaint/modules/config/config.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/pym/portage/emaint/modules/config/config.py b/pym/portage/emaint/modules/config/config.py
index 33bd19c31..f20068cda 100644
--- a/pym/portage/emaint/modules/config/config.py
+++ b/pym/portage/emaint/modules/config/config.py
@@ -11,6 +11,7 @@ class CleanConfig(object):
short_desc = "Discard any no longer installed configs from emerge's tracker list"
def __init__(self):
+ self._root = portage.settings["ROOT"]
self.target = os.path.join(portage.settings["EROOT"], PRIVATE_PATH, 'config')
def name():
@@ -52,10 +53,17 @@ class CleanConfig(object):
if onProgress:
onProgress(maxval, 0)
i = 0
- keys = sorted(configs)
+
+ root = self._root
+ if root == "/":
+ root = None
modified = False
- for config in keys:
- if not os.path.exists(config):
+ for config in sorted(configs):
+ if root is None:
+ full_path = config
+ else:
+ full_path = os.path.join(root, config.lstrip(os.sep))
+ if not os.path.exists(full_path):
modified = True
configs.pop(config)
messages.append(" %s" % config)