Merge lp:~dobey/ubuntuone-installer/fix-939797 into lp:ubuntuone-installer

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 24
Merged at revision: 28
Proposed branch: lp:~dobey/ubuntuone-installer/fix-939797
Merge into: lp:ubuntuone-installer
Diff against target: 61 lines (+19/-6)
2 files modified
ubuntuone/installer/__init__.py (+2/-0)
ubuntuone/installer/gui.py (+17/-6)
To merge this branch: bzr merge lp:~dobey/ubuntuone-installer/fix-939797
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Review via email: mp+94598@code.launchpad.net

Commit message

Only install packages that haven't yet been installed.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

yay!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/installer/__init__.py'
2--- ubuntuone/installer/__init__.py 2012-02-17 21:46:16 +0000
3+++ ubuntuone/installer/__init__.py 2012-02-24 18:17:44 +0000
4@@ -19,6 +19,8 @@
5
6 from gi.repository import GLib
7
8+CLIENT_SHELL_PACKAGE = 'ubuntuone-client-gnome'
9+
10 CONTROL_PANEL_COMMAND = 'ubuntuone-control-panel-qt'
11 CONTROL_PANEL_PACKAGE = 'ubuntuone-control-panel-qt'
12
13
14=== modified file 'ubuntuone/installer/gui.py'
15--- ubuntuone/installer/gui.py 2012-02-23 14:42:09 +0000
16+++ ubuntuone/installer/gui.py 2012-02-24 18:17:44 +0000
17@@ -21,9 +21,11 @@
18 import os
19
20 from gi.repository import Gtk, GObject, GLib, Gdk, Pango
21-from ubuntuone.installer import (CONTROL_PANEL_COMMAND,
22+from ubuntuone.installer import (CLIENT_SHELL_PACKAGE,
23+ CONTROL_PANEL_COMMAND,
24 CONTROL_PANEL_PACKAGE,
25- MUSIC_STORE_PACKAGE)
26+ MUSIC_STORE_PACKAGE,
27+ is_installed)
28
29 # Some shenanigans to deal with pyflakes complaining
30 inline_callbacks = None
31@@ -196,6 +198,18 @@
32 if os.path.exists(path):
33 return path
34
35+ def __get_package_list(self):
36+ """Build the list of packages, to only include non-installed ones."""
37+ packages = []
38+ if not is_installed(CONTROL_PANEL_PACKAGE, CONTROL_PANEL_COMMAND):
39+ packages.append(CONTROL_PANEL_PACKAGE)
40+ if not is_installed(MUSIC_STORE_PACKAGE):
41+ packages.append(MUSIC_STORE_PACKAGE)
42+ if not is_installed(CLIENT_SHELL_PACKAGE):
43+ packages.append(CLIENT_SHELL_PACKAGE)
44+
45+ return packages
46+
47 def __got_response(self, dialog, response):
48 """Handle the dialog response actions."""
49 if response in [Gtk.ResponseType.CANCEL,
50@@ -362,10 +376,7 @@
51 Gtk.main_quit()
52
53 transaction = yield self.client.install_packages(
54- package_names=[MUSIC_STORE_PACKAGE,
55- 'ubuntuone-client-gnome',
56- CONTROL_PANEL_PACKAGE,
57- ])
58+ package_names=self.__get_package_list())
59 transaction.connect('finished', finished)
60 self.__apt_progress.set_transaction(transaction)
61 transaction.run()

Subscribers

People subscribed via source and target branches

to all changes: