aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-09-02 19:46:46 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-09-02 19:46:46 (GMT)
commit6a4d36cf51ceac6e300a38b7e1272625e291c9a6 (patch)
tree8b460856a7f1abab364c92a05487eb4fb90cbd68
parentvalidate_desktop_entry: handle emacs.desktop (diff)
downloadportage-6a4d36cf51ceac6e300a38b7e1272625e291c9a6.zip
portage-6a4d36cf51ceac6e300a38b7e1272625e291c9a6.tar.gz
portage-6a4d36cf51ceac6e300a38b7e1272625e291c9a6.tar.bz2
emaint cleanconfmem: ignore md5, bug #433694
-rw-r--r--pym/portage/emaint/modules/config/config.py33
1 files changed, 7 insertions, 26 deletions
diff --git a/pym/portage/emaint/modules/config/config.py b/pym/portage/emaint/modules/config/config.py
index a80d87d..e028852 100644
--- a/pym/portage/emaint/modules/config/config.py
+++ b/pym/portage/emaint/modules/config/config.py
@@ -4,7 +4,6 @@
import portage
from portage import os
from portage.const import PRIVATE_PATH
-from portage.checksum import perform_md5
class CleanConfig(object):
@@ -32,43 +31,32 @@ class CleanConfig(object):
onProgress = kwargs.get('onProgress', None)
configs = self.load_configlist()
messages = []
- chksums = []
maxval = len(configs)
if onProgress:
onProgress(maxval, 0)
i = 0
keys = sorted(configs)
for config in keys:
- if os.path.exists(config):
- md5sumactual = perform_md5(config)
- if md5sumactual != configs[config]:
- chksums.append(" %s" % config)
- else:
+ if not os.path.exists(config):
messages.append(" %s" % config)
if onProgress:
onProgress(maxval, i+1)
i += 1
- return self._format_output(messages, chksums)
+ return self._format_output(messages)
def fix(self, **kwargs):
onProgress = kwargs.get('onProgress', None)
configs = self.load_configlist()
messages = []
- chksums = []
maxval = len(configs)
if onProgress:
onProgress(maxval, 0)
i = 0
keys = sorted(configs)
for config in keys:
- if os.path.exists(config):
- md5sumactual = perform_md5(config)
- if md5sumactual != configs[config]:
- chksums.append(" %s" % config)
- configs.pop(config)
- else:
- configs.pop(config)
- messages.append(" %s" % config)
+ if not os.path.exists(config):
+ configs.pop(config)
+ messages.append(" %s" % config)
if onProgress:
onProgress(maxval, i+1)
i += 1
@@ -80,9 +68,9 @@ class CleanConfig(object):
lines.append('')
with open(self.target, 'w') as configfile:
configfile.write('\n'.join(lines))
- return self._format_output(messages, chksums, True)
+ return self._format_output(messages, True)
- def _format_output(self, messages=[], chksums=[], cleaned=False):
+ def _format_output(self, messages=[], cleaned=False):
output = []
if messages:
output.append('Not Installed:')
@@ -91,11 +79,4 @@ class CleanConfig(object):
if cleaned:
tot += ' ...Cleaned'
output.append(tot % len(messages))
- if chksums:
- output.append('\nChecksums did not match:')
- output += chksums
- tot = '------------------------------------\n Total %i Checksums did not match'
- if cleaned:
- tot += ' ...Cleaned'
- output.append(tot % len(chksums))
return output