diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-10-20 16:07:22 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-10-20 16:15:30 +0200 |
commit | c092d7366feb6179d9a7e9516b38afddc28d57d7 (patch) | |
tree | 66e1623ea6e56ec94875c2edf2daba117efeb2f6 | |
parent | e917d3a0e9a5350f6a8d7960562321d11506ef33 (diff) |
config: warn on deprecated $REPO/.gbp.conf location
The file is deprecated at least since 2012 but we never warned about it.
Warning can be disabled via GBP_DISABLE_GBP_CONF_DEPRECTATION.
-rw-r--r-- | gbp/config.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gbp/config.py b/gbp/config.py index 4f96df7a..dc1d44cb 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -412,6 +412,10 @@ class GbpOptionParser(OptionParser): except KeyError: # Skip if filename wasn't expanded, i.e. we're not in git repo return + if (repo and + filename == os.path.join(repo.path, '.gbp.conf') and + os.path.exists(filename)): + self._warn_old_gbp_conf(filename) parser.read(filename) def _warn_old_config_section(self, oldcmd, cmd): @@ -419,6 +423,11 @@ class GbpOptionParser(OptionParser): gbp.log.warn("Old style config section [%s] found " "please rename to [%s]" % (oldcmd, cmd)) + def _warn_old_gbp_conf(self, gbp_conf): + if not os.getenv("GBP_DISABLE_GBP_CONF_DEPRECTATION"): + gbp.log.warn("Deprecated configuration file found at %s, " + "check gbp.conf(5) for alternatives" % gbp_conf) + @staticmethod def _listify(value): """ |