diff -pruN 0.44/axi/indexer.py 0.44ubuntu5/axi/indexer.py
--- 0.44/axi/indexer.py	2011-06-21 22:49:53.000000000 +0000
+++ 0.44ubuntu5/axi/indexer.py	2011-09-21 11:48:39.000000000 +0000
@@ -558,6 +558,11 @@ class Indexer(object):
         for idx, pkg in enumerate(cache):
             if not pkg.candidate:
                 continue
+            # multiarch: do not index foreign arch if there is a native
+            # archive version available (unless the pkg is installed)
+            if (not pkg.installed and
+                ":" in pkg.name and pkg.name.split(":")[0] in cache):
+                continue
             # Print progress
             if idx % 200 == 0: self.progress.progress(100*idx/count)
             yield self.get_document_from_apt(pkg)
@@ -621,7 +626,11 @@ class Indexer(object):
         """
         Update the index
         """
-        db = xapian.WritableDatabase(pathname, xapian.DB_CREATE_OR_OPEN)
+        try:
+            db = xapian.WritableDatabase(pathname, xapian.DB_CREATE_OR_OPEN)
+        except xapian.DatabaseLockError, e:
+            self.progress.warning("DB Update failed, database locked")
+            return
         cache = self.aptcache()
         count = len(cache)
 
diff -pruN 0.44/debian/changelog 0.44ubuntu5/debian/changelog
--- 0.44/debian/changelog	2011-06-21 22:51:16.000000000 +0000
+++ 0.44ubuntu5/debian/changelog	2011-12-31 02:00:43.000000000 +0000
@@ -1,3 +1,44 @@
+apt-xapian-index (0.44ubuntu5) precise; urgency=low
+
+  * Rebuild to drop python2.6 dependencies.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sat, 31 Dec 2011 02:00:43 +0000
+
+apt-xapian-index (0.44ubuntu4) oneiric; urgency=low
+
+  * Don't call update-python-modules in the postinst. LP: #856627.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sat, 24 Sep 2011 14:42:18 +0200
+
+apt-xapian-index (0.44ubuntu3) oneiric; urgency=low
+
+  * axi/indexer.py:
+    - prefer native packages over foreign packages (unless there
+      is no native version or the foreign package is installed)
+      (LP: #830508)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Wed, 21 Sep 2011 13:48:47 +0200
+
+apt-xapian-index (0.44ubuntu2) oneiric; urgency=low
+
+  * debian/patches/01_axi_cjk_support.patch:
+    - Activate the CJK support when indexing the database
+  * debian/control, debian/rules:
+    - add quilt for above patch
+
+ -- Didier Roche <didrocks@ubuntu.com>  Thu, 01 Sep 2011 18:26:04 +0200
+
+apt-xapian-index (0.44ubuntu1) oneiric; urgency=low
+
+  * Merge from debian unstable.  Remaining changes:
+    - do not crash if the DB is already locked (LP: #590998)
+    - move to dh_python2
+    - do not modify the DB "in-place" with --update
+  * ignore file not found errors when checking for the mtime
+    (LP: #752195), thanks to Brian Murray
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 26 Jul 2011 09:02:49 +0200
+
 apt-xapian-index (0.44) unstable; urgency=low
 
   * Applied trailing comma patch by Cédric Boutillier. Closes: #630774
@@ -18,6 +59,22 @@ apt-xapian-index (0.44) unstable; urgenc
 
  -- Enrico Zini <enrico@debian.org>  Wed, 22 Jun 2011 00:50:25 +0200
 
+apt-xapian-index (0.43ubuntu1) oneiric; urgency=low
+
+  * Merge from debian unstable.  Remaining changes:
+    - when upgrading, ensure the index is fully rebuild (in the
+      background) to ensure that we get updated information in
+      /var/lib/apt-xapian-index/{index.values} and that the index
+      fully utilizes the new plugins (LP: #646018)
+    - use ionice for the index building
+    - do not crash if the DB is already locked (LP: #590998)
+    - data/org.debian.AptXapianIndex.conf: fix policy
+    - move to dh_python2
+    - update-apt-xapian-index-dbus:
+      + fix type of "start-time" for policykit (LP: #675533)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 17 Jun 2011 10:51:30 +0200
+
 apt-xapian-index (0.43) unstable; urgency=low
 
   * Implemented axi-cache info. Closes: #602600
@@ -35,6 +92,62 @@ apt-xapian-index (0.42) unstable; urgenc
 
  -- Enrico Zini <enrico@debian.org>  Wed, 09 Mar 2011 14:08:34 +0000
 
+apt-xapian-index (0.41ubuntu7) oneiric; urgency=low
+
+  * switch from python-support to dh_python2
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 10 Jun 2011 13:22:42 +0200
+
+apt-xapian-index (0.41ubuntu6) natty; urgency=low
+
+  * debian/cron.weekly:
+    - do not modify the DB "in-place" with --update to avoid
+      software-center seeing a corrupted database when it has
+      it open at the same time
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 18 Apr 2011 11:15:27 +0200
+
+apt-xapian-index (0.41ubuntu5) natty; urgency=low
+
+  * update-apt-xapian-index:
+    - do not crash if the DB is already logged, thanks to Martin Schaaf
+      (LP: #590998)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 28 Jan 2011 14:29:21 +0100
+
+apt-xapian-index (0.41ubuntu4) natty; urgency=low
+
+  * data/org.debian.AptXapianIndex.conf:
+    - fix typo
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 27 Jan 2011 15:57:50 +0100
+
+apt-xapian-index (0.41ubuntu3) natty; urgency=low
+
+  * data/org.debian.AptXapianIndex.conf:
+    - update policy to avoid warning in software-center on
+      startup
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 27 Jan 2011 15:39:54 +0100
+
+apt-xapian-index (0.41ubuntu2) natty; urgency=low
+
+  * update-apt-xapian-index-dbus:
+    - fix type of "start-time" for policykit (LP: #675533)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Wed, 01 Dec 2010 17:45:52 +0100
+
+apt-xapian-index (0.41ubuntu1) natty; urgency=low
+
+  * Merge from debian unstable.  Remaining changes:
+    - when upgrading, ensure the index is fully rebuild (in the
+      background) to ensure that we get updated information in
+      /var/lib/apt-xapian-index/{index.values} and that the index
+      fully utilizes the new plugins (LP: #646018)
+    - use ionice for the index building
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Wed, 17 Nov 2010 17:50:20 +0100
+
 apt-xapian-index (0.41) unstable; urgency=low
 
   * Fixed typo in dbus config
@@ -50,6 +163,16 @@ apt-xapian-index (0.40) unstable; urgenc
 
  -- Enrico Zini <enrico@debian.org>  Sun, 03 Oct 2010 11:39:28 +0100
 
+apt-xapian-index (0.39ubuntu1) maverick; urgency=low
+
+  * debian/postinst:
+    - when upgrading, ensure the index is fully rebuild (in the
+      background) to ensure that we get updated information in
+      /var/lib/apt-xapian-index/{index.values} and that the index
+      fully utilizes the new plugins (LP: #646018)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 23 Sep 2010 16:04:11 +0200
+
 apt-xapian-index (0.39) unstable; urgency=low
 
   [ Enrico Zini ]
@@ -408,3 +531,4 @@ apt-xapian-index (0.1) experimental; urg
     system-wide index of Debian package metadata.
 
  -- Enrico Zini <enrico@debian.org>  Tue, 16 Oct 2007 12:20:43 +0100
+
diff -pruN 0.44/debian/control 0.44ubuntu5/debian/control
--- 0.44/debian/control	2011-06-21 17:28:31.000000000 +0000
+++ 0.44ubuntu5/debian/control	2011-09-21 11:27:03.000000000 +0000
@@ -1,10 +1,11 @@
 Source: apt-xapian-index
 Section: admin
 Priority: optional
-Maintainer: Enrico Zini <enrico@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Enrico Zini <enrico@debian.org>
 Uploaders: David Paleino <dapal@debian.org>
-Build-Depends: debhelper (>= 7.0.50~)
-Build-Depends-Indep: help2man, python, python-support,
+Build-Depends: debhelper (>= 7.0.50~), quilt
+Build-Depends-Indep: help2man, python (>= 2.6.6-3~),
  bash-completion (>= 1:1.0-1~), 
  python-xapian (>= 1.0.2),
  python-apt (>= 0.7.93.2),
@@ -14,7 +15,7 @@ Standards-Version: 3.9.1.0
 Vcs-Git: git://git.debian.org/git/collab-maint/apt-xapian-index.git
 Vcs-Browser: http://git.debian.org/?p=collab-maint/apt-xapian-index.git
 Homepage: http://www.enricozini.org/sw/apt-xapian-index/
-XS-Python-Version: >=2.4
+X-Python-Version: >=2.4
 
 Package: apt-xapian-index
 Architecture: all
diff -pruN 0.44/debian/cron.weekly 0.44ubuntu5/debian/cron.weekly
--- 0.44/debian/cron.weekly	2011-06-21 17:32:20.000000000 +0000
+++ 0.44ubuntu5/debian/cron.weekly	2011-09-21 11:27:03.000000000 +0000
@@ -23,8 +23,8 @@ if [ -x "$CMD" ]
 then
 	if [ -x "$IONICE" ]
 	then
-		nice -n 19 $IONICE -c 3 $CMD --update --quiet
+		nice -n 19 $IONICE -c 3 $CMD --quiet
 	else
-		nice -n 19 $CMD --update --quiet
+		nice -n 19 $CMD --quiet
 	fi
 fi
diff -pruN 0.44/debian/patches/01_axi_cjk_support.patch 0.44ubuntu5/debian/patches/01_axi_cjk_support.patch
--- 0.44/debian/patches/01_axi_cjk_support.patch	1970-01-01 00:00:00.000000000 +0000
+++ 0.44ubuntu5/debian/patches/01_axi_cjk_support.patch	2011-09-21 11:27:03.000000000 +0000
@@ -0,0 +1,152 @@
+=== modified file 'axi-cache'
+--- a/axi-cache	2011-09-01 10:17:43 +0000
++++ b/axi-cache	2011-09-01 11:01:25 +0000
+@@ -40,6 +40,9 @@
+ XDG_CACHE_HOME = os.environ.get("XDG_CACHE_HOME", os.path.expanduser("~/.cache"))
+ CACHEFILE = os.path.join(XDG_CACHE_HOME, "axi-cache.state")
+ 
++# Activate support for the CJK tokenizer
++os.environ["XAPIAN_CJK_NGRAM"] = "1"
++
+ try:
+     from ConfigParser import RawConfigParser
+     import re
+
+=== modified file 'axi/indexer.py'
+--- a/axi/indexer.py	2011-09-01 10:17:43 +0000
++++ b/axi/indexer.py	2011-09-01 11:44:12 +0000
+@@ -617,6 +617,9 @@
+         self.progress.end()
+         return unchanged, outdated, obsolete
+ 
++    def is_cjk_enabled (self):
++        return "XAPIAN_CJK_NGRAM" in os.environ
++
+     def updateIndex(self, pathname):
+         """
+         Update the index
+@@ -626,6 +629,12 @@
+         except xapian.DatabaseLockError, e:
+             self.progress.warning("DB Update failed, database locked")
+             return
++
++        # Make sure the index CJK-compatible
++        if self.is_cjk_enabled() and db.get_metadata("cjk_ngram") != "1":
++            self.progress.notice("The index %s is not CJK-compatible, rebuilding it" % axi.XAPIANINDEX)
++            return self.rebuild()
++
+         cache = self.aptcache()
+         count = len(cache)
+ 
+@@ -682,6 +691,11 @@
+ 
+         # Create a new Xapian index
+         db = xapian.WritableDatabase(pathname, xapian.DB_CREATE_OR_OVERWRITE)
++
++        # Mark the new index as CJK-enabled if relevant
++        if self.is_cjk_enabled():
++            db.set_metadata("cjk_ngram", "1")
++
+         # It seems to be faster without transactions, at the moment
+         #db.begin_transaction(False)
+ 
+
+=== modified file 'test/test_indexer.py'
+--- a/test/test_indexer.py	2011-09-01 10:17:43 +0000
++++ b/test/test_indexer.py	2011-09-01 11:46:59 +0000
+@@ -6,6 +6,7 @@
+ import shutil
+ import subprocess
+ import tools
++import xapian
+ 
+ def smallcache(pkglist=["apt", "libept-dev", "gedit"]):
+     class sc(object):
+@@ -61,6 +62,11 @@
+         # Ensure that we have an index
+         self.assertCleanIndex()
+ 
++    def testAptRebuildWithCJK(self):
++        os.environ["XAPIAN_CJK_NGRAM"] = "1"
++        self.testAptRebuild()
++        del os.environ["XAPIAN_CJK_NGRAM"]
++
+     def testDeb822Rebuild(self):
+         pkgfile = os.path.join(axi.XAPIANDBPATH, "packages")
+         subprocess.check_call("apt-cache show apt libept-dev gedit > " + pkgfile, shell=True)
+@@ -117,6 +123,55 @@
+         # Ensure that we did not create a new index
+         self.assertEqual(open(axi.XAPIANINDEX).read(), curidx)
+ 
++    def testIncrementalRebuildWithCJK(self):
++        os.environ["XAPIAN_CJK_NGRAM"] = "1"
++        self.testIncrementalRebuild()
++        del os.environ["XAPIAN_CJK_NGRAM"]
++
++    def testIncrementalRebuildUpgradingtoCJK(self):
++        # Perform the initial indexing without CJK enabled
++        self.assertFalse("XAPIAN_CJK_NGRAM" in os.environ)
++        progress = axi.indexer.SilentProgress()
++        pre_indexer = axi.indexer.Indexer(progress, True)
++        pre_indexer._test_wrap_apt_cache(smallcache(["apt", "libept-dev", "gedit"]))
++        self.assert_(pre_indexer.lock())
++        self.assert_(pre_indexer.setupIndexing())
++        pre_indexer.rebuild()
++        pre_indexer = None
++        curidx = open(axi.XAPIANINDEX).read()
++
++        # Ensure that we have an index
++        self.assertCleanIndex()
++
++        # Prepare an incremental update
++        self.indexer._test_wrap_apt_cache(smallcache(["apt", "coreutils", "gedit"]))
++
++        # No other indexers are running, ensure lock succeeds
++        self.assert_(self.indexer.lock())
++
++        # An index exists the plugin modification timestamps are the same, so
++        # we need to force the indexer to run
++        self.assert_(not self.indexer.setupIndexing())
++        self.assert_(self.indexer.setupIndexing(force=True))
++
++        # Perform a rebuild with CJK enabled
++        os.environ["XAPIAN_CJK_NGRAM"] = "1"
++        self.indexer.incrementalUpdate()
++        del os.environ["XAPIAN_CJK_NGRAM"]
++
++        # Close the indexer
++        self.indexer = None
++
++        # Ensure that we have an index
++        self.assertCleanIndex()
++
++        # Ensure that we created a new index (because we reindexed to get CJK)
++        self.assertNotEqual(open(axi.XAPIANINDEX).read(), curidx)
++        
++        # Double check that we set the CJK flag in the index
++        db = xapian.Database(axi.XAPIANINDEX)
++        self.assertEqual(db.get_metadata("cjk_ngram"), "1")
++
+     def testIncrementalRebuildFromEmpty(self):
+         # Prepare an incremental update
+         self.indexer._test_wrap_apt_cache(smallcache())
+
+=== modified file 'update-apt-xapian-index'
+--- a/update-apt-xapian-index	2011-09-01 10:17:43 +0000
++++ b/update-apt-xapian-index	2011-09-01 11:01:25 +0000
+@@ -29,10 +29,14 @@
+ # Minimal imports so we are always able to print command line help
+ from optparse import OptionParser
+ import sys
++import os
+ import warnings
+ 
+ VERSION="0.44"
+ 
++# Activate support for the CJK tokenizer
++os.environ["XAPIAN_CJK_NGRAM"] = "1"
++
+ class Parser(OptionParser):
+     def __init__(self, *args, **kwargs):
+         OptionParser.__init__(self, *args, **kwargs)
+
diff -pruN 0.44/debian/patches/series 0.44ubuntu5/debian/patches/series
--- 0.44/debian/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ 0.44ubuntu5/debian/patches/series	2011-09-21 11:27:03.000000000 +0000
@@ -0,0 +1 @@
+01_axi_cjk_support.patch
diff -pruN 0.44/debian/postinst 0.44ubuntu5/debian/postinst
--- 0.44/debian/postinst	2011-06-21 17:34:43.000000000 +0000
+++ 0.44ubuntu5/debian/postinst	2011-09-24 12:42:08.000000000 +0000
@@ -26,8 +26,6 @@ case "$1" in
                 if [ ! -x /usr/sbin/policy-rc.d ] || /usr/sbin/policy-rc.d apt-xapian-index start
                 then
                         echo "apt-xapian-index: Building new index in background..."
-                        # Ensure that we can use our module. See #537376
-                        update-python-modules -p
                         $IONICE nice /usr/sbin/update-apt-xapian-index --force --quiet &
                 fi
         fi
diff -pruN 0.44/debian/rules 0.44ubuntu5/debian/rules
--- 0.44/debian/rules	2011-03-11 11:18:38.000000000 +0000
+++ 0.44ubuntu5/debian/rules	2011-09-21 11:27:03.000000000 +0000
@@ -5,7 +5,7 @@ RELEASE_PACKAGE=apt-xapian-index
 PFX=$(CURDIR)/debian/apt-xapian-index
 
 %:
-	dh  $@
+	dh  $@ --with python2,quilt
 
 override_dh_auto_build:
 	dh_auto_build
diff -pruN 0.44/plugins/app-install.py 0.44ubuntu5/plugins/app-install.py
--- 0.44/plugins/app-install.py	2011-03-11 11:22:57.000000000 +0000
+++ 0.44ubuntu5/plugins/app-install.py	2011-09-21 11:27:03.000000000 +0000
@@ -88,8 +88,11 @@ class AppInstall(object):
         maxts = 0
         for f in os.listdir(APPINSTALLDIR):
             if f[0] == '.' or not f.endswith(".desktop"): continue
-            ts = os.path.getmtime(os.path.join(APPINSTALLDIR, f))
-            if ts > maxts: maxts = ts
+            try:
+                ts = os.path.getmtime(os.path.join(APPINSTALLDIR, f))
+                if ts > maxts: maxts = ts
+            except OSError: # ignore file not found #752195 (potential race)
+                pass
         return dict(
                 timestamp = maxts,
                 values = [

