Merge lp:~therve/landscape-client/on-demand-install-script into lp:~landscape/landscape-client/trunk

Proposed by Thomas Herve
Status: Merged
Approved by: Alberto Donato
Approved revision: 492
Merged at revision: 490
Proposed branch: lp:~therve/landscape-client/on-demand-install-script
Merge into: lp:~landscape/landscape-client/trunk
Diff against target: 208 lines (+101/-26)
7 files modified
applications/landscape-client-settings.desktop (+1/-1)
debian/control (+14/-0)
debian/landscape-client-ui-install.install (+3/-0)
debian/landscape-client-ui.install (+0/-2)
debian/rules (+17/-17)
scripts/landscape-client-ui-install (+62/-0)
setup.py (+4/-6)
To merge this branch: bzr merge lp:~therve/landscape-client/on-demand-install-script
Reviewer Review Type Date Requested Status
Alberto Donato (community) Approve
Free Ekanayaka (community) Approve
Review via email: mp+96787@code.launchpad.net

Description of the change

The branch defines a new script and a package installing it. The icon and the desktop file also move to that package.

To post a comment you must log in.
491. By Thomas Herve

Use a whitelist of packages

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Looks good! +1

[1]

+ return False

What do we need this for?

[2]

 ifneq (,$(filter $(dist_release),precise))
  # We want landscape-client-ui only from precise onward
 dh_extra_flags = -plandscape-common -plandscape-client -plandscape-client-ui -plandscape-client-install-ui
 else
 dh_extra_flags = -plandscape-common -plandscape-client
 endif

You can save some duplication by writing:

dh_extra_flags = -plandscape-common -plandscape-client
ifneq (,$(filter $(dist_release),precise))
 # We want landscape-client-ui only from precise onward
 dh_extra_flags = $(dh_extra_flags) -plandscape-client-ui -plandscape-client-install-ui
endif

review: Approve
492. By Thomas Herve

Cleanup dh_extra_flags definiton

Revision history for this message
Alberto Donato (ack) wrote :

Looks good! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'applications/landscape-client-settings.desktop'
--- applications/landscape-client-settings.desktop 2012-01-19 14:06:45 +0000
+++ applications/landscape-client-settings.desktop 2012-03-09 17:06:22 +0000
@@ -1,7 +1,7 @@
1[Desktop Entry]1[Desktop Entry]
2Name=Management Service2Name=Management Service
3Comment=Management Service Preferences3Comment=Management Service Preferences
4Exec=landscape-client-settings-ui4Exec=landscape-client-ui-install
5Icon=preferences-management-service5Icon=preferences-management-service
6Terminal=False6Terminal=False
7Type=Application7Type=Application
88
=== modified file 'debian/control'
--- debian/control 2012-03-09 10:47:49 +0000
+++ debian/control 2012-03-09 17:06:22 +0000
@@ -59,3 +59,17 @@
59 .59 .
60 This package provides the Landscape client configuration UI.60 This package provides the Landscape client configuration UI.
61XB-Python-Version: ${python:Versions}61XB-Python-Version: ${python:Versions}
62
63Package: landscape-client-ui-install
64Architecture: any
65Depends: ${python:Depends}, ${misc:Depends},
66 python-gobject,
67 python-dbus,
68 policykit-1,
69 gir1.2-gtk-3.0,
70 python-aptdaemon
71Description: The Landscape administration system client
72 Landscape is a web-based tool for managing Ubuntu systems.
73 .
74 This package provides an automatic installer for landscape-client-ui.
75XB-Python-Version: ${python:Versions}
6276
=== added file 'debian/landscape-client-ui-install.install'
--- debian/landscape-client-ui-install.install 1970-01-01 00:00:00 +0000
+++ debian/landscape-client-ui-install.install 2012-03-09 17:06:22 +0000
@@ -0,0 +1,3 @@
1usr/bin/landscape-client-ui-install
2usr/share/applications/landscape-client-settings.desktop
3usr/share/icons/hicolor/scalable/apps/preferences-management-service.svg
04
=== modified file 'debian/landscape-client-ui.install'
--- debian/landscape-client-ui.install 2012-03-09 08:46:50 +0000
+++ debian/landscape-client-ui.install 2012-03-09 17:06:22 +0000
@@ -7,6 +7,4 @@
7usr/share/polkit-1/actions/com.canonical.LandscapeClientRegistration.policy7usr/share/polkit-1/actions/com.canonical.LandscapeClientRegistration.policy
8etc/dbus-1/system.d/com.canonical.LandscapeClientSettings.conf8etc/dbus-1/system.d/com.canonical.LandscapeClientSettings.conf
9etc/dbus-1/system.d/com.canonical.LandscapeClientRegistration.conf9etc/dbus-1/system.d/com.canonical.LandscapeClientRegistration.conf
10usr/share/applications/landscape-client-settings.desktop
11usr/share/icons/hicolor/scalable/apps/preferences-management-service.svg
12usr/share/glib-2.0/schemas/com.canonical.landscape-client-settings.gschema.xml10usr/share/glib-2.0/schemas/com.canonical.landscape-client-settings.gschema.xml
1311
=== modified file 'debian/rules'
--- debian/rules 2012-03-09 08:46:50 +0000
+++ debian/rules 2012-03-09 17:06:22 +0000
@@ -2,24 +2,24 @@
22
3dist_release := $(shell lsb_release -cs)3dist_release := $(shell lsb_release -cs)
4ifneq ($(dist_release),dapper)4ifneq ($(dist_release),dapper)
5 use_pycentral = yes5 use_pycentral = yes
6endif6endif
7ifeq (,$(filter $(dist_release), hardy lucid))7ifeq (,$(filter $(dist_release), hardy lucid))
8 use_dhpython2 = yes8 use_dhpython2 = yes
9endif9endif
10
11dh_extra_flags = -plandscape-common -plandscape-client
10ifneq (,$(filter $(dist_release),precise))12ifneq (,$(filter $(dist_release),precise))
11 # We want landscape-client-ui only from precise onward13 # We want landscape-client-ui only from precise onward
12 dh_extra_flags =14 dh_extra_flags = $(dh_extra_flags) -plandscape-client-ui -plandscape-client-install-ui
13else
14 dh_extra_flags = -Nlandscape-client-ui
15endif15endif
1616
17-include /usr/share/python/python.mk17-include /usr/share/python/python.mk
18ifeq (,$(py_sitename))18ifeq (,$(py_sitename))
19 py_sitename = site-packages19 py_sitename = site-packages
20 py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages20 py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages
21 py_sitename_sh = $(py_sitename)21 py_sitename_sh = $(py_sitename)
22 py_libdir_sh = $(py_libdir)22 py_libdir_sh = $(py_libdir)
23endif23endif
2424
25package = landscape-client25package = landscape-client
@@ -107,15 +107,15 @@
107ifeq ($(use_dhpython2),yes)107ifeq ($(use_dhpython2),yes)
108 dh_python2 --no-guessing-versions108 dh_python2 --no-guessing-versions
109else109else
110 ifeq ($(use_pycentral),yes)110 ifeq ($(use_pycentral),yes)
111 ifneq (,$(py_setup_install_args))111 ifneq (,$(py_setup_install_args))
112 DH_PYCENTRAL=include-links dh_pycentral112 DH_PYCENTRAL=include-links dh_pycentral
113 else113 else
114 DH_PYCENTRAL=nomove dh_pycentral114 DH_PYCENTRAL=nomove dh_pycentral
115 endif115 endif
116 else116 else
117 dh_python117 dh_python
118 endif118 endif
119endif119endif
120 dh_installdeb $(dh_extra_flags)120 dh_installdeb $(dh_extra_flags)
121 dh_gencontrol $(dh_extra_flags)121 dh_gencontrol $(dh_extra_flags)
122122
=== added file 'scripts/landscape-client-ui-install'
--- scripts/landscape-client-ui-install 1970-01-01 00:00:00 +0000
+++ scripts/landscape-client-ui-install 2012-03-09 17:06:22 +0000
@@ -0,0 +1,62 @@
1#!/usr/bin/python
2
3import os
4import dbus
5import subprocess
6
7from gi.repository import GObject, Gtk
8
9from aptdaemon.client import AptClient
10from defer import inline_callbacks
11from aptdaemon import policykit1
12from aptdaemon.gtk3widgets import AptProgressDialog
13
14
15script = "/usr/bin/landscape-client-settings-ui"
16
17
18def on_transaction_done(transaction, exit):
19 Gtk.main_quit()
20
21
22@inline_callbacks
23def install_package():
24 aptclient = AptClient()
25 bus = dbus.SystemBus()
26 name = bus.get_unique_name()
27 action = policykit1.PK_ACTION_INSTALL_OR_REMOVE_PACKAGES
28 flags = policykit1.CHECK_AUTH_ALLOW_USER_INTERACTION
29 yield policykit1.check_authorization_by_name(name, action, flags=flags)
30 transaction = yield aptclient.install_packages(
31 ["landscape-client-ui"])
32 transaction.connect('finished', on_transaction_done)
33 dia = AptProgressDialog(transaction)
34 dia.run(close_on_finished=True, show_error=True)
35
36
37def main():
38 dialog = Gtk.MessageDialog(
39 flags=Gtk.DialogFlags.MODAL, type=Gtk.MessageType.INFO,
40 buttons=Gtk.ButtonsType.CANCEL)
41 dialog.set_markup(
42 "<big><b>%s</b></big>\n\n%s" % (
43 "Landscape client is not installed",
44 "You need to install Landscape client to be able to configure it. "
45 "Do you want to intall it now?"))
46 dialog.set_title("Install Landscape client?")
47 dialog.add_button("Install", Gtk.ResponseType.YES)
48 result = dialog.run()
49 dialog.destroy()
50 if result == Gtk.ResponseType.YES:
51 install_package()
52 else:
53 Gtk.main_quit()
54 return False
55
56
57if __name__ == "__main__":
58 if not os.path.exists(script):
59 GObject.idle_add(main)
60 Gtk.main()
61 else:
62 subprocess.call(script)
063
=== modified file 'setup.py'
--- setup.py 2012-03-09 08:46:50 +0000
+++ setup.py 2012-03-09 17:06:22 +0000
@@ -44,8 +44,7 @@
44 ("/usr/share/icons/hicolor/scalable/apps/",44 ("/usr/share/icons/hicolor/scalable/apps/",
45 ["icons/preferences-management-service.svg"]),45 ["icons/preferences-management-service.svg"]),
46 ("/usr/share/glib-2.0/schemas/",46 ("/usr/share/glib-2.0/schemas/",
47 ["glib-2.0/schemas/com.canonical.landscape-client-settings.gschema.xml"])47 ["glib-2.0/schemas/com.canonical.landscape-client-settings.gschema.xml"])],
48 ],
49 scripts=["scripts/landscape-client",48 scripts=["scripts/landscape-client",
50 "scripts/landscape-config",49 "scripts/landscape-config",
51 "scripts/landscape-message",50 "scripts/landscape-message",
@@ -60,8 +59,7 @@
60 "scripts/landscape-dbus-proxy",59 "scripts/landscape-dbus-proxy",
61 "scripts/landscape-client-settings-mechanism",60 "scripts/landscape-client-settings-mechanism",
62 "scripts/landscape-client-registration-mechanism",61 "scripts/landscape-client-registration-mechanism",
63 "scripts/landscape-client-settings-ui"62 "scripts/landscape-client-settings-ui",
64 ],63 "scripts/landscape-client-ui-install"],
65 ext_modules=[Extension("landscape.lib.initgroups",64 ext_modules=[Extension("landscape.lib.initgroups",
66 ["landscape/lib/initgroups.c"])]65 ["landscape/lib/initgroups.c"])])
67 )

Subscribers

People subscribed via source and target branches

to all changes: