summaryrefslogtreecommitdiff
path: root/gbp/config.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-02-18 22:54:41 +0100
committerGuido Günther <agx@sigxcpu.org>2014-02-19 08:33:33 +0100
commitf1bc54279b6f2a9b8848196044ba5312e2af9aaf (patch)
treebb4b86860addbfd5cea6908d224fa61d0ba97665 /gbp/config.py
parent1b0b17c7138617f8a77c4e66b1cc493549e5e0f8 (diff)
downloadgit-buildpackage-f1bc54279b6f2a9b8848196044ba5312e2af9aaf.tar.gz
git-buildpackage-f1bc54279b6f2a9b8848196044ba5312e2af9aaf.tar.bz2
git-buildpackage-f1bc54279b6f2a9b8848196044ba5312e2af9aaf.zip
config: Don't pull in config defaults twice
This would otherwise overwrite values set in the legacy config sections. Closes: #733759
Diffstat (limited to 'gbp/config.py')
-rw-r--r--gbp/config.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gbp/config.py b/gbp/config.py
index d4c0e5ad..fa6e6798 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -330,18 +330,19 @@ class GbpOptionParser(OptionParser):
for prefix in ['gbp', 'git']:
oldcmd = '%s-%s' % (prefix, self.command)
if parser.has_section(oldcmd):
- # Don't use items() until we got rid of the compat sections
- # since this pulls in the defaults again
- self.config.update(dict(parser._sections[cmd].items()))
+ self.config.update(dict(parser.items(oldcmd, raw=True)))
cmd = self.command
# Update with command specific settings
if parser.has_section(cmd):
self.config.update(dict(parser.items(cmd, raw=True)))
+ # Don't use items() until we got rid of the compat sections
+ # since this pulls in the defaults again
+ self.config.update(dict(parser._sections[cmd].items()))
for section in self.sections:
if parser.has_section(section):
- self.config.update(dict(parser.items(section, raw=True)))
+ self.config.update(dict(parser._sections[section].items()))
else:
raise NoSectionError("Mandatory section [%s] does not exist."
% section)