[PATCH 2/6] Switch translation support to fedora.zanata.org
Vratislav Podzimek
vpodzime at redhat.com
Mon May 25 09:00:20 UTC 2015
On Wed, 2015-05-20 at 10:43 -0400, Chris Lumens wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
>
> This commit adjusts the Makefile targets to use zanata, and makebumpver
> to check the zanata.xml for the correct branch.
>
> Related: rhbz#1196721
> ---
> .tx/config | 9 ----
> Makefile.am | 10 ++--
> scripts/makebumpver | 134 ++++++++++++++++++++++++++++++++++++++++++++++------
> zanata.xml | 106 +++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 230 insertions(+), 29 deletions(-)
> delete mode 100644 .tx/config
> create mode 100644 zanata.xml
>
> diff --git a/.tx/config b/.tx/config
> deleted file mode 100644
> index db3663c..0000000
> --- a/.tx/config
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -[anaconda.f21-branch]
> -file_filter = po/<lang>.po
> -source_file = po/anaconda.pot
> -source_lang = en
> -type = PO
> -
> -[main]
> -host = https://www.transifex.com
> -
> diff --git a/Makefile.am b/Makefile.am
> index dcc6eed..6b4214d 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -44,8 +44,8 @@ dist_sbin_SCRIPTS = anaconda
>
> ARCHIVE_TAG = $(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)
>
> -TX_PULL_ARGS = -a -f
> -TX_PUSH_ARGS = -s
> +ZANATA_PULL_ARGS = --transdir $(srcdir)/po/
> +ZANATA_PUSH_ARGS = --srcdir $(srcdir)/po/ --push-type source --force
>
> INSTALLATION_GUIDE_REPO_URL = git://git.fedorahosted.org/git/docs/install-guide.git
>
> @@ -54,8 +54,8 @@ tag:
> @echo "Tagged as $(ARCHIVE_TAG)"
>
> po-pull:
> - rpm -q transifex-client &>/dev/null || ( echo "need to run: yum install transifex-client"; exit 1 )
> - tx pull $(TX_PULL_ARGS)
> + rpm -q zanata-python-client &>/dev/null || ( echo "need to run: yum install zanata-python-client"; exit 1 )
> + zanata pull $(ZANATA_PULL_ARGS)
>
> po-empty:
> for lingua in $$(grep -v '^#' $(srcdir)/po/LINGUAS) ; do \
> @@ -107,7 +107,7 @@ bumpver: po-pull
> fi ; \
> ( cd $(srcdir) && scripts/makebumpver $${opts} ) || exit 1 ; \
> $(MAKE) -C po $(PACKAGE_NAME).pot-update && \
> - tx push $(TX_PUSH_ARGS)
> + zanata push $(ZANATA_PUSH_ARGS)
>
> # Install all packages specified as BuildRequires in the Anaconda specfile
> # -> installs packages needed to build Anaconda
> diff --git a/scripts/makebumpver b/scripts/makebumpver
> index 1d56129..722984b 100755
> --- a/scripts/makebumpver
> +++ b/scripts/makebumpver
> @@ -34,6 +34,7 @@ import re
> import subprocess
> import sys
> import textwrap
> +import urllib
>
> class MakeBumpVer:
> def __init__(self, *args, **kwargs):
> @@ -78,8 +79,19 @@ class MakeBumpVer:
> self.configure = kwargs.get('configure')
> self.spec = kwargs.get('spec')
> self.skip_acks = kwargs.get('skip_acks', False)
> + self.skip_all = kwargs.get('skip_all', False)
> + self.zanata_config = kwargs.get('zanata_config')
> + self.skip_zanata = kwargs.get("skip_zanata", False)
> + self.skip_jenkins = kwargs.get("skip_jenkins", False)
>
> - # RHEL release number or None
> + if self.skip_all:
> + self.skip_acks = True
> + self.skip_jenkins = True
> + self.skip_zanata = True
> +
> + self.git_branch = None
> +
> + # RHEL release number or None (also fills in self.git_branch)
> self.rhel = self._isRHEL()
>
> def _gitConfig(self, field):
> @@ -286,22 +298,23 @@ class MakeBumpVer:
> author = tmp
>
> ckbug = self.bugmap.get(bug, bug)
> - valid = self._isRHELBug(ckbug, commit, summary)
> + valid = self.skip_all or self._isRHELBug(ckbug, commit, summary)
>
> if valid:
> summary = summary.replace(fullbug, "(%s)" % author)
> rhbz.add("Resolves: rhbz#%s" % ckbug)
>
> - if not self._isRHELBugInCorrectState(ckbug, commit,
> - summary):
> - bad = True
> + if not self.skip_all:
> + if not self._isRHELBugInCorrectState(ckbug, commit,
> + summary):
> + bad = True
>
> - if not self._isRHELBugFixedInVersion(ckbug, commit,
> - summary, fixedIn):
> - bad = True
> + if not self._isRHELBugFixedInVersion(ckbug, commit,
> + summary, fixedIn):
> + bad = True
>
> - if not self._isRHELBugAcked(ckbug, commit, summary):
> - bad = True
> + if not self._isRHELBugAcked(ckbug, commit, summary):
> + bad = True
> else:
> bad = True
> summary_bug = ckbug
> @@ -323,7 +336,7 @@ class MakeBumpVer:
> action = actionre.group()
> bug = bugre.group()
> ckbug = self.bugmap.get(bug, bug)
> - valid = self._isRHELBug(ckbug, commit, summary)
> + valid = self.skip_all or self._isRHELBug(ckbug, commit, summary)
>
> if valid:
> rhbz.add("%s: rhbz#%s" % (action, ckbug))
> @@ -336,6 +349,10 @@ class MakeBumpVer:
> else:
> bad = True
>
> + if self.skip_all:
> + print "*** Bug %s Related commit %s is allowed\n" % (bug, commit)
> + continue
> +
> if valid and action == 'Resolves' and \
> (not self._isRHELBugInCorrectState(ckbug, commit,
> summary) or \
> @@ -350,7 +367,7 @@ class MakeBumpVer:
> # Related bugs only need to be valid and have an ack
> bad = False
>
> - if len(rhbz) == 0:
> + if len(rhbz) == 0 and not self.skip_all:
> print("*** No bugs referenced in commit %s\n" % commit)
> bad = True
>
> @@ -417,7 +434,83 @@ class MakeBumpVer:
> f.writelines(bottom)
> f.close()
>
> + def check_jenkins(self):
The commit message should mention this also adds the Jenkins checking or
this part should be dropped from the patch.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list