Merge lp:~townsend/libertine/1.4.2-release into lp:libertine/trunk

Proposed by Christopher Townsend
Status: Merged
Approved by: Larry Price
Approved revision: 165
Merged at revision: 165
Proposed branch: lp:~townsend/libertine/1.4.2-release
Merge into: lp:libertine/trunk
Diff against target: 375 lines (+68/-40)
11 files modified
debian/changelog (+16/-0)
libertine/ContainerManager.cpp (+2/-2)
libertine/libertine.cpp (+1/-1)
libertine/libertine.h (+1/-1)
libertine/qml/ExtraArchivesView.qml (+1/-7)
python/libertine/ChrootContainer.py (+4/-4)
python/libertine/Libertine.py (+22/-13)
python/libertine/LxcContainer.py (+1/-1)
tools/completions/libertine-container-manager (+2/-2)
tools/libertine-container-manager (+8/-9)
tools/libertine-container-manager.1 (+10/-0)
To merge this branch: bzr merge lp:~townsend/libertine/1.4.2-release
Reviewer Review Type Date Requested Status
Larry Price Approve
Review via email: mp+307477@code.launchpad.net

Commit message

* Add a new update_apt_cache method and call that when needed, especially when installing new packages. (LP: #1625627)
* Install matchbox-window-manager instead of the matchbox metapackage in a container. (LP: #1628563)
* Remove bad status update preventing archive removal from container.
* Make debconf interactions work correctly from GUI. (LP: #1627757)
* Fix crash on start in Unity 7 when launching from the dash. (LP: #1620016)

To post a comment you must log in.
Revision history for this message
Larry Price (larryprice) wrote :

lgtm

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 2016-09-14 14:46:03 +0000
3+++ debian/changelog 2016-10-03 19:45:57 +0000
4@@ -1,3 +1,19 @@
5+libertine (1.4.2-0ubuntu1) UNRELEASED; urgency=medium
6+
7+ [ Chris Townsend ]
8+ * Add a new update_apt_cache method and call that when needed, especially
9+ when installing new packages. (LP: #1625627)
10+ * Install matchbox-window-manager instead of the matchbox metapackage in
11+ a container. (LP: #1628563)
12+
13+ [ Larry Price ]
14+ * Remove bad status update preventing archive removal from container.
15+ * Make debconf interactions work correctly from GUI. (LP: #1627757)
16+ * Fix crash on start in Unity 7 when launching from the dash.
17+ (LP: #1620016)
18+
19+ -- Chris Townsend <christopher.townsend@canonical.com> Mon, 03 Oct 2016 15:30:24 -0400
20+
21 libertine (1.4.1+16.10.20160914-0ubuntu1) yakkety; urgency=medium
22
23 [ Brandon Schaefer ]
24
25=== modified file 'libertine/ContainerManager.cpp'
26--- libertine/ContainerManager.cpp 2016-07-12 15:52:21 +0000
27+++ libertine/ContainerManager.cpp 2016-10-03 19:45:57 +0000
28@@ -159,7 +159,7 @@
29 emit operationFinished(container_id, package_name);
30 });
31
32- process_.start(libertine_container_manager_tool, QStringList{"install-package", "-i", container_id, "-p", package_name, "-r"});
33+ process_.start(libertine_container_manager_tool, QStringList{"install-package", "-i", container_id, "-p", package_name, "--no-dialog"});
34 }
35
36
37@@ -183,7 +183,7 @@
38 emit operationFinished(container_id, package_name);
39 });
40
41- process_.start(libertine_container_manager_tool, QStringList{"remove-package", "-i", container_id, "-p", package_name, "-r"});
42+ process_.start(libertine_container_manager_tool, QStringList{"remove-package", "-i", container_id, "-p", package_name, "--no-dialog"});
43 }
44
45
46
47=== modified file 'libertine/libertine.cpp'
48--- libertine/libertine.cpp 2016-07-15 18:39:58 +0000
49+++ libertine/libertine.cpp 2016-10-03 19:45:57 +0000
50@@ -84,7 +84,7 @@
51 * environment variables, and configurations files and displays the GUI.
52 */
53 Libertine::
54-Libertine(int argc, char* argv[])
55+Libertine(int& argc, char** argv)
56 : QGuiApplication(argc, argv)
57 , main_qml_source_file_(find_main_qml_source_file())
58 {
59
60=== modified file 'libertine/libertine.h'
61--- libertine/libertine.h 2016-07-15 18:39:58 +0000
62+++ libertine/libertine.h 2016-10-03 19:45:57 +0000
63@@ -38,7 +38,7 @@
64 Q_OBJECT
65
66 public:
67- Libertine(int argc, char* argv[]);
68+ Libertine(int& argc, char** argv);
69 ~Libertine();
70
71 private:
72
73=== modified file 'libertine/qml/ExtraArchivesView.qml'
74--- libertine/qml/ExtraArchivesView.qml 2016-07-13 19:48:48 +0000
75+++ libertine/qml/ExtraArchivesView.qml 2016-10-03 19:45:57 +0000
76@@ -96,18 +96,16 @@
77 function deleteArchive(archive) {
78 var worker = Qt.createComponent("ContainerManager.qml").createObject(mainView)
79 worker.finishedConfigure.connect(finishedConfigure)
80- worker.error.connect(sendDeleteError)
81+ worker.error.connect(mainView.error)
82 worker.configureContainer(currentContainer, containerConfigList.getContainerName(currentContainer), ["--archive", "remove", "--archive-name", "\"" + archive + "\""])
83 }
84
85 Component.onCompleted: {
86 containerConfigList.configChanged.connect(reloadArchives)
87- error.connect(mainView.error)
88 }
89
90 Component.onDestruction: {
91 containerConfigList.configChanged.disconnect(reloadArchives)
92- error.disconnect(mainView.error)
93 }
94
95 function reloadArchives() {
96@@ -121,8 +119,4 @@
97 containerArchivesList.setContainerArchives(currentContainer)
98 }
99 }
100-
101- function sendDeleteError(desc, details) {
102- error(i18n.tr("Deleting archive failed"), details)
103- }
104 }
105
106=== modified file 'python/libertine/ChrootContainer.py'
107--- python/libertine/ChrootContainer.py 2016-09-06 12:36:47 +0000
108+++ python/libertine/ChrootContainer.py 2016-10-03 19:45:57 +0000
109@@ -122,7 +122,7 @@
110 self.update_packages(verbosity)
111
112 for package in self.default_packages:
113- if not self.install_package(package, verbosity):
114+ if not self.install_package(package, verbosity, update_cache=False):
115 print("Failure installing %s during container creation" % package)
116 self.destroy_libertine_container()
117 return False
118@@ -130,7 +130,7 @@
119 if self.installed_release == "vivid":
120 if verbosity == 1:
121 print("Installing the Vivid Stable Overlay PPA...")
122- if not self.install_package("software-properties-common", verbosity):
123+ if not self.install_package("software-properties-common", verbosity, update_cache=False):
124 print("Failure installing software-properties-common during container creation")
125 self.destroy_libertine_container()
126 return False
127@@ -148,8 +148,8 @@
128 self._run_ldconfig(verbosity)
129 return retcode
130
131- def install_package(self, package_name, verbosity=1, readline=False):
132- returncode = super().install_package(package_name, verbosity, readline)
133+ def install_package(self, package_name, verbosity=1, no_dialog=False, update_cache=True):
134+ returncode = super().install_package(package_name, verbosity, no_dialog, update_cache)
135
136 if returncode:
137 self._run_ldconfig(verbosity)
138
139=== modified file 'python/libertine/Libertine.py'
140--- python/libertine/Libertine.py 2016-09-06 12:36:47 +0000
141+++ python/libertine/Libertine.py 2016-10-03 19:45:57 +0000
142@@ -67,7 +67,7 @@
143 self.container_type = 'unknown'
144 self.container_id = container_id
145 self.root_path = libertine.utils.get_libertine_container_rootfs_path(self.container_id)
146- self.default_packages = ['matchbox',
147+ self.default_packages = ['matchbox-window-manager',
148 'libnss-extrausers',
149 'humanity-icon-theme',
150 'maliit-inputcontext-gtk2',
151@@ -133,16 +133,24 @@
152 """
153 pass
154
155+ def update_apt_cache(self, verbosity=1):
156+ """
157+ Updates the apt cache in the container.
158+
159+ :param verbosity: the chattiness of the output on a range from 0 to 2
160+ """
161+ return self.run_in_container(apt_command_prefix(verbosity) + 'update')
162+
163 def update_packages(self, verbosity=1):
164 """
165 Updates all packages installed in the container.
166
167 :param verbosity: the chattiness of the output on a range from 0 to 2
168 """
169- self.run_in_container(apt_command_prefix(verbosity) + '--force-yes update')
170+ self.update_apt_cache(verbosity)
171 return self.run_in_container(apt_command_prefix(verbosity) + '--force-yes dist-upgrade')
172
173- def install_package(self, package_name, verbosity=1, readline=False):
174+ def install_package(self, package_name, verbosity=1, no_dialog=False, update_cache=True):
175 """
176 Installs a named package in the container.
177
178@@ -150,6 +158,9 @@
179 a full path to a Debian package on the host.
180 :param verbosity: the chattiness of the output on a range from 0 to 2
181 """
182+ if update_cache:
183+ self.update_apt_cache(verbosity)
184+
185 if package_name.endswith('.deb'):
186 delete_package = self.copy_package_to_container(package_name)
187
188@@ -164,8 +175,8 @@
189
190 return ret
191 else:
192- if readline:
193- os.environ['DEBIAN_FRONTEND'] = 'readline'
194+ if no_dialog:
195+ os.environ['DEBIAN_FRONTEND'] = 'teletype'
196 return self.run_in_container(apt_command_prefix(verbosity) + " install '" + package_name + "'") == 0
197
198 def configure_multiarch(self, should_enable, verbosity=1):
199@@ -178,7 +189,7 @@
200 if should_enable:
201 ret = self.run_in_container("dpkg --add-architecture i386")
202 if ret or ret == 0:
203- self.run_in_container(apt_command_prefix(verbosity) + '--force-yes update')
204+ self.update_apt_cache(verbosity)
205 return ret
206 else:
207 self.run_in_container(apt_command_prefix(verbosity) + "purge \".*:i386\"")
208@@ -193,10 +204,8 @@
209 :param verbosity: the chattiness of the output on a range from 0 to 2
210 """
211 if not os.path.exists(os.path.join(self.root_path, 'usr', 'bin', 'add-apt-repository')):
212- self.update_packages(verbosity)
213 self.install_package("software-properties-common", verbosity)
214 if 'https://' in archive and not os.path.exists(os.path.join(self.root_path, 'usr', 'lib', 'apt', 'methods', 'https')):
215- self.update_packages(verbosity)
216 self.install_package("apt-transport-https", verbosity)
217
218 retcode = self.run_in_container("add-apt-repository -y " + archive)
219@@ -332,17 +341,17 @@
220 except RuntimeError as e:
221 return handle_runtime_error(e)
222
223- def install_package(self, package_name, verbosity=1, readline=False):
224+ def install_package(self, package_name, verbosity=1, no_dialog=False, update_cache=True):
225 """
226 Installs a package in the container.
227 """
228 try:
229 with ContainerRunning(self.container):
230- return self.container.install_package(package_name, verbosity, readline)
231+ return self.container.install_package(package_name, verbosity, no_dialog, update_cache)
232 except RuntimeError as e:
233 return handle_runtime_error(e)
234
235- def remove_package(self, package_name, verbosity=1, readline=False):
236+ def remove_package(self, package_name, verbosity=1, no_dialog=False):
237 """
238 Removes a package from the container.
239
240@@ -351,8 +360,8 @@
241 """
242 try:
243 with ContainerRunning(self.container):
244- if readline:
245- os.environ['DEBIAN_FRONTEND'] = 'readline'
246+ if no_dialog:
247+ os.environ['DEBIAN_FRONTEND'] = 'teletype'
248
249 if self.container.run_in_container(apt_command_prefix(verbosity) + " purge '" + package_name + "'") != 0:
250 return False
251
252=== modified file 'python/libertine/LxcContainer.py'
253--- python/libertine/LxcContainer.py 2016-09-07 19:08:12 +0000
254+++ python/libertine/LxcContainer.py 2016-10-03 19:45:57 +0000
255@@ -240,7 +240,7 @@
256 self.update_packages(verbosity)
257
258 for package in self.default_packages:
259- if not self.install_package(package, verbosity):
260+ if not self.install_package(package, verbosity, update_cache=False):
261 print("Failure installing %s during container creation" % package)
262 self.destroy_libertine_container()
263 return False
264
265=== modified file 'tools/completions/libertine-container-manager'
266--- tools/completions/libertine-container-manager 2016-07-22 15:05:22 +0000
267+++ tools/completions/libertine-container-manager 2016-10-03 19:45:57 +0000
268@@ -24,10 +24,10 @@
269 if [[ ${cur} == -* ]]; then
270 case "${cmd}" in
271 "install-package" )
272- opts="--help --id --package --readline"
273+ opts="--help --id --package --no-dialog"
274 ;;
275 "remove-package" )
276- opts="--help --id --package --readline"
277+ opts="--help --id --package --no-dialog"
278 ;;
279 "create" )
280 opts="--help --id --type --distro --name --force --multiarch --password"
281
282=== modified file 'tools/libertine-container-manager'
283--- tools/libertine-container-manager 2016-09-06 12:36:47 +0000
284+++ tools/libertine-container-manager 2016-10-03 19:45:57 +0000
285@@ -136,7 +136,7 @@
286 container = LibertineContainer(container_id)
287
288 self.containers_config.update_package_install_status(container_id, package, "installing")
289- if not container.install_package(args.package, args.verbosity, args.readline):
290+ if not container.install_package(args.package, args.verbosity, args.no_dialog):
291 self.containers_config.delete_package(container_id, package)
292 sys.exit(1)
293
294@@ -144,12 +144,12 @@
295
296 libertine.utils.refresh_libertine_scope()
297
298- def remove_package_by_name(self, container_id, package_name, verbosity=1, readline=False):
299+ def remove_package_by_name(self, container_id, package_name, verbosity=1, no_dialog=False):
300 fallback_status = self.containers_config.get_package_install_status(container_id, package_name)
301 self.containers_config.update_package_install_status(container_id, package_name, "removing")
302
303 container = LibertineContainer(container_id)
304- if not container.remove_package(package_name, verbosity, readline) and fallback_status == 'installed':
305+ if not container.remove_package(package_name, verbosity, no_dialog) and fallback_status == 'installed':
306 self.containers_config.update_package_install_status(container_id, package_name, fallback_status)
307 return False
308
309@@ -165,7 +165,7 @@
310 print("Package \'%s\' is not installed." % args.package)
311 sys.exit(1)
312
313- if not self.remove_package_by_name(container_id, args.package, args.verbosity, args.readline):
314+ if not self.remove_package_by_name(container_id, args.package, args.verbosity, args.no_dialog):
315 sys.exit(1)
316
317 libertine.utils.refresh_libertine_scope()
318@@ -209,7 +209,6 @@
319 sys.exit(1)
320
321 def delete_archive_by_name(self, container_id, archive_name, verbosity=1):
322- self.containers_config.update_archive_install_status(container_id, archive_name, 'removing')
323 if self.containers_config.get_archive_install_status(container_id, archive_name) == 'installed':
324 self.containers_config.update_archive_install_status(container_id, archive_name, 'removing')
325 if LibertineContainer(container_id).configure_remove_archive("\"" + archive_name + "\"", verbosity) is not 0:
326@@ -371,8 +370,8 @@
327 '-i', '--id',
328 help=("Container identifier. Default container is used if omitted."))
329 parser_install.add_argument(
330- '-r', '--readline', action='store_true',
331- help=("Readline mode. Use text-based frontend during debconf interactions."))
332+ '-n', '--no-dialog', action='store_true',
333+ help=("No dialog mode. Use text-based frontend during debconf interactions."))
334 parser_install.set_defaults(func=container_manager.install_package)
335
336 # Handle the remove-package command and its options
337@@ -387,8 +386,8 @@
338 '-i', '--id',
339 help=("Container identifier. Default container is used if omitted."))
340 parser_remove.add_argument(
341- '-r', '--readline', action='store_true',
342- help=("Readline mode. Use text-based frontend during debconf interactions."))
343+ '-n', '--no-dialog', action='store_true',
344+ help=("No dialog mode. Use text-based frontend during debconf interactions."))
345 parser_remove.set_defaults(func=container_manager.remove_package)
346
347 # Handle the search-cache command and its options
348
349=== modified file 'tools/libertine-container-manager.1'
350--- tools/libertine-container-manager.1 2016-09-06 12:36:47 +0000
351+++ tools/libertine-container-manager.1 2016-10-03 19:45:57 +0000
352@@ -146,6 +146,11 @@
353 .RS 14
354 Name of package to install. Required.
355 .RE
356+.IP
357+.BR \-n ", " \-\-no-dialog ""
358+.RS 14
359+No dialog mode. Use text-based frontend during debconf interactions.
360+.RE
361 .TP
362
363 .B libertine-container-manager remove-package [options]
364@@ -165,6 +170,11 @@
365 .RS 14
366 Name of package to remove. Required.
367 .RE
368+.IP
369+.BR \-n ", " \-\-no-dialog ""
370+.RS 14
371+No dialog mode. Use text-based frontend during debconf interactions.
372+.RE
373 .TP
374
375 .B libertine-container-manager search-cache [options]

Subscribers

People subscribed via source and target branches