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

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3228
Proposed branch: lp:~mvo/software-center/lp1063595
Merge into: lp:software-center
Diff against target: 92 lines (+11/-1)
1 file modified
softwarecenter/backend/installbackend_impl/aptd.py (+11/-1)
To merge this branch: bzr merge lp:~mvo/software-center/lp1063595
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+128435@code.launchpad.net

Description of the change

Add a bunch of missing trans vars to ensure that _on_trans_error() is
always called with valid parameters and not crashing with unbound local
errors.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/backend/installbackend_impl/aptd.py'
2--- softwarecenter/backend/installbackend_impl/aptd.py 2012-10-05 08:39:29 +0000
3+++ softwarecenter/backend/installbackend_impl/aptd.py 2012-10-08 08:11:21 +0000
4@@ -260,6 +260,7 @@
5
6 @inline_callbacks
7 def fix_broken_depends(self):
8+ trans = None
9 try:
10 trans = yield self.aptd_client.fix_broken_depends(defer=True)
11 self.emit("transaction-started", "", "", trans.tid,
12@@ -270,6 +271,7 @@
13
14 @inline_callbacks
15 def fix_incomplete_install(self):
16+ trans = None
17 try:
18 trans = yield self.aptd_client.fix_incomplete_install(defer=True)
19 self.emit("transaction-started", "", "", trans.tid,
20@@ -285,6 +287,7 @@
21 """ upgrade a single package """
22 pkgname = app.pkgname
23 appname = app.appname
24+ trans = None
25 try:
26 trans = yield self.aptd_client.upgrade_packages([pkgname],
27 defer=True)
28@@ -327,6 +330,7 @@
29 """ remove a single package """
30 pkgname = app.pkgname
31 appname = app.appname
32+ trans = None
33 try:
34 trans = yield self.aptd_client.remove_packages([pkgname],
35 defer=True)
36@@ -399,6 +403,7 @@
37 """ install and remove add-ons """
38 pkgname = app.pkgname
39 appname = app.appname
40+ trans = None
41 try:
42 install = addons_install
43 remove = addons_remove
44@@ -421,6 +426,7 @@
45 # aptsources will just enable it instead of adding a extra
46 # sources.list.d file (LP: #666956)
47 d = apt_pkg.config.find_dir("Dir::Etc::sourceparts")
48+ trans = None
49 if (not sources_list or
50 not os.path.exists(os.path.join(d, sources_list))):
51 sources_list = ""
52@@ -436,6 +442,7 @@
53 @inline_callbacks
54 def enable_component(self, component):
55 self._logger.debug("enable_component: %s" % component)
56+ trans = None
57 try:
58 trans = yield self.aptd_client.enable_distro_component(component)
59 # don't use self._run_transaction() here, to avoid sending uneeded
60@@ -449,6 +456,7 @@
61
62 @inline_callbacks
63 def enable_channel(self, channelfile):
64+ trans = None
65 # read channel file and add all relevant lines
66 for line in open(channelfile):
67 line = line.strip()
68@@ -476,6 +484,7 @@
69 keyid = keyid.split("/")[1]
70 if not keyid.startswith("0x"):
71 keyid = "0x%s" % keyid
72+ trans = None
73 try:
74 trans = yield self.aptd_client.add_vendor_key_from_keyserver(
75 keyid, keyserver, defer=True)
76@@ -497,6 +506,7 @@
77
78 args = (entry.type, entry.uri, entry.dist, entry.comps,
79 "Added by software-center", sourcepart)
80+ trans = None
81 try:
82 trans = yield self.aptd_client.add_repository(*args, defer=True)
83 yield self._run_transaction(trans, None, None, None)
84@@ -523,7 +533,7 @@
85 self._logger.debug(
86 "adding license_key for pkg '%s' of len: %i" % (
87 pkgname, len(license_key)))
88-
89+ trans = None
90 # HOME based license keys
91 if license_key_path and license_key_path.startswith("~"):
92 # check if its inside HOME and if so, just create it

Subscribers

People subscribed via source and target branches