[Debian-l10n-commits] translate-toolkit branch master updated. debian/2.0.0_b5-2

Stuart Prescott stuart at moszumanska.debian.org
Sun Oct 23 01:58:31 UTC 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "translate-toolkit".

The branch, master has been updated
       via  9e149e42b89d9114ec7761b4f7b2ac8e257dc67f (commit)
       via  4a8c92762ce7c0726e64e70062fdf375153b8cbb (commit)
       via  c7fa2e845d9eb7f18524dd4323d9e49417ae8ee8 (commit)
      from  250f8a275e237e87c49042d0328f819f5897366e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

http://anonscm.debian.org/gitweb/?p=debian-l10n/translate-toolkit.git;a=commitdiff;h=9e149e42b89d9114ec7761b4f7b2ac8e257dc67f

commit 9e149e42b89d9114ec7761b4f7b2ac8e257dc67f
Author: Stuart Prescott <stuart at debian.org>
Date:   Sun Oct 23 01:11:59 2016 +1100

    Add changelog for upload


http://anonscm.debian.org/gitweb/?p=debian-l10n/translate-toolkit.git;a=commitdiff;h=4a8c92762ce7c0726e64e70062fdf375153b8cbb

commit 4a8c92762ce7c0726e64e70062fdf375153b8cbb
Author: Stuart Prescott <stuart at debian.org>
Date:   Sun Oct 23 01:10:35 2016 +1100

    Update autopkgtest test dependencies


http://anonscm.debian.org/gitweb/?p=debian-l10n/translate-toolkit.git;a=commitdiff;h=c7fa2e845d9eb7f18524dd4323d9e49417ae8ee8

commit c7fa2e845d9eb7f18524dd4323d9e49417ae8ee8
Author: Stuart Prescott <stuart at debian.org>
Date:   Sun Oct 23 01:05:20 2016 +1100

    Add python3-xapian to Build-Depends
    
    * Fix indexer/search tests to work with Python 3 (never been enabled before
      because python3-xapian not available)
    * Drop Apache mod_python check long since obsoleted upstream
    * Fix Xapian API usage for Xapian 1.4

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                            | 15 +++++++++
 debian/control                              |  1 +
 debian/patches/series                       |  3 ++
 debian/patches/xapian-no-apache-check.patch | 36 ++++++++++++++++++++++
 debian/patches/xapian-python3.patch         | 47 +++++++++++++++++++++++++++++
 debian/patches/xapian-query.patch           | 24 +++++++++++++++
 debian/tests/control                        | 46 ++--------------------------
 debian/tests/python-translate               |  4 +--
 debian/tests/python3-translate              |  4 +--
 9 files changed, 133 insertions(+), 47 deletions(-)
 create mode 100644 debian/patches/xapian-no-apache-check.patch
 create mode 100644 debian/patches/xapian-python3.patch
 create mode 100644 debian/patches/xapian-query.patch

diff --git a/debian/changelog b/debian/changelog
index 73342b3..e15962b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+translate-toolkit (2.0.0~b5-2) experimental; urgency=medium
+
+  * Add python3-xapian to the dependencies now that it is available.
+  * Add patches so that indexers and xapian module work under Python 3
+    - xapian-no-apache-check.patch: skip check if module is being loaded from
+      within mod_python. Thanks to Olly Betts for the suggestion.
+    - xapian-query.patch: don't use unneeded and now non-existent copy
+      constructor of xapian query objects. Thanks to Olly Betts for the hint.
+      (Closes: #839306)
+    - xapian-python3.patch: usual Python 2 to 3 jiggles with imports, lists and
+      encodings.
+  * Update autopkgtests to include newly added dependencies.
+
+ -- Stuart Prescott <stuart at debian.org>  Sun, 23 Oct 2016 01:11:44 +1100
+
 translate-toolkit (2.0.0~b5-1) experimental; urgency=medium
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index e7d485e..6827c2c 100644
--- a/debian/control
+++ b/debian/control
@@ -43,6 +43,7 @@ Build-Depends-Indep:
  python3-six (>> 1.9.0),
  python3-sphinx (>= 1.0.7+dfsg),
  python3-vobject,
+ python3-xapian,
  subversion,
 Build-Depends:
  debhelper (>= 9~),
diff --git a/debian/patches/series b/debian/patches/series
index e4c5ca6..2116b82 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,6 @@ sphinx-intersphinx.patch
 #langmodels-relocate.patch
 af-pootle.patch
 py3-skip-tests.patch
+xapian-no-apache-check.patch
+xapian-query.patch
+xapian-python3.patch
diff --git a/debian/patches/xapian-no-apache-check.patch b/debian/patches/xapian-no-apache-check.patch
new file mode 100644
index 0000000..cab3a23
--- /dev/null
+++ b/debian/patches/xapian-no-apache-check.patch
@@ -0,0 +1,36 @@
+Description: Remove unneeded check for running under Apache mod_python
+ The test to ensure that Xapian is not loaded into mod_python isn't required
+ any more. Obsoleted by https://trac.xapian.org/ticket/185
+Author: Stuart Prescott <stuart at debian.org>
+
+--- translate-toolkit-2.0.0~b5.orig/translate/search/indexing/XapianIndexer.py
++++ translate-toolkit-2.0.0~b5/translate/search/indexing/XapianIndexer.py
+@@ -31,28 +31,9 @@ you should checkout the following::
+ It is not completely working, but it should give you a good start.
+ """
+ 
+-# xapian module versions before 1.0.13 hangs apache under mod_python
+ import re
+ import six
+ import sys
+-
+-# detect if running under apache
+-if 'apache' in sys.modules or '_apache' in sys.modules or 'mod_wsgi' in sys.modules:
+-
+-    def _str2version(version):
+-        return [int(i) for i in version.split('.')]
+-
+-    import subprocess
+-    # even checking xapian version leads to deadlock under apache, must figure version from command line
+-    try:
+-        command = subprocess.Popen(['xapian-check', '--version'], stdout=subprocess.PIPE)
+-        stdout, stderr = command.communicate()
+-        if _str2version(re.match('.*([0-9]+\.[0-9]+\.[0-9]+).*', stdout).groups()[0]) < [1, 0, 13]:
+-            raise ImportError("Running under apache, can't load xapain")
+-    except:
+-        #FIXME: report is xapian-check command is missing?
+-        raise ImportError("Running under apache, can't load xapian")
+-
+ from . import CommonIndexer
+ import xapian
+ import os
diff --git a/debian/patches/xapian-python3.patch b/debian/patches/xapian-python3.patch
new file mode 100644
index 0000000..16e4e66
--- /dev/null
+++ b/debian/patches/xapian-python3.patch
@@ -0,0 +1,47 @@
+Description: Fix Xapian usage for Python 3
+  Fix various list, unicode and absolute import problems with Python 3
+  (code is still compatible with Python 2.7)
+Author: Stuart Prescott <stuart at debian.org>
+
+--- a/translate/search/indexing/CommonIndexer.py
++++ b/translate/search/indexing/CommonIndexer.py
+@@ -164,8 +164,8 @@
+         # turn a dict into a list if necessary
+         if isinstance(args, dict):
+             args = args.items()
+-        # turn 'args' into a list if necessary
+-        if not isinstance(args, list):
++        elif not isinstance(args, list):
++            # turn 'args' into a list if necessary
+             args = [args]
+         # combine all given queries
+         result = []
+--- a/translate/search/indexing/XapianIndexer.py
++++ b/translate/search/indexing/XapianIndexer.py
+@@ -487,10 +487,11 @@
+     # fill the dict
+     for term in match["document"].termlist():
+         for fname in fieldnames:
+-            if ((fname is None) and re.match("[^A-Z]", term.term)):
+-                value = term.term
+-            elif re.match("%s[^A-Z]" % str(fname).upper(), term.term):
+-                value = term.term[len(fname):]
++            termstr = term.term.decode('utf-8')
++            if ((fname is None) and re.match("[^A-Z]", termstr)):
++                value = termstr
++            elif re.match("%s[^A-Z]" % str(fname).upper(), termstr):
++                value = termstr[len(fname):]
+             else:
+                 continue
+             # we found a matching field/term
+--- a/translate/search/indexing/__init__.py
++++ b/translate/search/indexing/__init__.py
+@@ -62,7 +62,7 @@
+         mod_name = mod_file[:-3]
+         # TODO - debug: "[Indexer]: trying to import indexing engines from '%s'" % mod_path
+         try:
+-            module = __import__(mod_name, globals(), {})
++            module = __import__(mod_name, globals(), {}, level=1)
+         except ImportError:
+             # maybe it is unusable or dependencies are missing
+             continue
diff --git a/debian/patches/xapian-query.patch b/debian/patches/xapian-query.patch
new file mode 100644
index 0000000..be2e9ce
--- /dev/null
+++ b/debian/patches/xapian-query.patch
@@ -0,0 +1,24 @@
+Description: Drop unneeded copy constructor
+  Xapian 1.4 python bindings no longer include the copy constructor; it is not
+  needed in any case since the query objects are immutable.
+Author: Stuart Prescott <stuart at debian.org>
+
+--- a/translate/search/indexing/XapianIndexer.py
++++ b/translate/search/indexing/XapianIndexer.py
+@@ -137,14 +137,14 @@
+         """generate a query based on an existing query object
+ 
+         basically this function should just create a copy of the original
++        Since query objects are immutable, this function is a no-op
+ 
+         :param query: the original query object
+         :type query: xapian.Query
+         :return: the resulting query object
+         :rtype: xapian.Query
+         """
+-        # create a copy of the original query
+-        return xapian.Query(query)
++        return query
+ 
+     def _create_query_for_string(self, text, require_all=True, analyzer=None):
+         """generate a query for a plain term of a string query
diff --git a/debian/tests/control b/debian/tests/control
index 1c19e5a..b98f878 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,59 +1,19 @@
 Tests: translate-toolkit
+Restrictions: allow-stderr needs-recommends
 Depends:
   translate-toolkit,
-  libexttextcat-data,
-  libgettextpo0,
-  python-babel,
-  python-bs4,
-  python-chardet,
-  python-enchant,
-  python-iniparse,
-  python-levenshtein,
-  python-lxml,
-  python-l20n,
-  python-pytest,
-  python-simplejson,
-  python-subversion,
-  python-utidylib,
-  python-vobject,
-  python-xapian,
   subversion,
 
 Tests: python-translate
+Restrictions: allow-stderr needs-recommends
 Depends:
   python-translate,
-  libexttextcat-data,
-  libgettextpo0,
-  python-babel,
-  python-bs4,
-  python-chardet,
-  python-enchant,
-  python-iniparse,
-  python-levenshtein,
-  python-lxml,
-  python-l20n,
   python-pytest,
-  python-simplejson,
-  python-utidylib,
-  python-vobject,
-  python-xapian,
   subversion,
 
 Tests: python3-translate
+Restrictions: allow-stderr needs-recommends
 Depends:
   python3-translate,
-  libexttextcat-data,
-  libgettextpo0,
-  python3-aeidon,
-  python3-babel,
-  python3-bs4,
-  python3-chardet,
-  python3-enchant,
-  python3-iniparse,
-  python3-levenshtein,
-  python3-lxml,
-  python3-l20n,
   python3-pytest,
-  python3-simplejson,
-  python3-vobject,
   subversion,
diff --git a/debian/tests/python-translate b/debian/tests/python-translate
index 9e9c580..f8b91cb 100755
--- a/debian/tests/python-translate
+++ b/debian/tests/python-translate
@@ -10,7 +10,7 @@ export TTKIT_SKIP_COMMANDS=1
 cd "$ADTTMP"
 for py in $(pyversions -i); do
   echo "############### shipped tests ##################"
-  $py -m pytest -v -rsx /usr/lib/$py/dist-packages/translate 2>&1
+  $py -m pytest -v -rsx /usr/lib/$py/dist-packages/translate
   echo "############### additional tests ###############"
-  $py -m pytest -v -rsx tests 2>&1
+  $py -m pytest -v -rsx tests
 done
diff --git a/debian/tests/python3-translate b/debian/tests/python3-translate
index f2e5000..5d933e2 100755
--- a/debian/tests/python3-translate
+++ b/debian/tests/python3-translate
@@ -10,7 +10,7 @@ export TTKIT_SKIP_COMMANDS=1
 cd "$ADTTMP"
 for py in $(py3versions -i); do
   echo "############### shipped tests ##################"
-  $py -m pytest -v -rsx /usr/lib/python3/dist-packages/translate 2>&1
+  $py -m pytest -v -rsx /usr/lib/python3/dist-packages/translate
   echo "############### additional tests ###############"
-  $py -m pytest -v -rsx tests 2>&1
+  $py -m pytest -v -rsx tests
 done
-----------------------------------------------------------------------


hooks/post-receive
-- 
translate-toolkit



More information about the Debian-l10n-commits mailing list