Package: apt-xapian-index
Version: 0.21
Severity: wishlist
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu karmic ubuntu-patch


Hi,

thanks a lot for the 0.21 release, I made two small changes 
in the ubuntu package, please have a look and let me know if
you like them.

Cheers,
 Michael

*** /tmp/tmpRApC_b
In Ubuntu, we've applied the attached patch to achieve the following:

  * run the weekly update with nice and ionice (LP: #363695)
  * fix bug in --updates when its selecting the wrong index

We thought you might be interested in doing the same. 


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

Kernel: Linux 2.6.31-2-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru apt-xapian-index-0.21/debian/cron.weekly apt-xapian-index-0.21ubuntu2/debian/cron.weekly
--- apt-xapian-index-0.21/debian/cron.weekly	2008-10-18 11:55:53.000000000 +0200
+++ apt-xapian-index-0.21ubuntu2/debian/cron.weekly	2009-07-14 09:20:39.000000000 +0200
@@ -5,5 +5,5 @@
 # Rebuild the index
 if [ -x $CMD ]
 then
-	$CMD --quiet
+	nice ionice -c3	$CMD --quiet
 fi
diff -Nru apt-xapian-index-0.21/update-apt-xapian-index apt-xapian-index-0.21ubuntu2/update-apt-xapian-index
--- apt-xapian-index-0.21/update-apt-xapian-index	2009-07-07 17:30:06.000000000 +0200
+++ apt-xapian-index-0.21ubuntu2/update-apt-xapian-index	2009-07-10 14:18:28.000000000 +0200
@@ -675,9 +675,17 @@
 
 # update only mode
 if options.update:
-    res = updateIndex(XAPIANDBPATH, addons, progress)
+    index = os.path.join(os.path.abspath(XAPIANDBPATH), "index")
+    if not os.path.exists(index):
+        f=open(index, "w")
+        f.write("auto %s.1" % index)
+        f.close()
+    (dbkind, dbpath) = open(index).readline().split()
+    res = updateIndex(dbpath, addons, progress)
     if not res:
         sys.exit(1)
+    # touch the index to update the timestamp
+    open(XAPIANDBSTAMP, "w").close()
     sys.exit()
 
 # Create a new Xapian index with the content provided by the addons

Reply via email to