Merge lp:~cjwatson/software-center/apt-xapian-index-crash into lp:software-center

Proposed by Colin Watson
Status: Merged
Merged at revision: 1165
Proposed branch: lp:~cjwatson/software-center/apt-xapian-index-crash
Merge into: lp:software-center
Diff against target: 40 lines (+8/-0)
3 files modified
apt-xapian-index-plugin/origin.py (+2/-0)
apt-xapian-index-plugin/software-center.py (+2/-0)
debian/changelog (+4/-0)
To merge this branch: bzr merge lp:~cjwatson/software-center/apt-xapian-index-crash
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+35234@code.launchpad.net

Description of the change

This should fix the remaining part of bug 267330, which is getting a huge number of reports. It would be good to have this uploaded fairly soon if possible. Thanks!

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Thanks Colin!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apt-xapian-index-plugin/origin.py'
2--- apt-xapian-index-plugin/origin.py 2010-07-28 15:56:30 +0000
3+++ apt-xapian-index-plugin/origin.py 2010-09-12 21:19:40 +0000
4@@ -24,6 +24,8 @@
5 long initialisation can just be skipped.
6 """
7 file = apt.apt_pkg.config.find_file("Dir::Cache::pkgcache")
8+ if not os.path.exists(file):
9+ return dict(timestamp = 0)
10 return dict(timestamp = os.path.getmtime(file))
11
12 def init(self, info, progress):
13
14=== modified file 'apt-xapian-index-plugin/software-center.py'
15--- apt-xapian-index-plugin/software-center.py 2010-09-10 09:17:07 +0000
16+++ apt-xapian-index-plugin/software-center.py 2010-09-12 21:19:40 +0000
17@@ -29,6 +29,8 @@
18 long initialisation can just be skipped.
19 """
20 file = apt.apt_pkg.config.find_file("Dir::Cache::pkgcache")
21+ if not os.path.exists(file):
22+ return dict(timestamp = 0)
23 return dict(timestamp = os.path.getmtime(file))
24
25 def init(self, info, progress):
26
27=== modified file 'debian/changelog'
28--- debian/changelog 2010-09-12 21:07:42 +0000
29+++ debian/changelog 2010-09-12 21:19:40 +0000
30@@ -23,6 +23,10 @@
31 - fix incorrect Category value in the xml for the Debugging
32 subcategory of Developer Tools (LP: #538911)
33
34+ [ Colin Watson ]
35+ * Fix update-apt-xapian-index crashes when the Dir::Cache::pkgcache file
36+ doesn't exist (LP: #267330).
37+
38 -- Gary Lasker <gary.lasker@canonical.com> Sun, 12 Sep 2010 17:03:44 -0400
39
40 software-center (2.1.18.1) maverick; urgency=low