summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-29 07:58:22 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-29 07:58:22 +0000
commit90e13cbf14068144036f282b7796c7401d9d4483 (patch)
treeeb3a37356247db2ba4b4ccea776f6278469d242e
parent11cb9d173ecb97744660ad687727872305cd52e8 (diff)
downloadportage-90e13cbf14068144036f282b7796c7401d9d4483.tar.gz
portage-90e13cbf14068144036f282b7796c7401d9d4483.tar.bz2
portage-90e13cbf14068144036f282b7796c7401d9d4483.zip
Use KeyValuePairFileLoader intead on getconfig(), since getconfig() is too
strict about variable names now. svn path=/main/trunk/; revision=14169
-rw-r--r--pym/portage/dispatch_conf.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py
index df3134c75..49e53c2ee 100644
--- a/pym/portage/dispatch_conf.py
+++ b/pym/portage/dispatch_conf.py
@@ -21,15 +21,19 @@ RCS_MERGE = "rcsmerge -p -r" + RCS_BRANCH + " '%s' > '%s'"
DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'"
def read_config(mandatory_opts):
- try:
- opts = portage.getconfig('/etc/dispatch-conf.conf')
- except:
- opts = None
-
+ loader = portage.env.loaders.KeyValuePairFileLoader(
+ '/etc/dispatch-conf.conf', None)
+ opts, errors = loader.load()
if not opts:
print >> sys.stderr, _('dispatch-conf: Error reading /etc/dispatch-conf.conf; fatal')
sys.exit(1)
+ # Handle quote removal here, since KeyValuePairFileLoader doesn't do that.
+ quotes = "\"'"
+ for k, v in opts.iteritems():
+ if v[:1] in quotes and v[:1] == v[-1:]:
+ opts[k] = v[1:-1]
+
for key in mandatory_opts:
if key not in opts:
if key == "merge":