Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralaaosh <alaaosh@54714841-351b-0410-a198-e36a94b762f5>2009-11-30 16:06:07 (GMT)
committer Sayamindu Dasgupta <sayamindu@gmail.com>2010-01-09 09:12:13 (GMT)
commitd0fa999292aa043566963155eef1625f7d44984e (patch)
treeec51e72fa978c7d758284096ee114eba3a27454f
parentb7dde386261f8af96558983bd692c2b24a4b48a4 (diff)
ooops using string comparson when numerical is what we wanted
git-svn-id: https://translate.svn.sourceforge.net/svnroot/translate/src/trunk/translate@13410 54714841-351b-0410-a198-e36a94b762f5
-rw-r--r--translate-toolkit-1.5.1/translate/search/indexing/XapianIndexer.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/translate-toolkit-1.5.1/translate/search/indexing/XapianIndexer.py b/translate-toolkit-1.5.1/translate/search/indexing/XapianIndexer.py
index cf1c864..2c7fac0 100644
--- a/translate-toolkit-1.5.1/translate/search/indexing/XapianIndexer.py
+++ b/translate-toolkit-1.5.1/translate/search/indexing/XapianIndexer.py
@@ -36,16 +36,21 @@ __revision__ = "$Id: XapianIndexer.py 13124 2009-11-16 10:51:22Z friedelwolff $"
# xapian module versions before 1.0.13 hangs apache under mod_python
import sys
import re
+
# detect if running under apache
if 'apache' in sys.modules or '_apache' 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 re.match('.*([0-9]+\.[0-9]+\.[0-9]+).*', stdout).groups()[0] < '1.0.13':
+ 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")
import CommonIndexer