[PATCH] fixup! Add transifex branch check to makebumpver

Brian C. Lane bcl at redhat.com
Fri Oct 10 19:03:18 UTC 2014


---
 Makefile.am         |  4 ++--
 scripts/makebumpver | 16 ++++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8ac870a..edefa8e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -77,8 +77,8 @@ scratch-bumpver: po-empty
 	if [ ! -z "$(BZDEBUG)" ]; then \
 		opts="$${opts} -d" ; \
 	fi ; \
-	( cd $(srcdir) && scripts/makebumpver $${opts} ) || exit 1 ; \
-	$(MAKE) -C po $(PACKAGE_NAME).pot-update ; 
+	( cd $(srcdir) && scripts/makebumpver --skip-tx $${opts} ) || exit 1 ; \
+	$(MAKE) -C po $(PACKAGE_NAME).pot-update ;
 
 release:
 	$(MAKE) dist && $(MAKE) tag && git checkout -- $(srcdir)/po/$(PACKAGE_NAME).pot
diff --git a/scripts/makebumpver b/scripts/makebumpver
index c6cdd57..ea69916 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -81,6 +81,7 @@ class MakeBumpVer:
         self.skip_acks = kwargs.get('skip_acks', False)
         self.skip_all = kwargs.get('skip_all', False)
         self.tx_config = kwargs.get('tx_config')
+        self.skip_tx = kwargs.get("skip_tx", False)
 
         if self.skip_all:
             self.skip_acks = True
@@ -442,6 +443,10 @@ class MakeBumpVer:
         This is to prevent accidentally pushing translations to the wrong branch,
         eg. when branching for a new release and .tx/config hasn't been updated
         """
+        if not self.git_branch:
+            log.error("No git branch, cannot check transifex config")
+            return False
+
         ret = True
         section_name = "anaconda."+self.git_branch
 
@@ -462,7 +467,7 @@ class MakeBumpVer:
         return ret
 
     def run(self):
-        if not self.check_transifex():
+        if not self.skip_tx and not self.check_transifex():
             sys.exit(1)
 
         newVersion = self._incrementVersion()
@@ -484,6 +489,7 @@ def usage(cmd):
     sys.stdout.write("    -s, --skip-acks  Skip checking for rhel-X.X.X ack flag\n")
     sys.stdout.write("    -S, --skip-all   Skip all checks\n")
     sys.stdout.write("    -d, --debug      Turn on debug logging to stdout\n")
+    sys.stdout.write("    --skip-tx        Skip checking Transifex config for branch name\n")
     sys.stdout.write("\nThe -i switch is intended for use with utility commits that we do not need to\n")
     sys.stdout.write("reference in the spec file changelog.  The -m switch is used to map a Fedora\n")
     sys.stdout.write("BZ number to a RHEL BZ number for the spec file changelog.  Use -m if you have\n")
@@ -498,14 +504,14 @@ def main(argv):
     tx_config = os.path.realpath(cwd + '/.tx/config')
     name, version, release, bugreport = None, None, None, None
     ignore, bugmap = None, None
-    show_help, unknown, skip_acks, skip_all = False, False, False, False
+    show_help, unknown, skip_acks, skip_all, skip_tx = False, False, False, False, False
     opts = []
 
     try:
         opts, _args = getopt.getopt(sys.argv[1:], 'n:v:r:b:i:m:sSd?',
                                    ['name=', 'version=', 'release=',
                                     'bugreport=', 'ignore=', 'map=',
-                                    'debug', 'help'])
+                                    'debug', 'help', 'skip-tx'])
     except getopt.GetoptError:
         show_help = True
 
@@ -528,6 +534,8 @@ def main(argv):
             skip_all = True
         elif o in ('-d', '--debug'):
             log.setLevel(logging.DEBUG)
+        elif o in ('--skip-tx'):
+            skip_tx = True
         elif o in ('-?', '--help'):
             show_help = True
         else:
@@ -564,7 +572,7 @@ def main(argv):
     mbv = MakeBumpVer(name=name, version=version, release=release,
                       bugreport=bugreport, ignore=ignore, bugmap=bugmap,
                       configure=configure, spec=spec, skip_acks=skip_acks,
-                      skip_all=skip_all, tx_config=tx_config)
+                      skip_all=skip_all, tx_config=tx_config, skip_tx=skip_tx)
     mbv.run()
 
 if __name__ == "__main__":
-- 
1.9.3



More information about the anaconda-patches mailing list