Merge lp:~brian-murray/ubiquity/precise-bug-1051935 into lp:~ubuntu-installer/ubiquity/precise-proposed

Proposed by Brian Murray
Status: Merged
Merged at revision: 5444
Proposed branch: lp:~brian-murray/ubiquity/precise-bug-1051935
Merge into: lp:~ubuntu-installer/ubiquity/precise-proposed
Diff against target: 158 lines (+67/-61)
2 files modified
debian/changelog (+5/-0)
ubiquity/install_misc.py (+62/-61)
To merge this branch: bzr merge lp:~brian-murray/ubiquity/precise-bug-1051935
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Review via email: mp+202577@code.launchpad.net

Description of the change

I've recently seen some Precise install failures due to bug 1051935 and I thought we might fix it for 12.04.4.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-12-08 00:32:32 +0000
3+++ debian/changelog 2014-01-21 23:48:02 +0000
4@@ -1,9 +1,14 @@
5 ubiquity (2.10.29) UNRELEASED; urgency=low
6
7+ [ Dmitrijs Ledkovs ]
8 * Show labels in automatic side-by-side installation. Fixed by removing
9 all cairo styling from partition boxes in automatic partitioning,
10 instead use simple bg styling. (LP: #947107, #1240532)
11
12+ [ Brian Murray ]
13+ * Use the apt cache with with so that we close the cache when we are done
14+ with it. (LP: #1051935)
15+
16 -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> Wed, 16 Oct 2013 09:58:29 +0100
17
18 ubiquity (2.10.28) precise; urgency=low
19
20=== modified file 'ubiquity/install_misc.py'
21--- ubiquity/install_misc.py 2012-05-16 22:22:30 +0000
22+++ ubiquity/install_misc.py 2014-01-21 23:48:02 +0000
23@@ -852,73 +852,74 @@
24 self.db, 'ubiquity/install/title',
25 'ubiquity/install/apt_indices_starting',
26 'ubiquity/install/apt_indices')
27- cache = Cache()
28-
29- if cache._depcache.broken_count > 0:
30- syslog.syslog(
31- 'not installing additional packages, since there are broken '
32- 'packages: %s' % ', '.join(broken_packages(cache)))
33- self.db.progress('STOP')
34- self.nested_progress_end()
35- return
36-
37- for pkg in to_install:
38- mark_install(cache, pkg)
39-
40- self.db.progress('SET', 1)
41- self.progress_region(1, 10)
42- if langpacks:
43- fetchprogress = DebconfAcquireProgress(
44- self.db, 'ubiquity/langpacks/title', None,
45- 'ubiquity/langpacks/packages')
46- installprogress = DebconfInstallProgress(
47- self.db, 'ubiquity/langpacks/title',
48- 'ubiquity/install/apt_info')
49- else:
50- fetchprogress = DebconfAcquireProgress(
51- self.db, 'ubiquity/install/title', None,
52- 'ubiquity/install/fetch_remove')
53- installprogress = DebconfInstallProgress(
54- self.db, 'ubiquity/install/title',
55- 'ubiquity/install/apt_info',
56- 'ubiquity/install/apt_error_install')
57- chroot_setup(self.target)
58- commit_error = None
59- try:
60+
61+ with Cache() as cache:
62+
63+ if cache._depcache.broken_count > 0:
64+ syslog.syslog(
65+ 'not installing additional packages, since there are broken '
66+ 'packages: %s' % ', '.join(broken_packages(cache)))
67+ self.db.progress('STOP')
68+ self.nested_progress_end()
69+ return
70+
71+ for pkg in to_install:
72+ mark_install(cache, pkg)
73+
74+ self.db.progress('SET', 1)
75+ self.progress_region(1, 10)
76+ if langpacks:
77+ fetchprogress = DebconfAcquireProgress(
78+ self.db, 'ubiquity/langpacks/title', None,
79+ 'ubiquity/langpacks/packages')
80+ installprogress = DebconfInstallProgress(
81+ self.db, 'ubiquity/langpacks/title',
82+ 'ubiquity/install/apt_info')
83+ else:
84+ fetchprogress = DebconfAcquireProgress(
85+ self.db, 'ubiquity/install/title', None,
86+ 'ubiquity/install/fetch_remove')
87+ installprogress = DebconfInstallProgress(
88+ self.db, 'ubiquity/install/title',
89+ 'ubiquity/install/apt_info',
90+ 'ubiquity/install/apt_error_install')
91+ chroot_setup(self.target)
92+ commit_error = None
93 try:
94- if not self.commit_with_verify(cache,
95- fetchprogress, installprogress):
96+ try:
97+ if not self.commit_with_verify(cache,
98+ fetchprogress, installprogress):
99+ fetchprogress.stop()
100+ installprogress.finishUpdate()
101+ self.db.progress('STOP')
102+ self.nested_progress_end()
103+ return
104+ except IOError:
105+ for line in traceback.format_exc().split('\n'):
106+ syslog.syslog(syslog.LOG_ERR, line)
107 fetchprogress.stop()
108 installprogress.finishUpdate()
109 self.db.progress('STOP')
110 self.nested_progress_end()
111 return
112- except IOError:
113- for line in traceback.format_exc().split('\n'):
114- syslog.syslog(syslog.LOG_ERR, line)
115- fetchprogress.stop()
116- installprogress.finishUpdate()
117- self.db.progress('STOP')
118- self.nested_progress_end()
119- return
120- except SystemError, e:
121- for line in traceback.format_exc().split('\n'):
122- syslog.syslog(syslog.LOG_ERR, line)
123- commit_error = str(e)
124- finally:
125- chroot_cleanup(self.target)
126- self.db.progress('SET', 10)
127-
128- cache.open(None)
129- if commit_error or cache._depcache.broken_count > 0:
130- if commit_error is None:
131- commit_error = ''
132- brokenpkgs = broken_packages(cache)
133- self.warn_broken_packages(brokenpkgs, commit_error)
134-
135- self.db.progress('STOP')
136-
137- self.nested_progress_end()
138+ except SystemError, e:
139+ for line in traceback.format_exc().split('\n'):
140+ syslog.syslog(syslog.LOG_ERR, line)
141+ commit_error = str(e)
142+ finally:
143+ chroot_cleanup(self.target)
144+ self.db.progress('SET', 10)
145+
146+ cache.open(None)
147+ if commit_error or cache._depcache.broken_count > 0:
148+ if commit_error is None:
149+ commit_error = ''
150+ brokenpkgs = broken_packages(cache)
151+ self.warn_broken_packages(brokenpkgs, commit_error)
152+
153+ self.db.progress('STOP')
154+
155+ self.nested_progress_end()
156
157 def select_language_packs(self, save=False):
158 try:

Subscribers

People subscribed via source and target branches