Merge lp:~townsend/libertine/1.0.1 into lp:libertine/trunk

Proposed by Christopher Townsend
Status: Merged
Approved by: Stephen M. Webb
Approved revision: 124
Merged at revision: 124
Proposed branch: lp:~townsend/libertine/1.0.1
Merge into: lp:libertine/trunk
Diff against target: 1885 lines (+656/-378)
22 files modified
data/puritine-click.conf (+9/-4)
debian/changelog (+26/-0)
libertine/ContainerConfig.cpp (+2/-1)
libertine/ContainerConfig.h (+2/-2)
libertine/ContainerManager.cpp (+3/-3)
libertine/ContainerManager.h (+3/-3)
libertine/main.cpp (+8/-0)
libertine/qml/ContainerApps.qml (+0/-27)
libertine/qml/ContainerInfoView.qml (+1/-1)
libertine/qml/ContainersView.qml (+15/-9)
libertine/qml/ExtraArchivesView.qml (+26/-9)
libertine/qml/HomeView.qml (+32/-21)
libertine/qml/ManageContainer.qml (+53/-4)
libertine/qml/PackageInfoView.qml (+0/-34)
libertine/qml/PackageOperationFailureDialog.qml (+36/-0)
libertine/qml/SearchResultsView.qml (+2/-0)
libertine/qml/libertine.qml (+19/-1)
po/en_US.po (+89/-53)
po/libertine.pot (+200/-175)
python/libertine/ChrootContainer.py (+4/-4)
python/libertine/Libertine.py (+41/-15)
tools/libertine-container-manager (+85/-12)
To merge this branch: bzr merge lp:~townsend/libertine/1.0.1
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Review via email: mp+292840@code.launchpad.net

Commit message

* Allow an explicitly set distro during the create operation if it matches the host's distro even if the distro is technically end-of-life. (LP: #1569397)
* More Libertine GUI improvements.
* Check to make sure a subcommand was given and if not, print out the usage. (LP: #1539104)
* Check to see if CLI and GUI is ran using sudo and if so, print a message and exit. (LP: #1570548)
* Catch runtime errors raised when starting a container so a crash file is not generated and to tell the GUI that there was an error so the user can be presented a proper notification. (LP: #1539105)
* Use shutil.which() instead of hardcoded path for detecting if proot is on the system. Fixes alternate $PATH locations such as in a snap. (LP: #1572591)
* Add a 'merge-configs' command to l-c-m which allows merging a specified ContainersConfig.json file with the existing config file. (LP: #1566391)
* Have the Puritine click linking occur before Unity 8 is started to avoid having a 0-byte ContainersConfig.json file from being created. (LP: #1573266)
* Fixing infinite package removal on error caused by bad apt command and variable access. (LP: #1573201)

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

OK, I se nothing nefarious here.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/puritine-click.conf'
2--- data/puritine-click.conf 2016-03-02 13:23:42 +0000
3+++ data/puritine-click.conf 2016-04-25 17:15:41 +0000
4@@ -1,6 +1,6 @@
5 description "Puritine Click chroot linking"
6
7-start on started unity8
8+start on starting unity8
9
10 script
11 PACKAGE_PATH=`click pkgdir com.ubuntu.puritine`
12@@ -14,10 +14,15 @@
13 ln -s $CHROOT_PATH/rootfs $HOME/.cache/libertine-container/$CONTAINER_NAME/rootfs
14 fi
15
16- # Link the container config
17- if [ ! -L $HOME/.local/share/libertine/ContainersConfig.json ] ; then
18+ # Copy or merge the container config files
19+ if [ ! -e $HOME/.local/share/libertine/ContainersConfig.json ] ; then
20 mkdir -p $HOME/.local/share/libertine/
21- ln -s $PACKAGE_PATH/libertine-config/libertine/ContainersConfig.json $HOME/.local/share/libertine/ContainersConfig.json
22+ cp $PACKAGE_PATH/libertine-config/libertine/ContainersConfig.json $HOME/.local/share/libertine/ContainersConfig.json
23+ elif [ -L $HOME/.local/share/libertine/ContainersConfig.json ] ; then
24+ rm $HOME/.local/share/libertine/ContainersConfig.json
25+ cp $PACKAGE_PATH/libertine-config/libertine/ContainersConfig.json $HOME/.local/share/libertine/ContainersConfig.json
26+ else
27+ libertine-container-manager merge-configs -f $PACKAGE_PATH/libertine-config/libertine/ContainersConfig.json
28 fi
29
30 # Create and copy the user-data dir from the click package
31
32=== modified file 'debian/changelog'
33--- debian/changelog 2016-04-11 16:05:03 +0000
34+++ debian/changelog 2016-04-25 17:15:41 +0000
35@@ -1,3 +1,29 @@
36+libertine (1.0.1-0ubuntu1) UNRELEASED; urgency=medium
37+
38+ [ Chris Townsend ]
39+ * Allow an explicitly set distro during the create operation if it matches the
40+ host's distro even if the distro is technically end-of-life. (LP: #1569397)
41+ * More Libertine GUI improvements.
42+ * Check to make sure a subcommand was given and if not, print out the usage.
43+ (LP: #1539104)
44+ * Check to see if CLI and GUI is ran using sudo and if so, print a message and
45+ exit. (LP: #1570548)
46+ * Catch runtime errors raised when starting a container so a crash file is not
47+ generated and to tell the GUI that there was an error so the user can be
48+ presented a proper notification. (LP: #1539105)
49+ * Use shutil.which() instead of hardcoded path for detecting if proot is on the
50+ system. Fixes alternate $PATH locations such as in a snap. (LP: #1572591)
51+ * Add a 'merge-configs' command to l-c-m which allows merging a specified
52+ ContainersConfig.json file with the existing config file. (LP: #1566391)
53+ * Have the Puritine click linking occur before Unity 8 is started to avoid having
54+ a 0-byte ContainersConfig.json file from being created. (LP: #1573266)
55+
56+ [ Larry Price ]
57+ * Fixing infinite package removal on error caused by bad apt command and variable
58+ access. (LP: #1573201)
59+
60+ -- Chris Townsend <christopher.townsend@canonical.com> Mon, 25 Apr 2016 12:49:22 -0400
61+
62 libertine (1.0.0+16.04.20160411-0ubuntu1) xenial; urgency=medium
63
64 [ Chris Townsend ]
65
66=== modified file 'libertine/ContainerConfig.cpp'
67--- libertine/ContainerConfig.cpp 2016-03-10 21:33:25 +0000
68+++ libertine/ContainerConfig.cpp 2016-04-25 17:15:41 +0000
69@@ -3,7 +3,7 @@
70 * @brief Libertine Manager containers configuration module
71 */
72 /*
73- * Copyright 2015 Canonical Ltd
74+ * Copyright 2015-2016 Canonical Ltd
75 *
76 * Libertine is free software: you can redistribute it and/or modify it under
77 * the terms of the GNU General Public License, version 3, as published by the
78@@ -147,6 +147,7 @@
79 { QObject::tr("new"), ContainerConfig::InstallStatus::New },
80 { QObject::tr("installing"), ContainerConfig::InstallStatus::Installing },
81 { QObject::tr("ready"), ContainerConfig::InstallStatus::Ready },
82+ { QObject::tr("updating"), ContainerConfig::InstallStatus::Updating },
83 { QObject::tr("removing"), ContainerConfig::InstallStatus::Removing },
84 { QObject::tr("removed"), ContainerConfig::InstallStatus::Removed },
85 { QObject::tr("failed"), ContainerConfig::InstallStatus::Failed },
86
87=== modified file 'libertine/ContainerConfig.h'
88--- libertine/ContainerConfig.h 2016-03-10 21:33:25 +0000
89+++ libertine/ContainerConfig.h 2016-04-25 17:15:41 +0000
90@@ -3,7 +3,7 @@
91 * @brief Libertine Manager containers configuration module
92 */
93 /*
94- * Copyright 2015 Canonical Ltd
95+ * Copyright 2015-2016 Canonical Ltd
96 *
97 * Libertine is free software: you can redistribute it and/or modify it under
98 * the terms of the GNU General Public License, version 3, as published by the
99@@ -88,7 +88,7 @@
100 public:
101 /** The container's current install state. */
102 enum class InstallStatus
103- { New, Installing, Ready, Removing, Removed, Failed };
104+ { New, Installing, Ready, Updating, Removing, Removed, Failed };
105
106
107 public:
108
109=== modified file 'libertine/ContainerManager.cpp'
110--- libertine/ContainerManager.cpp 2016-04-01 17:48:28 +0000
111+++ libertine/ContainerManager.cpp 2016-04-25 17:15:41 +0000
112@@ -3,7 +3,7 @@
113 * @brief Threaded Libertine container manager
114 */
115 /*
116- * Copyright 2015 Canonical Ltd
117+ * Copyright 2015-2016 Canonical Ltd
118 *
119 * Libertine is free software: you can redistribute it and/or modify it under
120 * the terms of the GNU General Public License, version 3, as published by the
121@@ -289,7 +289,7 @@
122 result = false;
123 }
124
125- emit finishedInstall(result, QString(error_msg));
126+ emit finishedInstall(package_name, result, QString(error_msg));
127 emit finished();
128 quit();
129 }
130@@ -319,7 +319,7 @@
131 result = false;
132 }
133
134- emit finishedRemove(result, QString(error_msg));
135+ emit finishedRemove(package_name, result, QString(error_msg));
136 emit finished();
137 quit();
138 }
139
140=== modified file 'libertine/ContainerManager.h'
141--- libertine/ContainerManager.h 2016-03-16 19:56:23 +0000
142+++ libertine/ContainerManager.h 2016-04-25 17:15:41 +0000
143@@ -3,7 +3,7 @@
144 * @brief Threaded Libertine container manager
145 */
146 /*
147- * Copyright 2015 Canonical Ltd
148+ * Copyright 2015-2016 Canonical Ltd
149 *
150 * Libertine is free software: you can redistribute it and/or modify it under
151 * the terms of the GNU General Public License, version 3, as published by the
152@@ -150,8 +150,8 @@
153 void dataListChanged();
154 void finished();
155 void finishedDestroy(QString const& container_id);
156- void finishedInstall(bool result, QString const& error_msg);
157- void finishedRemove(bool result, QString const& error_msg);
158+ void finishedInstall(QString const& package_name, bool result, QString const& error_msg);
159+ void finishedRemove(QString const& package_name, bool result, QString const& error_msg);
160 void finishedSearch(bool result, QList<QString> packageList);
161 void finishedCommand(QString const& command_output);
162 void finishedConfigure(bool result, QString const& error_msg);
163
164=== modified file 'libertine/main.cpp'
165--- libertine/main.cpp 2015-05-13 13:42:12 +0000
166+++ libertine/main.cpp 2016-04-25 17:15:41 +0000
167@@ -19,10 +19,18 @@
168 #include "libertine/config.h"
169 #include "libertine/libertine.h"
170
171+#include <unistd.h>
172+#include <QtCore/QDebug>
173
174 int
175 main(int argc, char* argv[])
176 {
177+ if (!geteuid())
178+ {
179+ qWarning() << "Please do not run " LIBERTINE_APPLICATION_NAME " using \'sudo\'.";
180+ exit(1);
181+ }
182+
183 Libertine app(argc, argv);
184 return app.exec();
185 }
186
187=== removed file 'libertine/qml/ContainerApps.qml'
188--- libertine/qml/ContainerApps.qml 2015-07-09 15:22:37 +0000
189+++ libertine/qml/ContainerApps.qml 1970-01-01 00:00:00 +0000
190@@ -1,27 +0,0 @@
191-/**
192- * @file ContainerApps.qml
193- * @brief Libertine container apps data source
194- */
195-/*
196- * Copyright 2015 Canonical Ltd
197- *
198- * Libertine is free software: you can redistribute it and/or modify it under
199- * the terms of the GNU General Public License, version 3, as published by the
200- * Free Software Foundation.
201- *
202- * Libertine is distributed in the hope that it will be useful, but WITHOUT ANY
203- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
204- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
205- *
206- * You should have received a copy of the GNU General Public License
207- * along with this program. If not, see <http://www.gnu.org/licenses/>.
208- */
209-import QtQuick 2.4
210-
211-Item {
212- function are_apps_installed(containerId) {
213- var documentIds = {}
214-
215- return documentIds.length > 0
216- }
217-}
218
219=== modified file 'libertine/qml/ContainerInfoView.qml'
220--- libertine/qml/ContainerInfoView.qml 2016-04-07 12:45:29 +0000
221+++ libertine/qml/ContainerInfoView.qml 2016-04-25 17:15:41 +0000
222@@ -25,7 +25,7 @@
223
224 Page {
225 id: containerInfoView
226- title: i18n.tr("Container information for %1").arg(mainView.currentContainer)
227+ title: i18n.tr("Container information for %1").arg(containerConfigList.getContainerName(mainView.currentContainer))
228 property string currentContainer: mainView.currentContainer
229 property string containerDistroText: containerConfigList.getContainerDistro(currentContainer)
230 property string containerNameText: containerConfigList.getContainerName(currentContainer)
231
232=== modified file 'libertine/qml/ContainersView.qml'
233--- libertine/qml/ContainersView.qml 2016-03-16 19:56:23 +0000
234+++ libertine/qml/ContainersView.qml 2016-04-25 17:15:41 +0000
235@@ -45,21 +45,25 @@
236 model: containerConfigList
237
238 delegate: ListItem {
239+ Label {
240+ text: name
241+ anchors {
242+ verticalCenter: parent.verticalCenter
243+ left: parent.left
244+ leftMargin: units.gu(2)
245+ }
246+ }
247 ActivityIndicator {
248 id: containerActivity
249- anchors.verticalCenter: parent.verticalCenter
250+ anchors {
251+ verticalCenter: parent.verticalCenter
252+ right: parent.right
253+ rightMargin: units.gu(2)
254+ }
255 visible: (installStatus === i18n.tr("installing") ||
256 installStatus === i18n.tr("removing")) ? true : false
257 running: containerActivity.visible
258 }
259- Label {
260- text: name
261- anchors {
262- verticalCenter: parent.verticalCenter
263- left: containerActivity.running ? containerActivity.right : parent.left
264- leftMargin: units.gu(2)
265- }
266- }
267
268 leadingActions: ListItemActions {
269 actions: [
270@@ -94,6 +98,8 @@
271 iconName: "edit"
272 text: i18n.tr("edit")
273 description: i18n.tr("Container Apps")
274+ visible: (installStatus === i18n.tr("ready") ||
275+ installStatus === i18n.tr("updating")) ? true : false
276 onTriggered: {
277 mainView.currentContainer = containerId
278 containerAppsList.setContainerApps(mainView.currentContainer)
279
280=== modified file 'libertine/qml/ExtraArchivesView.qml'
281--- libertine/qml/ExtraArchivesView.qml 2016-03-10 21:33:25 +0000
282+++ libertine/qml/ExtraArchivesView.qml 2016-04-25 17:15:41 +0000
283@@ -72,23 +72,28 @@
284 UbuntuListView {
285 id: extraArchiveList
286 anchors.fill: parent
287+ visible: !containerArchivesList.empty() ? true : false
288 model: containerArchivesList
289 delegate: ListItem {
290+ Label {
291+ anchors {
292+ verticalCenter: parent.verticalCenter
293+ left: parent.left
294+ leftMargin: units.gu(2)
295+ }
296+ text: archiveName
297+ }
298 ActivityIndicator {
299 id: extraArchiveActivity
300- anchors.verticalCenter: parent.verticalCenter
301+ anchors {
302+ verticalCenter: parent.verticalCenter
303+ right: parent.right
304+ rightMargin: units.gu(2)
305+ }
306 visible: (archiveStatus === i18n.tr("installing") ||
307 archiveStatus === i18n.tr("removing")) ? true : false
308 running: extraArchiveActivity.visible
309 }
310- Label {
311- anchors {
312- verticalCenter: parent.verticalCenter
313- left: extraArchiveActivity.running ? extraArchiveActivity.right : parent.left
314- leftMargin: units.gu(2)
315- }
316- text: archiveName
317- }
318 leadingActions: ListItemActions {
319 actions: [
320 Action {
321@@ -104,6 +109,16 @@
322 }
323 }
324
325+ Label {
326+ id: emptyLabel
327+ anchors.centerIn: parent
328+ visible: !extraArchiveList.visible ? true : false
329+ wrapMode: Text.Wrap
330+ width: parent.width
331+ horizontalAlignment: Text.AlignHCenter
332+ text: i18n.tr("No additional archives and PPA's have been added")
333+ }
334+
335 function addArchive(archive) {
336 var comp = Qt.createComponent("ContainerManager.qml")
337 worker = comp.createObject(mainView, {"containerAction": ContainerManagerWorker.Configure,
338@@ -154,6 +169,8 @@
339
340 function reloadArchives() {
341 containerArchivesList.setContainerArchives(mainView.currentContainer)
342+
343+ extraArchiveList.visible = !containerArchivesList.empty() ? true : false
344 }
345
346 function finishedConfigure(result, error_msg) {
347
348=== modified file 'libertine/qml/HomeView.qml'
349--- libertine/qml/HomeView.qml 2016-04-08 20:16:41 +0000
350+++ libertine/qml/HomeView.qml 2016-04-25 17:15:41 +0000
351@@ -24,7 +24,7 @@
352
353 Page {
354 id: homeView
355- title: i18n.tr("Classic Apps - %1").arg(mainView.currentContainer)
356+ title: i18n.tr("Classic Apps - %1").arg(containerConfigList.getContainerName(mainView.currentContainer))
357
358 head.actions: [
359 Action {
360@@ -99,15 +99,15 @@
361 ActionSelectionPopover {
362 actions: ActionList {
363 Action {
364- text: i18n.tr("Configure Container")
365+ text: i18n.tr("Manage Container")
366 onTriggered: {
367- pageStack.push(Qt.resolvedUrl("ConfigureContainer.qml"))
368+ pageStack.push(Qt.resolvedUrl("ManageContainer.qml"))
369 }
370 }
371 Action {
372- text: i18n.tr("Update Container")
373+ text: i18n.tr("Container Information")
374 onTriggered: {
375- updateContainer()
376+ pageStack.push(Qt.resolvedUrl("ContainerInfoView.qml"))
377 }
378 }
379 Action {
380@@ -159,27 +159,35 @@
381
382 function reloadAppList() {
383 containerAppsList.setContainerApps(mainView.currentContainer)
384+
385+ appsList.visible = !containerAppsList.empty() ? true : false
386 }
387
388 UbuntuListView {
389+ id: appsList
390 anchors.fill: parent
391 model: containerAppsList
392+ visible: !containerAppsList.empty() ? true : false
393 delegate: ListItem {
394+ Label {
395+ text: packageName
396+ anchors {
397+ verticalCenter: parent.verticalCenter
398+ left: parent.left
399+ leftMargin: units.gu(2)
400+ }
401+ }
402 ActivityIndicator {
403 id: appActivity
404- anchors.verticalCenter: parent.verticalCenter
405+ anchors {
406+ verticalCenter: parent.verticalCenter
407+ right: parent.right
408+ rightMargin: units.gu(2)
409+ }
410 visible: (appStatus === i18n.tr("installing") ||
411 appStatus === i18n.tr("removing")) ? true : false
412 running: appActivity.visible
413 }
414- Label {
415- text: packageName
416- anchors {
417- verticalCenter: parent.verticalCenter
418- left: appActivity.running ? appActivity.right : parent.left
419- leftMargin: units.gu(2)
420- }
421- }
422 leadingActions: ListItemActions {
423 actions: [
424 Action {
425@@ -189,7 +197,6 @@
426 onTriggered: {
427 mainView.currentPackage = packageName
428 removePackage(packageName)
429- pageStack.push(Qt.resolvedUrl("PackageInfoView.qml"))
430 }
431 }
432 ]
433@@ -210,12 +217,14 @@
434 }
435 }
436
437- function updateContainer() {
438- var comp = Qt.createComponent("ContainerManager.qml")
439- var worker = comp.createObject(mainView, {"containerAction": ContainerManagerWorker.Update,
440- "containerId": mainView.currentContainer,
441- "containerType": containerConfigList.getContainerType(mainView.currentContainer)})
442- worker.start()
443+ Label {
444+ id: emptyLabel
445+ anchors.centerIn: parent
446+ visible: !appsList.visible
447+ wrapMode: Text.Wrap
448+ width: parent.width
449+ horizontalAlignment: Text.AlignHCenter
450+ text: i18n.tr("No packages are installed")
451 }
452
453 function installPackage(package_name) {
454@@ -224,6 +233,7 @@
455 "containerId": mainView.currentContainer,
456 "containerType": containerConfigList.getContainerType(mainView.currentContainer),
457 "data": package_name})
458+ worker.finishedInstall.connect(mainView.packageInstallFinished)
459 worker.start()
460 }
461
462@@ -233,6 +243,7 @@
463 "containerId": mainView.currentContainer,
464 "containerType": containerConfigList.getContainerType(mainView.currentContainer),
465 "data": packageName})
466+ worker.finishedRemove.connect(mainView.packageRemoveFinished)
467 worker.start()
468 }
469 }
470
471=== renamed file 'libertine/qml/ConfigureContainer.qml' => 'libertine/qml/ManageContainer.qml'
472--- libertine/qml/ConfigureContainer.qml 2016-04-07 20:39:10 +0000
473+++ libertine/qml/ManageContainer.qml 2016-04-25 17:15:41 +0000
474@@ -1,6 +1,6 @@
475 /**
476- * @file ConfigureContainer.qml
477- * @brief Libertine configure container view
478+ * @file ManageContainer.qml
479+ * @brief Libertine manage container view
480 */
481 /*
482 * Copyright 2016 Canonical Ltd
483@@ -23,8 +23,8 @@
484
485
486 Page {
487- id: configureView
488- title: i18n.tr("Configure %1").arg(mainView.currentContainer)
489+ id: manageView
490+ title: i18n.tr("Manage %1").arg(containerConfigList.getContainerName(mainView.currentContainer))
491
492 Column {
493 anchors.left: parent.left
494@@ -63,5 +63,54 @@
495 pageStack.push(Qt.resolvedUrl("ExtraArchivesView.qml"))
496 }
497 }
498+
499+ ListItem.Standard {
500+ control: Button {
501+ id: updateButton
502+ text: i18n.tr("Update…")
503+ visible: (containerConfigList.getContainerStatus(mainView.currentContainer) === i18n.tr("ready")) ? true : false
504+ onClicked: {
505+ updateContainer()
506+ }
507+ }
508+ ActivityIndicator {
509+ id: updateActivity
510+ anchors {
511+ verticalCenter: parent.verticalCenter
512+ right: parent.right
513+ rightMargin: units.gu(2)
514+ }
515+ visible: (containerConfigList.getContainerStatus(mainView.currentContainer) === i18n.tr("updating")) ? true : false
516+ running: updateActivity.visible
517+ }
518+ text: i18n.tr("Update container")
519+ }
520+ }
521+
522+ Component.onCompleted: {
523+ containerConfigList.configChanged.connect(updateStatus)
524+ }
525+
526+ Component.onDestruction: {
527+ containerConfigList.configChanged.disconnect(updateStatus)
528+ }
529+
530+ function updateContainer() {
531+ var comp = Qt.createComponent("ContainerManager.qml")
532+ var worker = comp.createObject(mainView, {"containerAction": ContainerManagerWorker.Update,
533+ "containerId": mainView.currentContainer,
534+ "containerType": containerConfigList.getContainerType(mainView.currentContainer)})
535+ worker.start()
536+ }
537+
538+ function updateStatus() {
539+ if (containerConfigList.getContainerStatus(mainView.currentContainer) === i18n.tr("updating")) {
540+ updateButton.visible = false
541+ updateActivity.visible = true
542+ }
543+ else if (containerConfigList.getContainerStatus(mainView.currentContainer) === i18n.tr("ready")) {
544+ updateButton.visible = true
545+ updateActivity.visible = false
546+ }
547 }
548 }
549
550=== modified file 'libertine/qml/PackageInfoView.qml'
551--- libertine/qml/PackageInfoView.qml 2016-04-07 19:17:30 +0000
552+++ libertine/qml/PackageInfoView.qml 2016-04-25 17:15:41 +0000
553@@ -29,10 +29,8 @@
554 property string currentContainer: mainView.currentContainer
555 property var currentPackage: mainView.currentPackage
556 property var statusText: containerConfigList.getAppStatus(currentContainer, currentPackage)
557- property var failureReasonText: ""
558 property var packageVersionText: i18n.tr("Obtaining package version…")
559 property var worker: null
560- property var install_signal: null
561
562
563 Flickable {
564@@ -60,26 +58,10 @@
565 text: statusText
566 }
567 }
568-
569- ListItem.Standard {
570- id: failureReason
571- text: i18n.tr("Failure reason")
572- visible: false
573- control: Label {
574- text: failureReasonText
575- wrapMode: Text.Wrap
576- width: parent.parent.width/2
577- horizontalAlignment: Qt.AlignRight
578- onHeightChanged: updateFailureReasonHeight()
579- }
580- }
581 }
582 }
583
584 Component.onCompleted: {
585- if (install_signal) {
586- install_signal.connect(installFinished)
587- }
588 containerConfigList.configChanged.connect(reloadStatus)
589 var command = "apt-cache policy " + currentPackage
590 var comp = Qt.createComponent("ContainerManager.qml")
591@@ -94,13 +76,6 @@
592 Component.onDestruction: {
593 containerConfigList.configChanged.disconnect(reloadStatus)
594 worker.finishedCommand.disconnect(getPackageVersion)
595- if (install_signal) {
596- install_signal.disconnect(installFinished)
597- }
598- }
599-
600- function updateFailureReasonHeight() {
601- failureReason.height = Math.max(failureReason.control.height + 10, 48)
602 }
603
604 function reloadStatus() {
605@@ -114,13 +89,4 @@
606 function getPackageVersion(command_output) {
607 packageVersionText = containerConfigList.getAppVersion(command_output)
608 }
609-
610- function installFinished(success, error_msg) {
611- if (!success) {
612- statusText = i18n.tr("failed")
613- failureReasonText = error_msg
614- failureReason.visible = true
615- }
616- install_signal.disconnect(installFinished)
617- }
618 }
619
620=== added file 'libertine/qml/PackageOperationFailureDialog.qml'
621--- libertine/qml/PackageOperationFailureDialog.qml 1970-01-01 00:00:00 +0000
622+++ libertine/qml/PackageOperationFailureDialog.qml 2016-04-25 17:15:41 +0000
623@@ -0,0 +1,36 @@
624+/**
625+ * @file PackageOperationFailureDialog.qml
626+ * @brief Libertine package operation failure dialog
627+ */
628+/*
629+ * Copyright 2016 Canonical Ltd
630+ *
631+ * Libertine is free software: you can redistribute it and/or modify it under
632+ * the terms of the GNU General Public License, version 3, as published by the
633+ * Free Software Foundation.
634+ *
635+ * Libertine is distributed in the hope that it will be useful, but WITHOUT ANY
636+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
637+ * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
638+ *
639+ * You should have received a copy of the GNU General Public License
640+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
641+ */
642+import QtQuick 2.4
643+import Ubuntu.Components 1.2
644+import Ubuntu.Components.Popups 1.2
645+
646+Dialog {
647+ id: packageOperationFailedDialog
648+ property var package_name: null
649+ property var error_msg: null
650+ property var operation: null // Either "installing" or "removing"
651+
652+ title: i18n.tr("Failure %1 the %2 package.").arg(operation).arg(package_name)
653+ text: error_msg
654+
655+ Button {
656+ text: i18n.tr("Dismiss")
657+ onClicked: PopupUtils.close(packageOperationFailedDialog)
658+ }
659+}
660
661=== modified file 'libertine/qml/SearchResultsView.qml'
662--- libertine/qml/SearchResultsView.qml 2016-03-16 19:56:23 +0000
663+++ libertine/qml/SearchResultsView.qml 2016-04-25 17:15:41 +0000
664@@ -83,6 +83,8 @@
665 anchors {
666 top: parent.top
667 topMargin: units.gu(2)
668+ left: parent.left
669+ leftMargin: units.gu(2)
670 }
671 }
672 Label {
673
674=== modified file 'libertine/qml/libertine.qml'
675--- libertine/qml/libertine.qml 2016-01-20 17:34:19 +0000
676+++ libertine/qml/libertine.qml 2016-04-25 17:15:41 +0000
677@@ -3,7 +3,7 @@
678 * @brief Libertine app main view.
679 */
680 /*
681- * Copyright 2015 Canonical Ltd
682+ * Copyright 2015-2016 Canonical Ltd
683 *
684 * Libertine is free software: you can redistribute it and/or modify it under
685 * the terms of the GNU General Public License, version 3, as published by the
686@@ -18,6 +18,7 @@
687 */
688 import QtQuick 2.4
689 import Ubuntu.Components 1.2
690+import Ubuntu.Components.Popups 1.2
691
692
693 MainView {
694@@ -29,6 +30,9 @@
695 property var currentContainer: undefined
696 property var currentPackage: undefined
697
698+ signal packageInstallFinished(string package_name, bool result, string message)
699+ signal packageRemoveFinished(string package_name, bool result, string message)
700+
701 PageStack {
702 id: pageStack
703 }
704@@ -47,4 +51,18 @@
705 pageStack.push(Qt.resolvedUrl("WelcomeView.qml"))
706 }
707 }
708+
709+ onPackageInstallFinished: {
710+ if (!result) {
711+ PopupUtils.open(Qt.resolvedUrl("PackageOperationFailureDialog.qml"), null,
712+ {"package_name": package_name, "error_msg": message, "operation": i18n.tr("installing")})
713+ }
714+ }
715+
716+ onPackageRemoveFinished: {
717+ if (!result) {
718+ PopupUtils.open(Qt.resolvedUrl("PackageOperationFailureDialog.qml"), null,
719+ {"package_name": package_name, "error_msg": message, "operation": i18n.tr("removing")})
720+ }
721+ }
722 }
723
724=== modified file 'po/en_US.po'
725--- po/en_US.po 2016-04-08 20:16:41 +0000
726+++ po/en_US.po 2016-04-25 17:15:41 +0000
727@@ -7,7 +7,7 @@
728 msgstr ""
729 "Project-Id-Version: PACKAGE VERSION\n"
730 "Report-Msgid-Bugs-To: \n"
731-"POT-Creation-Date: 2016-04-08 16:01-0400\n"
732+"POT-Creation-Date: 2016-04-22 09:44-0400\n"
733 "PO-Revision-Date: 2016-03-21 10:21-0400\n"
734 "Last-Translator: Chris Townsend <christopher.townsend@canonical.com>\n"
735 "Language-Team: English\n"
736@@ -25,7 +25,7 @@
737 msgid "Add additional PPA"
738 msgstr ""
739
740-#: ../libertine/qml/ExtraArchivesView.qml:133
741+#: ../libertine/qml/ExtraArchivesView.qml:148
742 msgid "Adding archive failed"
743 msgstr ""
744
745@@ -33,7 +33,7 @@
746 msgid "Additional Archives and PPAs"
747 msgstr ""
748
749-#: ../libertine/qml/ConfigureContainer.qml:59
750+#: ../libertine/qml/ManageContainer.qml:59
751 msgid "Additional archives and PPAs"
752 msgstr ""
753
754@@ -41,14 +41,14 @@
755 msgid "Authentication required"
756 msgstr ""
757
758-#: ../libertine/qml/DebianPackagePicker.qml:7
759+#: ../libertine/qml/DebianPackagePicker.qml:26
760 msgid "Available Debian Packages to Install"
761 msgstr ""
762
763+#: ../libertine/qml/ContainerOptionsDialog.qml:75
764+#: ../libertine/qml/ContainerPasswordDialog.qml:70
765 #: ../libertine/qml/SearchPackagesDialog.qml:57
766-#: ../libertine/qml/ContainerPasswordDialog.qml:70
767 #: ../libertine/qml/HomeView.qml:86 ../libertine/qml/ExtraArchivesView.qml:62
768-#: ../libertine/qml/ContainerOptionsDialog.qml:75
769 msgid "Cancel"
770 msgstr ""
771
772@@ -60,27 +60,24 @@
773 msgid "Classic Apps - %1"
774 msgstr "Classic Apps - %1"
775
776-#: ../libertine/qml/ConfigureContainer.qml:27
777-msgid "Configure %1"
778-msgstr "Configure %1"
779-
780-#: ../libertine/qml/HomeView.qml:102
781-msgid "Configure Container"
782-msgstr "Configure Container"
783-
784 #: ../libertine/qml/ContainerOptionsDialog.qml:28
785 #, fuzzy
786 msgid "Configure options for container creation."
787 msgstr "Configure Container"
788
789-#: ../libertine/qml/ContainersView.qml:96
790+#: ../libertine/qml/ContainersView.qml:100
791 msgid "Container Apps"
792 msgstr "Container Apps"
793
794-#: ../libertine/qml/ContainersView.qml:87
795+#: ../libertine/qml/ContainersView.qml:91
796 msgid "Container Info"
797 msgstr "Container Info"
798
799+#: ../libertine/qml/HomeView.qml:108
800+#, fuzzy
801+msgid "Container Information"
802+msgstr "Container information for %1"
803+
804 #: ../libertine/qml/ContainerOptionsDialog.qml:27
805 #, fuzzy
806 msgid "Container Options"
807@@ -90,11 +87,12 @@
808 msgid "Container information for %1"
809 msgstr "Container information for %1"
810
811-#: ../libertine/qml/ContainersView.qml:69
812+#: ../libertine/qml/ContainersView.qml:73
813 msgid "Delete Container"
814 msgstr "Delete Container"
815
816-#: ../libertine/qml/ExtraArchivesView.qml:137
817+#: ../libertine/qml/PackageOperationFailureDialog.qml:33
818+#: ../libertine/qml/ExtraArchivesView.qml:152
819 msgid "Dismiss"
820 msgstr ""
821
822@@ -121,9 +119,11 @@
823 msgid "Enter package name or Debian file"
824 msgstr "Please enter the exact package name of the app to install:"
825
826-#: ../libertine/qml/PackageInfoView.qml:66
827-msgid "Failure reason"
828-msgstr ""
829+#. Either "installing" or "removing"
830+#: ../libertine/qml/PackageOperationFailureDialog.qml:29
831+#, fuzzy
832+msgid "Failure %1 the %2 package."
833+msgstr "Information for the %1 package"
834
835 #: ../libertine/qml/ContainerInfoView.qml:48
836 msgid "ID"
837@@ -137,8 +137,8 @@
838 msgid "Install"
839 msgstr "Install"
840
841+#: ../libertine/qml/DebianPackagePicker.qml:53
842 #: ../libertine/qml/SearchResults.qml:42
843-#: ../libertine/qml/DebianPackagePicker.qml:34
844 msgid "Install Package"
845 msgstr "Install Package"
846
847@@ -147,7 +147,7 @@
848 msgid "Install new package"
849 msgstr "Install Package"
850
851-#: ../libertine/qml/PackageInfoView.qml:58
852+#: ../libertine/qml/PackageInfoView.qml:56
853 #, fuzzy
854 msgid "Install status"
855 msgstr "Install status: %1"
856@@ -156,6 +156,15 @@
857 msgid "Invalid password entered"
858 msgstr ""
859
860+#: ../libertine/qml/ManageContainer.qml:27
861+msgid "Manage %1"
862+msgstr ""
863+
864+#: ../libertine/qml/HomeView.qml:102
865+#, fuzzy
866+msgid "Manage Container"
867+msgstr "My Containers"
868+
869 #: ../libertine/qml/ContainersView.qml:31
870 msgid "My Containers"
871 msgstr "My Containers"
872@@ -165,7 +174,7 @@
873 msgid "Name"
874 msgstr "Name: %1"
875
876-#: ../libertine/qml/DebianPackagePicker.qml:53
877+#: ../libertine/qml/DebianPackagePicker.qml:72
878 msgid "No Debian packages available"
879 msgstr ""
880
881@@ -174,18 +183,27 @@
882 msgid "No Search Results Found"
883 msgstr "No search results for %1."
884
885+#: ../libertine/qml/ExtraArchivesView.qml:119
886+msgid "No additional archives and PPA's have been added"
887+msgstr ""
888+
889+#: ../libertine/qml/HomeView.qml:227
890+#, fuzzy
891+msgid "No packages are installed"
892+msgstr "Please enter the exact package name of the app to install:"
893+
894+#: ../libertine/qml/ContainerOptionsDialog.qml:64
895+#: ../libertine/qml/ContainerPasswordDialog.qml:52
896 #: ../libertine/qml/SearchPackagesDialog.qml:39
897-#: ../libertine/qml/ContainerPasswordDialog.qml:52
898 #: ../libertine/qml/HomeView.qml:65 ../libertine/qml/ExtraArchivesView.qml:54
899-#: ../libertine/qml/ContainerOptionsDialog.qml:64
900 msgid "OK"
901 msgstr ""
902
903-#: ../libertine/qml/PackageInfoView.qml:33
904+#: ../libertine/qml/PackageInfoView.qml:32
905 msgid "Obtaining package version…"
906 msgstr "Obtaining package version…"
907
908-#: ../libertine/qml/HomeView.qml:202
909+#: ../libertine/qml/HomeView.qml:209
910 msgid "Package Info"
911 msgstr "Package Info"
912
913@@ -197,7 +215,7 @@
914 msgid "Package name or Debian package path"
915 msgstr ""
916
917-#: ../libertine/qml/PackageInfoView.qml:51
918+#: ../libertine/qml/PackageInfoView.qml:49
919 #, fuzzy
920 msgid "Package version"
921 msgstr "Package version: %1"
922@@ -206,11 +224,11 @@
923 msgid "Password is required to create a Libertine container"
924 msgstr ""
925
926-#: ../libertine/qml/HomeView.qml:188
927+#: ../libertine/qml/HomeView.qml:196
928 msgid "Remove Package"
929 msgstr "Remove Package"
930
931-#: ../libertine/qml/ExtraArchivesView.qml:97
932+#: ../libertine/qml/ExtraArchivesView.qml:102
933 msgid "Remove extra archive"
934 msgstr ""
935
936@@ -247,12 +265,12 @@
937 msgid "Search archives for packages"
938 msgstr ""
939
940+#: ../libertine/qml/SearchResultsView.qml:39
941 #: ../libertine/qml/SearchPackagesDialog.qml:26
942-#: ../libertine/qml/SearchResultsView.qml:39
943 msgid "Search for packages"
944 msgstr ""
945
946-#: ../libertine/qml/SearchResultsView.qml:90
947+#: ../libertine/qml/SearchResultsView.qml:92
948 #, fuzzy
949 msgid "Searching for packages…"
950 msgstr "Obtaining package version…"
951@@ -277,10 +295,15 @@
952 "The %1 package is already installed. Please try a different package name."
953 msgstr "Package %1 already installed. Please try a different package name."
954
955-#: ../libertine/qml/HomeView.qml:108
956-msgid "Update Container"
957+#: ../libertine/qml/ManageContainer.qml:86
958+#, fuzzy
959+msgid "Update container"
960 msgstr "Update Container"
961
962+#: ../libertine/qml/ManageContainer.qml:70
963+msgid "Update…"
964+msgstr ""
965+
966 #: ../libertine/qml/WelcomeView.qml:27
967 msgid "Welcome"
968 msgstr "Welcome"
969@@ -308,39 +331,38 @@
970 msgid "container name"
971 msgstr "Container Info"
972
973-#: ../libertine/qml/ContainersView.qml:68 ../libertine/qml/HomeView.qml:187
974+#: ../libertine/qml/ContainersView.qml:72 ../libertine/qml/HomeView.qml:195
975 msgid "delete"
976 msgstr "delete"
977
978-#: ../libertine/qml/ContainersView.qml:95
979+#: ../libertine/qml/ContainersView.qml:99
980 msgid "edit"
981 msgstr "edit"
982
983-#: ../libertine/ContainerConfig.cpp:152 ../libertine/ContainerConfig.cpp:186
984-#: ../libertine/qml/PackageInfoView.qml:120
985+#: ../libertine/ContainerConfig.cpp:153 ../libertine/ContainerConfig.cpp:187
986 msgid "failed"
987 msgstr "failed"
988
989-#: ../libertine/qml/ConfigureContainer.qml:55
990 #: ../libertine/qml/ContainerOptionsDialog.qml:40
991+#: ../libertine/qml/ManageContainer.qml:55
992 msgid "i386 multiarch support"
993 msgstr "i386 multiarch support"
994
995-#: ../libertine/qml/ContainersView.qml:86 ../libertine/qml/HomeView.qml:201
996+#: ../libertine/qml/ContainersView.qml:90 ../libertine/qml/HomeView.qml:208
997 msgid "info"
998 msgstr "info"
999
1000-#: ../libertine/ContainerConfig.cpp:185
1001+#: ../libertine/ContainerConfig.cpp:186
1002 msgid "installed"
1003 msgstr "installed"
1004
1005-#: ../libertine/ContainerConfig.cpp:148 ../libertine/ContainerConfig.cpp:184
1006-#: ../libertine/qml/ContainersView.qml:51 ../libertine/qml/HomeView.qml:171
1007-#: ../libertine/qml/ExtraArchivesView.qml:80
1008+#: ../libertine/ContainerConfig.cpp:148 ../libertine/ContainerConfig.cpp:185
1009+#: ../libertine/qml/libertine.qml:58 ../libertine/qml/ContainersView.qml:63
1010+#: ../libertine/qml/HomeView.qml:187 ../libertine/qml/ExtraArchivesView.qml:93
1011 msgid "installing"
1012 msgstr "installing"
1013
1014-#: ../libertine/ContainerConfig.cpp:147 ../libertine/ContainerConfig.cpp:183
1015+#: ../libertine/ContainerConfig.cpp:147 ../libertine/ContainerConfig.cpp:184
1016 msgid "new"
1017 msgstr "new"
1018
1019@@ -349,24 +371,26 @@
1020 msgid "password"
1021 msgstr "Password"
1022
1023-#: ../libertine/ContainerConfig.cpp:149
1024+#: ../libertine/ContainerConfig.cpp:149 ../libertine/qml/ContainersView.qml:101
1025+#: ../libertine/qml/ManageContainer.qml:71
1026+#: ../libertine/qml/ManageContainer.qml:111
1027 msgid "ready"
1028 msgstr "ready"
1029
1030-#: ../libertine/qml/ExtraArchivesView.qml:96
1031+#: ../libertine/qml/ExtraArchivesView.qml:101
1032 #, fuzzy
1033 msgid "remove"
1034 msgstr "removed"
1035
1036-#: ../libertine/ContainerConfig.cpp:151 ../libertine/ContainerConfig.cpp:188
1037-#: ../libertine/qml/PackageInfoView.qml:110
1038+#: ../libertine/ContainerConfig.cpp:152 ../libertine/ContainerConfig.cpp:189
1039 #: ../libertine/qml/ContainerInfoView.qml:88
1040+#: ../libertine/qml/PackageInfoView.qml:85
1041 msgid "removed"
1042 msgstr "removed"
1043
1044-#: ../libertine/ContainerConfig.cpp:150 ../libertine/ContainerConfig.cpp:187
1045-#: ../libertine/qml/ContainersView.qml:52 ../libertine/qml/HomeView.qml:172
1046-#: ../libertine/qml/ExtraArchivesView.qml:81
1047+#: ../libertine/ContainerConfig.cpp:151 ../libertine/ContainerConfig.cpp:188
1048+#: ../libertine/qml/libertine.qml:65 ../libertine/qml/ContainersView.qml:64
1049+#: ../libertine/qml/HomeView.qml:188 ../libertine/qml/ExtraArchivesView.qml:94
1050 msgid "removing"
1051 msgstr "removing"
1052
1053@@ -374,6 +398,18 @@
1054 msgid "search"
1055 msgstr ""
1056
1057+#: ../libertine/ContainerConfig.cpp:150 ../libertine/qml/ContainersView.qml:102
1058+#: ../libertine/qml/ManageContainer.qml:83
1059+#: ../libertine/qml/ManageContainer.qml:107
1060+msgid "updating"
1061+msgstr ""
1062+
1063+#~ msgid "Configure %1"
1064+#~ msgstr "Configure %1"
1065+
1066+#~ msgid "Configure Container"
1067+#~ msgstr "Configure Container"
1068+
1069 #~ msgid "ID: %1"
1070 #~ msgstr "ID: %1"
1071
1072
1073=== modified file 'po/libertine.pot'
1074--- po/libertine.pot 2016-04-08 20:16:41 +0000
1075+++ po/libertine.pot 2016-04-25 17:15:41 +0000
1076@@ -8,7 +8,7 @@
1077 msgstr ""
1078 "Project-Id-Version: PACKAGE VERSION\n"
1079 "Report-Msgid-Bugs-To: \n"
1080-"POT-Creation-Date: 2016-04-08 16:01-0400\n"
1081+"POT-Creation-Date: 2016-04-22 09:44-0400\n"
1082 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1083 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1084 "Language-Team: LANGUAGE <LL@li.org>\n"
1085@@ -17,145 +17,83 @@
1086 "Content-Type: text/plain; charset=UTF-8\n"
1087 "Content-Transfer-Encoding: 8bit\n"
1088
1089-#: ../libertine/ContainerConfig.cpp:147 ../libertine/ContainerConfig.cpp:183
1090+#: ../libertine/ContainerConfig.cpp:147 ../libertine/ContainerConfig.cpp:184
1091 msgid "new"
1092 msgstr ""
1093
1094-#: ../libertine/ContainerConfig.cpp:148 ../libertine/ContainerConfig.cpp:184
1095-#: ../libertine/qml/ContainersView.qml:51 ../libertine/qml/HomeView.qml:171
1096-#: ../libertine/qml/ExtraArchivesView.qml:80
1097+#: ../libertine/ContainerConfig.cpp:148 ../libertine/ContainerConfig.cpp:185
1098+#: ../libertine/qml/libertine.qml:58 ../libertine/qml/ContainersView.qml:63
1099+#: ../libertine/qml/HomeView.qml:187 ../libertine/qml/ExtraArchivesView.qml:93
1100 msgid "installing"
1101 msgstr ""
1102
1103-#: ../libertine/ContainerConfig.cpp:149
1104+#: ../libertine/ContainerConfig.cpp:149 ../libertine/qml/ContainersView.qml:101
1105+#: ../libertine/qml/ManageContainer.qml:71
1106+#: ../libertine/qml/ManageContainer.qml:111
1107 msgid "ready"
1108 msgstr ""
1109
1110-#: ../libertine/ContainerConfig.cpp:150 ../libertine/ContainerConfig.cpp:187
1111-#: ../libertine/qml/ContainersView.qml:52 ../libertine/qml/HomeView.qml:172
1112-#: ../libertine/qml/ExtraArchivesView.qml:81
1113+#: ../libertine/ContainerConfig.cpp:150 ../libertine/qml/ContainersView.qml:102
1114+#: ../libertine/qml/ManageContainer.qml:83
1115+#: ../libertine/qml/ManageContainer.qml:107
1116+msgid "updating"
1117+msgstr ""
1118+
1119+#: ../libertine/ContainerConfig.cpp:151 ../libertine/ContainerConfig.cpp:188
1120+#: ../libertine/qml/libertine.qml:65 ../libertine/qml/ContainersView.qml:64
1121+#: ../libertine/qml/HomeView.qml:188 ../libertine/qml/ExtraArchivesView.qml:94
1122 msgid "removing"
1123 msgstr ""
1124
1125-#: ../libertine/ContainerConfig.cpp:151 ../libertine/ContainerConfig.cpp:188
1126-#: ../libertine/qml/PackageInfoView.qml:110
1127+#: ../libertine/ContainerConfig.cpp:152 ../libertine/ContainerConfig.cpp:189
1128 #: ../libertine/qml/ContainerInfoView.qml:88
1129+#: ../libertine/qml/PackageInfoView.qml:85
1130 msgid "removed"
1131 msgstr ""
1132
1133-#: ../libertine/ContainerConfig.cpp:152 ../libertine/ContainerConfig.cpp:186
1134-#: ../libertine/qml/PackageInfoView.qml:120
1135+#: ../libertine/ContainerConfig.cpp:153 ../libertine/ContainerConfig.cpp:187
1136 msgid "failed"
1137 msgstr ""
1138
1139-#: ../libertine/ContainerConfig.cpp:185
1140+#: ../libertine/ContainerConfig.cpp:186
1141 msgid "installed"
1142 msgstr ""
1143
1144-#: ../libertine/qml/PackageExistsDialog.qml:28
1145-msgid "The %1 package is already installed."
1146-msgstr ""
1147-
1148-#: ../libertine/qml/PackageExistsDialog.qml:29
1149-msgid "Search again or return to search results."
1150-msgstr ""
1151-
1152-#: ../libertine/qml/PackageExistsDialog.qml:33
1153-msgid "Search again"
1154-msgstr ""
1155-
1156-#: ../libertine/qml/PackageExistsDialog.qml:43
1157-msgid "Return to search results"
1158-msgstr ""
1159-
1160-#: ../libertine/qml/ContainersView.qml:31
1161-msgid "My Containers"
1162-msgstr ""
1163-
1164-#: ../libertine/qml/ContainersView.qml:68 ../libertine/qml/HomeView.qml:187
1165-msgid "delete"
1166-msgstr ""
1167-
1168-#: ../libertine/qml/ContainersView.qml:69
1169-msgid "Delete Container"
1170-msgstr ""
1171-
1172-#: ../libertine/qml/ContainersView.qml:86 ../libertine/qml/HomeView.qml:201
1173-msgid "info"
1174-msgstr ""
1175-
1176-#: ../libertine/qml/ContainersView.qml:87
1177-msgid "Container Info"
1178-msgstr ""
1179-
1180-#: ../libertine/qml/ContainersView.qml:95
1181-msgid "edit"
1182-msgstr ""
1183-
1184-#: ../libertine/qml/ContainersView.qml:96
1185-msgid "Container Apps"
1186-msgstr ""
1187-
1188-#: ../libertine/qml/ConfigureContainer.qml:27
1189-msgid "Configure %1"
1190-msgstr ""
1191-
1192-#: ../libertine/qml/ConfigureContainer.qml:55
1193+#: ../libertine/qml/ContainerOptionsDialog.qml:27
1194+msgid "Container Options"
1195+msgstr ""
1196+
1197+#: ../libertine/qml/ContainerOptionsDialog.qml:28
1198+msgid "Configure options for container creation."
1199+msgstr ""
1200+
1201 #: ../libertine/qml/ContainerOptionsDialog.qml:40
1202+#: ../libertine/qml/ManageContainer.qml:55
1203 msgid "i386 multiarch support"
1204 msgstr ""
1205
1206-#: ../libertine/qml/ConfigureContainer.qml:59
1207-msgid "Additional archives and PPAs"
1208-msgstr ""
1209-
1210-#: ../libertine/qml/SearchPackagesDialog.qml:26
1211-#: ../libertine/qml/SearchResultsView.qml:39
1212-msgid "Search for packages"
1213-msgstr ""
1214-
1215-#: ../libertine/qml/SearchPackagesDialog.qml:27
1216-msgid "Search archives for packages"
1217-msgstr ""
1218-
1219-#: ../libertine/qml/SearchPackagesDialog.qml:31
1220-msgid "search"
1221-msgstr ""
1222-
1223+#: ../libertine/qml/ContainerOptionsDialog.qml:50
1224+msgid "Enter or name for the container or leave blank for default name"
1225+msgstr ""
1226+
1227+#: ../libertine/qml/ContainerOptionsDialog.qml:56
1228+msgid "container name"
1229+msgstr ""
1230+
1231+#: ../libertine/qml/ContainerOptionsDialog.qml:64
1232+#: ../libertine/qml/ContainerPasswordDialog.qml:52
1233 #: ../libertine/qml/SearchPackagesDialog.qml:39
1234-#: ../libertine/qml/ContainerPasswordDialog.qml:52
1235 #: ../libertine/qml/HomeView.qml:65 ../libertine/qml/ExtraArchivesView.qml:54
1236-#: ../libertine/qml/ContainerOptionsDialog.qml:64
1237 msgid "OK"
1238 msgstr ""
1239
1240+#: ../libertine/qml/ContainerOptionsDialog.qml:75
1241+#: ../libertine/qml/ContainerPasswordDialog.qml:70
1242 #: ../libertine/qml/SearchPackagesDialog.qml:57
1243-#: ../libertine/qml/ContainerPasswordDialog.qml:70
1244 #: ../libertine/qml/HomeView.qml:86 ../libertine/qml/ExtraArchivesView.qml:62
1245-#: ../libertine/qml/ContainerOptionsDialog.qml:75
1246 msgid "Cancel"
1247 msgstr ""
1248
1249-#: ../libertine/qml/PackageInfoView.qml:28
1250-msgid "Information for the %1 package"
1251-msgstr ""
1252-
1253-#: ../libertine/qml/PackageInfoView.qml:33
1254-msgid "Obtaining package version…"
1255-msgstr ""
1256-
1257-#: ../libertine/qml/PackageInfoView.qml:51
1258-msgid "Package version"
1259-msgstr ""
1260-
1261-#: ../libertine/qml/PackageInfoView.qml:58
1262-msgid "Install status"
1263-msgstr ""
1264-
1265-#: ../libertine/qml/PackageInfoView.qml:66
1266-msgid "Failure reason"
1267-msgstr ""
1268-
1269 #: ../libertine/qml/SearchResultsView.qml:28
1270 msgid "Package Search Results"
1271 msgstr ""
1272@@ -164,6 +102,11 @@
1273 msgid "Search"
1274 msgstr ""
1275
1276+#: ../libertine/qml/SearchResultsView.qml:39
1277+#: ../libertine/qml/SearchPackagesDialog.qml:26
1278+msgid "Search for packages"
1279+msgstr ""
1280+
1281 #: ../libertine/qml/SearchResultsView.qml:49
1282 msgid "No Search Results Found"
1283 msgstr ""
1284@@ -176,20 +119,20 @@
1285 msgid "Return to Apps Page"
1286 msgstr ""
1287
1288-#: ../libertine/qml/SearchResultsView.qml:90
1289+#: ../libertine/qml/SearchResultsView.qml:92
1290 msgid "Searching for packages…"
1291 msgstr ""
1292
1293+#: ../libertine/qml/DebianPackagePicker.qml:26
1294+msgid "Available Debian Packages to Install"
1295+msgstr ""
1296+
1297+#: ../libertine/qml/DebianPackagePicker.qml:53
1298 #: ../libertine/qml/SearchResults.qml:42
1299-#: ../libertine/qml/DebianPackagePicker.qml:34
1300 msgid "Install Package"
1301 msgstr ""
1302
1303-#: ../libertine/qml/DebianPackagePicker.qml:7
1304-msgid "Available Debian Packages to Install"
1305-msgstr ""
1306-
1307-#: ../libertine/qml/DebianPackagePicker.qml:53
1308+#: ../libertine/qml/DebianPackagePicker.qml:72
1309 msgid "No Debian packages available"
1310 msgstr ""
1311
1312@@ -209,6 +152,88 @@
1313 msgid "password"
1314 msgstr ""
1315
1316+#: ../libertine/qml/ContainerInfoView.qml:28
1317+msgid "Container information for %1"
1318+msgstr ""
1319+
1320+#: ../libertine/qml/ContainerInfoView.qml:48
1321+msgid "ID"
1322+msgstr ""
1323+
1324+#: ../libertine/qml/ContainerInfoView.qml:55
1325+msgid "Name"
1326+msgstr ""
1327+
1328+#: ../libertine/qml/ContainerInfoView.qml:62
1329+msgid "Distribution"
1330+msgstr ""
1331+
1332+#: ../libertine/qml/ContainerInfoView.qml:69
1333+msgid "Status"
1334+msgstr ""
1335+
1336+#. Either "installing" or "removing"
1337+#: ../libertine/qml/PackageOperationFailureDialog.qml:29
1338+msgid "Failure %1 the %2 package."
1339+msgstr ""
1340+
1341+#: ../libertine/qml/PackageOperationFailureDialog.qml:33
1342+#: ../libertine/qml/ExtraArchivesView.qml:152
1343+msgid "Dismiss"
1344+msgstr ""
1345+
1346+#: ../libertine/qml/ContainersView.qml:31
1347+msgid "My Containers"
1348+msgstr ""
1349+
1350+#: ../libertine/qml/ContainersView.qml:72 ../libertine/qml/HomeView.qml:195
1351+msgid "delete"
1352+msgstr ""
1353+
1354+#: ../libertine/qml/ContainersView.qml:73
1355+msgid "Delete Container"
1356+msgstr ""
1357+
1358+#: ../libertine/qml/ContainersView.qml:90 ../libertine/qml/HomeView.qml:208
1359+msgid "info"
1360+msgstr ""
1361+
1362+#: ../libertine/qml/ContainersView.qml:91
1363+msgid "Container Info"
1364+msgstr ""
1365+
1366+#: ../libertine/qml/ContainersView.qml:99
1367+msgid "edit"
1368+msgstr ""
1369+
1370+#: ../libertine/qml/ContainersView.qml:100
1371+msgid "Container Apps"
1372+msgstr ""
1373+
1374+#: ../libertine/qml/SearchPackagesDialog.qml:27
1375+msgid "Search archives for packages"
1376+msgstr ""
1377+
1378+#: ../libertine/qml/SearchPackagesDialog.qml:31
1379+msgid "search"
1380+msgstr ""
1381+
1382+#: ../libertine/qml/ManageContainer.qml:27
1383+msgid "Manage %1"
1384+msgstr ""
1385+
1386+#: ../libertine/qml/ManageContainer.qml:59
1387+msgid "Additional archives and PPAs"
1388+msgstr ""
1389+
1390+#: ../libertine/qml/ManageContainer.qml:70
1391+msgid "Update…"
1392+msgstr ""
1393+
1394+#: ../libertine/qml/ManageContainer.qml:86
1395+msgid "Update container"
1396+msgstr ""
1397+
1398 #: ../libertine/qml/HomeView.qml:27
1399 msgid "Classic Apps - %1"
1400 msgstr ""
1401@@ -231,11 +256,11 @@
1402 msgstr ""
1403
1404 #: ../libertine/qml/HomeView.qml:102
1405-msgid "Configure Container"
1406+msgid "Manage Container"
1407 msgstr ""
1408
1409 #: ../libertine/qml/HomeView.qml:108
1410-msgid "Update Container"
1411+msgid "Container Information"
1412 msgstr ""
1413
1414 #: ../libertine/qml/HomeView.qml:114
1415@@ -254,14 +279,53 @@
1416 msgid "Search archives for a package"
1417 msgstr ""
1418
1419-#: ../libertine/qml/HomeView.qml:188
1420+#: ../libertine/qml/HomeView.qml:196
1421 msgid "Remove Package"
1422 msgstr ""
1423
1424-#: ../libertine/qml/HomeView.qml:202
1425+#: ../libertine/qml/HomeView.qml:209
1426 msgid "Package Info"
1427 msgstr ""
1428
1429+#: ../libertine/qml/HomeView.qml:227
1430+msgid "No packages are installed"
1431+msgstr ""
1432+
1433+#: ../libertine/qml/PackageInfoView.qml:28
1434+msgid "Information for the %1 package"
1435+msgstr ""
1436+
1437+#: ../libertine/qml/PackageInfoView.qml:32
1438+msgid "Obtaining package version…"
1439+msgstr ""
1440+
1441+#: ../libertine/qml/PackageInfoView.qml:49
1442+msgid "Package version"
1443+msgstr ""
1444+
1445+#: ../libertine/qml/PackageInfoView.qml:56
1446+msgid "Install status"
1447+msgstr ""
1448+
1449+#: ../libertine/qml/WelcomeView.qml:27
1450+msgid "Welcome"
1451+msgstr ""
1452+
1453+#: ../libertine/qml/WelcomeView.qml:42
1454+msgid "Welcome to the Ubuntu Legacy Application Support Manager."
1455+msgstr ""
1456+
1457+#: ../libertine/qml/WelcomeView.qml:50
1458+msgid ""
1459+"You do not have Legacy Application Support configured at this time. "
1460+"Downloading and setting up the required environment takes some time and "
1461+"network bandwidth."
1462+msgstr ""
1463+
1464+#: ../libertine/qml/WelcomeView.qml:58
1465+msgid "Install"
1466+msgstr ""
1467+
1468 #: ../libertine/qml/ExtraArchivesView.qml:26
1469 msgid "Additional Archives and PPAs"
1470 msgstr ""
1471@@ -282,73 +346,34 @@
1472 msgid "Enter name of PPA in the form ppa:user/ppa-name:"
1473 msgstr ""
1474
1475-#: ../libertine/qml/ExtraArchivesView.qml:96
1476+#: ../libertine/qml/ExtraArchivesView.qml:101
1477 msgid "remove"
1478 msgstr ""
1479
1480-#: ../libertine/qml/ExtraArchivesView.qml:97
1481+#: ../libertine/qml/ExtraArchivesView.qml:102
1482 msgid "Remove extra archive"
1483 msgstr ""
1484
1485-#: ../libertine/qml/ExtraArchivesView.qml:133
1486+#: ../libertine/qml/ExtraArchivesView.qml:119
1487+msgid "No additional archives and PPA's have been added"
1488+msgstr ""
1489+
1490+#: ../libertine/qml/ExtraArchivesView.qml:148
1491 msgid "Adding archive failed"
1492 msgstr ""
1493
1494-#: ../libertine/qml/ExtraArchivesView.qml:137
1495-msgid "Dismiss"
1496-msgstr ""
1497-
1498-#: ../libertine/qml/WelcomeView.qml:27
1499-msgid "Welcome"
1500-msgstr ""
1501-
1502-#: ../libertine/qml/WelcomeView.qml:42
1503-msgid "Welcome to the Ubuntu Legacy Application Support Manager."
1504-msgstr ""
1505-
1506-#: ../libertine/qml/WelcomeView.qml:50
1507-msgid ""
1508-"You do not have Legacy Application Support configured at this time. "
1509-"Downloading and setting up the required environment takes some time and "
1510-"network bandwidth."
1511-msgstr ""
1512-
1513-#: ../libertine/qml/WelcomeView.qml:58
1514-msgid "Install"
1515-msgstr ""
1516-
1517-#: ../libertine/qml/ContainerInfoView.qml:28
1518-msgid "Container information for %1"
1519-msgstr ""
1520-
1521-#: ../libertine/qml/ContainerInfoView.qml:48
1522-msgid "ID"
1523-msgstr ""
1524-
1525-#: ../libertine/qml/ContainerInfoView.qml:55
1526-msgid "Name"
1527-msgstr ""
1528-
1529-#: ../libertine/qml/ContainerInfoView.qml:62
1530-msgid "Distribution"
1531-msgstr ""
1532-
1533-#: ../libertine/qml/ContainerInfoView.qml:69
1534-msgid "Status"
1535-msgstr ""
1536-
1537-#: ../libertine/qml/ContainerOptionsDialog.qml:27
1538-msgid "Container Options"
1539-msgstr ""
1540-
1541-#: ../libertine/qml/ContainerOptionsDialog.qml:28
1542-msgid "Configure options for container creation."
1543-msgstr ""
1544-
1545-#: ../libertine/qml/ContainerOptionsDialog.qml:50
1546-msgid "Enter or name for the container or leave blank for default name"
1547-msgstr ""
1548-
1549-#: ../libertine/qml/ContainerOptionsDialog.qml:56
1550-msgid "container name"
1551+#: ../libertine/qml/PackageExistsDialog.qml:28
1552+msgid "The %1 package is already installed."
1553+msgstr ""
1554+
1555+#: ../libertine/qml/PackageExistsDialog.qml:29
1556+msgid "Search again or return to search results."
1557+msgstr ""
1558+
1559+#: ../libertine/qml/PackageExistsDialog.qml:33
1560+msgid "Search again"
1561+msgstr ""
1562+
1563+#: ../libertine/qml/PackageExistsDialog.qml:43
1564+msgid "Return to search results"
1565 msgstr ""
1566
1567=== modified file 'python/libertine/ChrootContainer.py'
1568--- python/libertine/ChrootContainer.py 2016-04-07 18:03:04 +0000
1569+++ python/libertine/ChrootContainer.py 2016-04-25 17:15:41 +0000
1570@@ -199,8 +199,8 @@
1571 return returncode
1572
1573 def _build_proot_command(self):
1574- proot_cmd = '/usr/bin/proot'
1575- if not os.path.isfile(proot_cmd) or not os.access(proot_cmd, os.X_OK):
1576+ proot_cmd = shutil.which('proot')
1577+ if not proot_cmd:
1578 raise RuntimeError('executable proot not found')
1579
1580 proot_cmd += " -R " + self.root_path
1581@@ -234,8 +234,8 @@
1582 return proot_cmd
1583
1584 def _build_privileged_proot_cmd(self):
1585- proot_cmd = '/usr/bin/proot'
1586- if not os.path.isfile(proot_cmd) or not os.access(proot_cmd, os.X_OK):
1587+ proot_cmd = shutil.which('proot')
1588+ if not proot_cmd:
1589 raise RuntimeError('executable proot not found')
1590
1591 proot_cmd += " -b /usr/lib/locale -S " + self.root_path
1592
1593=== modified file 'python/libertine/Libertine.py'
1594--- python/libertine/Libertine.py 2016-04-07 20:39:10 +0000
1595+++ python/libertine/Libertine.py 2016-04-25 17:15:41 +0000
1596@@ -56,7 +56,14 @@
1597
1598
1599 def apt_command_prefix(verbosity):
1600- return '/usr/bin/apt ' + apt_args_for_verbosity_level(verbosity) + ' '
1601+ return '/usr/bin/apt-get ' + apt_args_for_verbosity_level(verbosity) + \
1602+ ' --option Apt::Cmd::Disable-Script-Warning=true --option Dpkg::Progress-Fancy=1' + \
1603+ ' --option Apt::Color=1 '
1604+
1605+
1606+def handle_runtime_error(error):
1607+ print("%s" % error)
1608+ return False
1609
1610
1611 class BaseContainer(metaclass=abc.ABCMeta):
1612@@ -311,15 +318,21 @@
1613 """
1614 Updates the contents of the container.
1615 """
1616- with ContainerRunning(self.container):
1617- self.container.update_packages(verbosity)
1618+ try:
1619+ with ContainerRunning(self.container):
1620+ self.container.update_packages(verbosity)
1621+ except RuntimeError as e:
1622+ return handle_runtime_error(e)
1623
1624 def install_package(self, package_name, verbosity=1):
1625 """
1626 Installs a package in the container.
1627 """
1628- with ContainerRunning(self.container):
1629- return self.container.install_package(package_name, verbosity)
1630+ try:
1631+ with ContainerRunning(self.container):
1632+ return self.container.install_package(package_name, verbosity)
1633+ except RuntimeError as e:
1634+ return handle_runtime_error(e)
1635
1636 def remove_package(self, package_name, verbosity=1):
1637 """
1638@@ -328,9 +341,13 @@
1639 :param package_name: The name of the package to be removed.
1640 :param verbosity: The verbosity level of the progress reporting.
1641 """
1642- with ContainerRunning(self.container):
1643- self.container.run_in_container(apt_command_prefix(verbosity) + "purge '" + package_name + "'") == 0
1644- self.container.run_in_container(apt_command_prefix(verbosity) + "autoremove --purge") == 0
1645+ try:
1646+ with ContainerRunning(self.container):
1647+ if self.container.run_in_container(apt_command_prefix(verbosity) + "purge '" + package_name + "'") != 0:
1648+ return False
1649+ return self.container.run_in_container(apt_command_prefix(verbosity) + "autoremove --purge") == 0
1650+ except RuntimeError as e:
1651+ return handle_runtime_error(e)
1652
1653 def search_package_cache(self, search_string):
1654 """
1655@@ -339,8 +356,11 @@
1656 :param search_string: the (regex) to use to search the package cache.
1657 The regex is quoted to sanitize it.
1658 """
1659- with ContainerRunning(self.container):
1660- self.container.run_in_container("/usr/bin/apt-cache search '" + search_string + "'")
1661+ try:
1662+ with ContainerRunning(self.container):
1663+ self.container.run_in_container("/usr/bin/apt-cache search '" + search_string + "'")
1664+ except RuntimeError as e:
1665+ return handle_runtime_error(e)
1666
1667 def launch_application(self, app_exec_line):
1668 """
1669@@ -350,7 +370,7 @@
1670 ubuntu-app-launch
1671 """
1672 if libertine.utils.container_exists(self.container.container_id):
1673- self.container.launch_application(app_exec_line)
1674+ self.container.launch_application(app_exec_line)
1675 else:
1676 raise RuntimeError("Container with id %s does not exist." % self.container.container_id)
1677
1678@@ -380,9 +400,15 @@
1679 example, 'apt-cache policy package-foo'
1680 :rtype: The output of the given command.
1681 """
1682- with ContainerRunning(self.container):
1683- return self.container.run_in_container(exec_line)
1684+ try:
1685+ with ContainerRunning(self.container):
1686+ return self.container.run_in_container(exec_line)
1687+ except RuntimeError as e:
1688+ return handle_runtime_error(e)
1689
1690 def configure_command(self, command, *args):
1691- with ContainerRunning(self.container):
1692- return self.container.configure_command(command, *args)
1693+ try:
1694+ with ContainerRunning(self.container):
1695+ return self.container.configure_command(command, *args)
1696+ except RuntimeError as e:
1697+ return handle_runtime_error(e)
1698
1699=== modified file 'tools/libertine-container-manager'
1700--- tools/libertine-container-manager 2016-04-11 13:42:37 +0000
1701+++ tools/libertine-container-manager 2016-04-25 17:15:41 +0000
1702@@ -31,6 +31,40 @@
1703 from libertine import LibertineContainer
1704
1705
1706+def find_duplicate_container_entry(container_list, container_id):
1707+ for container in container_list['containerList']:
1708+ if container['id'] == container_id:
1709+ return container
1710+
1711+ return None
1712+
1713+
1714+def merge_container_config_files(filepath):
1715+ merged_json = []
1716+ main_config = read_container_config_file()
1717+
1718+ with open(filepath, 'r') as fd:
1719+ merge_source = json.load(fd)
1720+
1721+ if "containerList" in main_config:
1722+ # Finds any duplicate entries and assumes we want to update the main config
1723+ # with entries from the merge source.
1724+ for i, container in enumerate(main_config['containerList']):
1725+ merge_container = find_duplicate_container_entry(merge_source, container['id'])
1726+ if merge_container:
1727+ main_config['containerList'][i] = merge_container
1728+ merge_source['containerList'].remove(merge_container)
1729+
1730+ # Merges in any remaining non-duplicate entries.
1731+ for container in merge_source['containerList']:
1732+ main_config['containerList'].append(container)
1733+
1734+ else:
1735+ main_config = merge_source
1736+
1737+ write_container_config_file(main_config)
1738+
1739+
1740 def read_container_config_file():
1741 container_list = {}
1742 container_config_file = libertine.utils.get_libertine_database_file_path()
1743@@ -83,7 +117,10 @@
1744
1745 def is_distro_valid(distro, force):
1746 if force:
1747- return UbuntuDistroInfo().valid(distro)
1748+ return UbuntuDistroInfo().valid(distro)
1749+
1750+ if distro == get_host_distro_release():
1751+ return True
1752
1753 supported_distros = UbuntuDistroInfo().supported()
1754
1755@@ -418,7 +455,10 @@
1756 container = LibertineContainer(args.id)
1757 update_package_install_status(args.id, args.package, "removing")
1758
1759- container.remove_package(args.package, args.verbosity)
1760+ if not container.remove_package(args.package, args.verbosity):
1761+ update_package_install_status(args.id, args.package, "installed")
1762+ sys.exit(1)
1763+
1764 update_package_install_status(args.id, args.package, "removed")
1765
1766 delete_package(args.id, args.package)
1767@@ -432,7 +472,8 @@
1768 args.id = get_default_container_id()
1769
1770 container = LibertineContainer(args.id)
1771- container.search_package_cache(args.search_string)
1772+ if not container.search_package_cache(args.search_string):
1773+ sys.exit(1)
1774
1775
1776 def update(args):
1777@@ -443,7 +484,13 @@
1778 args.id = get_default_container_id()
1779
1780 container = LibertineContainer(args.id)
1781- container.update_libertine_container(args.verbosity)
1782+
1783+ update_container_install_status(args.id, "updating")
1784+ if not container.update_libertine_container(args.verbosity):
1785+ update_container_install_status(args.id, "ready")
1786+ sys.exit(1)
1787+
1788+ update_container_install_status(args.id, "ready")
1789
1790
1791 def list(args):
1792@@ -494,7 +541,9 @@
1793 print("i386 multiarch support is already %s" % multiarch)
1794 sys.exit(1)
1795
1796- container.configure_command('multiarch', args.multiarch)
1797+ if not container.configure_command('multiarch', args.multiarch):
1798+ sys.exit(1)
1799+
1800 update_container_multiarch_support(args.id, multiarch)
1801
1802 elif args.add_archive:
1803@@ -523,15 +572,26 @@
1804 delete_container_archive(args.id, args.delete_archive)
1805
1806
1807+def merge(args):
1808+ merge_container_config_files(args.file)
1809+
1810+
1811 if __name__ == '__main__':
1812 parser = argparse.ArgumentParser(description="Legacy X application support for Unity 8")
1813+
1814+ if not os.geteuid():
1815+ print("Please do not run %s using sudo" % parser.prog)
1816+ sys.exit(1)
1817+
1818 parser.add_argument('-q', '--quiet',
1819 action='store_const', dest='verbosity', const=0,
1820 help=('do not print status updates on stdout'))
1821 parser.add_argument('-v', '--verbose',
1822 action='store_const', dest='verbosity', const=2,
1823 help=('extra verbose output'))
1824- subparsers = parser.add_subparsers(dest="subparser_name")
1825+ subparsers = parser.add_subparsers(dest="subparser_name",
1826+ title="subcommands",
1827+ metavar='create, destroy, install-package, remove-package, search-cache, update, list, list-apps, configure')
1828
1829 # Handle the create command and its options
1830 parser_create = subparsers.add_parser(
1831@@ -587,17 +647,17 @@
1832 parser_install.set_defaults(func=install_package)
1833
1834 # Handle the remove-package command and its options
1835- parser_install = subparsers.add_parser(
1836+ parser_remove = subparsers.add_parser(
1837 'remove-package',
1838 help=("Remove a package in the specified Libertine container."))
1839- parser_install.add_argument(
1840+ parser_remove.add_argument(
1841 '-p', '--package',
1842 required=True,
1843 help=("Name of package to remove. Required."))
1844- parser_install.add_argument(
1845+ parser_remove.add_argument(
1846 '-i', '--id',
1847 help=("Container identifier. Default container is used if omitted."))
1848- parser_install.set_defaults(func=remove_package)
1849+ parser_remove.set_defaults(func=remove_package)
1850
1851 # Handle the search-cache command and its options
1852 parser_search = subparsers.add_parser(
1853@@ -643,7 +703,8 @@
1854 # Handle the execute command and it's options
1855 parser_exec = subparsers.add_parser(
1856 'exec',
1857- help=("Run an arbitrary command in the specified Libertine container."))
1858+ add_help=False)
1859+ #help=("Run an arbitrary command in the specified Libertine container."))
1860 parser_exec.add_argument(
1861 '-i', '--id',
1862 help=("Container identifier. Default container is used if omitted."))
1863@@ -677,9 +738,21 @@
1864 "Needs to be in the form of \"ppa:user/ppa-name\"."))
1865 parser_configure.set_defaults(func=configure)
1866
1867+ # Handle merging another ContainersConfig.json file into the main ContainersConfig.json file
1868+ parser_merge = subparsers.add_parser(
1869+ 'merge-configs',
1870+ add_help=False)
1871+ parser_merge.add_argument(
1872+ '-f', '--file',
1873+ required=True)
1874+ parser_merge.set_defaults(func=merge)
1875+
1876 # Actually parse the args
1877 args = parser.parse_args()
1878 if args.verbosity is None:
1879 args.verbosity = 1
1880
1881- args.func(args)
1882+ if args.subparser_name == None:
1883+ parser.print_help()
1884+ else:
1885+ args.func(args)

Subscribers

People subscribed via source and target branches