From c092d7366feb6179d9a7e9516b38afddc28d57d7 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 20 Oct 2016 16:07:22 +0200 Subject: 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. --- gbp/config.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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): """ -- cgit v1.2.3