From b7d972b4d18ad726c70f35b8026cbd94b2dc3b5f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 2 Sep 2012 13:33:06 -0700 Subject: [PATCH] emaint cleanconfmem: handle ROOT --- pym/portage/emaint/modules/config/config.py | 14 +++++++++++--- 1 file 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) -- 2.26.2