Merge lp:~mvo/software-center/lp1225885 into lp:software-center

Proposed by Michael Vogt
Status: Merged
Approved by: dobey
Approved revision: 3324
Merged at revision: 3328
Proposed branch: lp:~mvo/software-center/lp1225885
Merge into: lp:software-center
Diff against target: 35 lines (+9/-5)
2 files modified
README (+2/-1)
softwarecenter/db/pkginfo_impl/aptcache.py (+7/-4)
To merge this branch: bzr merge lp:~mvo/software-center/lp1225885
Reviewer Review Type Date Requested Status
dobey Approve
Review via email: mp+215116@code.launchpad.net

Description of the change

A tiny branch to avoid crashing if a aptdaemon transaction contains no package data (LP: #1225885).

This is crash #3 on errors.ubuntu.com today.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Fwiw, I'm happy to handle the upload once this lands.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Setting MP as Rejected to reduce numbers of landing candidates in @reviewlist. Change status again if this MP is still current.

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2012-05-22 12:13:02 +0000
3+++ README 2014-04-10 09:30:36 +0000
4@@ -21,7 +21,8 @@
5 You can run a developer instance with:
6
7 python setup.py build
8-./software-center
9+PYTHONPATH=./build/lib.linux-x86_64-2.7 ./bin/software-center
10+(the PYTHONPATH needs to be adjusted depending on the architecture)
11
12 The initial launch of this will take a bit as it will build a private
13 search database but this is only needed once.
14
15=== modified file 'softwarecenter/db/pkginfo_impl/aptcache.py'
16--- softwarecenter/db/pkginfo_impl/aptcache.py 2012-12-18 10:23:55 +0000
17+++ softwarecenter/db/pkginfo_impl/aptcache.py 2014-04-10 09:30:36 +0000
18@@ -588,10 +588,13 @@
19
20 # space calculation stuff
21 def _on_total_size_calculation_done(self, trans, space):
22- pkgname = trans.packages[0][0]
23- self.emit(
24- "query-total-size-on-install-done",
25- pkgname, trans.download, trans.space)
26+ # ensure trans contains the data we expect, see LP: #1225885
27+ if trans.packages and trans.packages[0]:
28+ pkgname = trans.packages[0][0]
29+ self.emit(
30+ "query-total-size-on-install-done",
31+ pkgname, trans.download, trans.space)
32+
33
34 def _on_trans_simulate_error(self, error):
35 LOG.exception("simulate failed")

Subscribers

People subscribed via source and target branches