Package: apt-xapian-index
Version: 0.41
Severity: minor
Tags: patch
User: [email protected]
Usertags: origin-ubuntu natty ubuntu-patch



In Ubuntu, the attached patch was applied to achieve the following:

  * update-apt-xapian-index:
    - do not crash if the DB is already locked (LP: #590998)

Instead of a crash, just show a message.

Thanks for considering the patch.

Cheers,
 Michael

-- System Information:
Debian Release: squeeze/sid
  APT prefers natty-updates
  APT policy: (500, 'natty-updates'), (500, 'natty-security'), (500, 'natty')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37-11-generic (SMP w/4 CPU cores)
Locale: LANG=en_DK.utf8, LC_CTYPE=en_DK.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru apt-xapian-index-0.41ubuntu4/axi/indexer.py apt-xapian-index-0.41ubuntu5/axi/indexer.py
--- apt-xapian-index-0.41ubuntu4/axi/indexer.py	2010-11-06 18:21:49.000000000 +0100
+++ apt-xapian-index-0.41ubuntu5/axi/indexer.py	2011-01-28 14:36:53.000000000 +0100
@@ -598,7 +598,11 @@
         """
         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 -Nru apt-xapian-index-0.41ubuntu4/debian/changelog apt-xapian-index-0.41ubuntu5/debian/changelog

Reply via email to