Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r14169 - main/trunk/pym/portage
Date: Sat, 29 Aug 2009 02:49:19
Message-Id: E1MhIpL-0003HH-9h@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-08-29 07:58:22 +0000 (Sat, 29 Aug 2009)
3 New Revision: 14169
4
5 Modified:
6 main/trunk/pym/portage/dispatch_conf.py
7 Log:
8 Use KeyValuePairFileLoader intead on getconfig(), since getconfig() is too
9 strict about variable names now.
10
11
12 Modified: main/trunk/pym/portage/dispatch_conf.py
13 ===================================================================
14 --- main/trunk/pym/portage/dispatch_conf.py 2009-08-29 07:03:21 UTC (rev 14168)
15 +++ main/trunk/pym/portage/dispatch_conf.py 2009-08-29 07:58:22 UTC (rev 14169)
16 @@ -21,15 +21,19 @@
17 DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'"
18
19 def read_config(mandatory_opts):
20 - try:
21 - opts = portage.getconfig('/etc/dispatch-conf.conf')
22 - except:
23 - opts = None
24 -
25 + loader = portage.env.loaders.KeyValuePairFileLoader(
26 + '/etc/dispatch-conf.conf', None)
27 + opts, errors = loader.load()
28 if not opts:
29 print >> sys.stderr, _('dispatch-conf: Error reading /etc/dispatch-conf.conf; fatal')
30 sys.exit(1)
31
32 + # Handle quote removal here, since KeyValuePairFileLoader doesn't do that.
33 + quotes = "\"'"
34 + for k, v in opts.iteritems():
35 + if v[:1] in quotes and v[:1] == v[-1:]:
36 + opts[k] = v[1:-1]
37 +
38 for key in mandatory_opts:
39 if key not in opts:
40 if key == "merge":