diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-10-20 15:51:55 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-10-20 15:52:51 +0200 |
commit | e917d3a0e9a5350f6a8d7960562321d11506ef33 (patch) | |
tree | 06821cbc09e17a74fa1f9f3635fd6b1a44d8eb49 | |
parent | 12fda23184240f75553a806f33466074a8a433e6 (diff) |
config: Turn dict of config files into a list
so we get a fixed order with all Python versions
-rw-r--r-- | gbp/config.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gbp/config.py b/gbp/config.py index 6516d698..4f96df7a 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -357,11 +357,11 @@ class GbpOptionParser(OptionParser): 'urgency': '-U', } - def_config_files = {'/etc/git-buildpackage/gbp.conf': 'system', - '~/.gbp.conf': 'global', - '%(top_dir)s/.gbp.conf': None, - '%(top_dir)s/debian/gbp.conf': 'debian', - '%(git_dir)s/gbp.conf': None} + def_config_files = [('/etc/git-buildpackage/gbp.conf', 'system'), + ('~/.gbp.conf', 'global'), + ('%(top_dir)s/.gbp.conf', None), + ('%(top_dir)s/debian/gbp.conf', 'debian'), + ('%(git_dir)s/gbp.conf', None)] list_opts = ['filter', 'component'] @@ -394,7 +394,7 @@ class GbpOptionParser(OptionParser): >>> if conf_backup is not None: os.environ['GBP_CONF_FILES'] = conf_backup """ envvar = os.environ.get('GBP_CONF_FILES') - files = envvar.split(':') if envvar else klass.def_config_files.keys() + files = envvar.split(':') if envvar else [f for (f, _) in klass.def_config_files] files = [os.path.expanduser(fname) for fname in files] if no_local: files = [fname for fname in files if fname.startswith('/')] @@ -655,7 +655,7 @@ class GbpOptionParser(OptionParser): >>> GbpOptionParser._name_to_filename('debian') '%(top_dir)s/debian/gbp.conf' """ - for k, v in cls.def_config_files.items(): + for k, v in cls.def_config_files: if name == v: return k else: |