Merge lp:~mvo/software-center/fix-crash-deb-file-size-calc into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 2978
Proposed branch: lp:~mvo/software-center/fix-crash-deb-file-size-calc
Merge into: lp:software-center
Diff against target: 14 lines (+4/-0)
1 file modified
softwarecenter/db/pkginfo_impl/aptcache.py (+4/-0)
To merge this branch: bzr merge lp:~mvo/software-center/fix-crash-deb-file-size-calc
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+102076@code.launchpad.net

Description of the change

This is a small branch that fixes a crash when a manually downloaded deb file is opened that is
not in the current apt cache. Its a result of trying to reproduce bug #982315 (which failed).

To test:
- download a deb like google-chrome-stable_current_amd64.deb that is not yet in the apt cache
- open it with software-center

In trunk the "Total size" never gets updated (and there is a exception on the terminal). With
this branch that is fixed.

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

Clean as a whistle. Thanks, mvo!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/db/pkginfo_impl/aptcache.py'
2--- softwarecenter/db/pkginfo_impl/aptcache.py 2012-03-26 13:31:07 +0000
3+++ softwarecenter/db/pkginfo_impl/aptcache.py 2012-04-16 09:30:27 +0000
4@@ -596,6 +596,10 @@
5 self._set_candidate_release(pkg, archive_suite)
6 # now get the right version
7 version = self._cache[p].candidate
8+ # this can happen on e.g. deb packages that are not in the cache
9+ # testcase: software-center google-chrome-stable_current_amd64.deb
10+ if not version:
11+ continue
12 pkgs_to_install.append(version)
13 # now do it
14 deps_inst = self._try_install_and_get_all_deps_installed(

Subscribers

People subscribed via source and target branches