aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-11-15 11:39:31 +0100
committerGuido Günther <agx@sigxcpu.org>2016-11-15 12:34:52 +0100
commit4cacaeb06e54d860f0848be291776491c4ed053f (patch)
tree67fa9a31741f5141437e6ed1f0822abf9c0f6f84
parentdedd3f5ab9007ef140ac735ede83b3c115d356f3 (diff)
Avoid printing deprecation twice
Some tools reparse the config. We don't want another deprecation in this case.
-rw-r--r--gbp/config.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gbp/config.py b/gbp/config.py
index ffd0b8e7..8f077ba8 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -424,9 +424,11 @@ class GbpOptionParser(OptionParser):
"please rename to [%s]" % (oldcmd, cmd))
def _warn_old_gbp_conf(self, gbp_conf):
- if not os.getenv("GBP_DISABLE_GBP_CONF_DEPRECTATION"):
+ if (not os.getenv("GBP_DISABLE_GBP_CONF_DEPRECTATION") and
+ not self._warned_old_gbp_conf):
gbp.log.warn("Deprecated configuration file found at %s, "
"check gbp.conf(5) for alternatives" % gbp_conf)
+ self._warned_old_gbp_conf = True
@staticmethod
def _listify(value):
@@ -541,6 +543,7 @@ class GbpOptionParser(OptionParser):
self.prefix = prefix
self.config = {}
self.valid_options = []
+ self._warned_old_gbp_conf = False
try:
self.parse_config_files()