Merge lp:~ted/ubuntu-app-launch/session-bus into lp:ubuntu-app-launch/14.04

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 91
Merged at revision: 89
Proposed branch: lp:~ted/ubuntu-app-launch/session-bus
Merge into: lp:ubuntu-app-launch/14.04
Diff against target: 112 lines (+7/-39)
4 files modified
debian/control (+2/-0)
libupstart-app-launch/upstart-app-launch.c (+4/-36)
test-conffile.sh (+1/-1)
tests/libual-test.cc (+0/-2)
To merge this branch: bzr merge lp:~ted/ubuntu-app-launch/session-bus
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+196549@code.launchpad.net

Commit message

Use Upstart on the session bus instead of the private bus

Description of the change

Upstart 1.11 connects to the session bus so we can use it there without having another connection. Way better. Let's do that!

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
91. By Ted Gould

Upstart only has two numbers

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

WfM on the phone, and it's always nice to drop out pieces of code. :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-11-19 03:35:22 +0000
3+++ debian/control 2013-11-25 16:27:39 +0000
4@@ -17,6 +17,7 @@
5 libupstart-dev,
6 libzeitgeist-2.0-dev,
7 python3-dbusmock,
8+ upstart (>= 1.11),
9 Standards-Version: 3.9.4
10 Homepage: http://launchpad.net/upstart-app-launch
11 # If you aren't a member of ~indicator-applet-developers but need to upload packaging changes,
12@@ -30,6 +31,7 @@
13 ${misc:Depends},
14 click (>= 0.4.9),
15 click-apparmor,
16+ upstart (>= 1.11),
17 zeitgeist,
18 Description: Upstart Job for Launching Applications
19 Upstart Job file and associated utilities that is used to launch
20
21=== modified file 'libupstart-app-launch/upstart-app-launch.c'
22--- libupstart-app-launch/upstart-app-launch.c 2013-11-19 02:56:47 +0000
23+++ libupstart-app-launch/upstart-app-launch.c 2013-11-25 16:27:39 +0000
24@@ -34,26 +34,11 @@
25 DBusConnection * conn;
26 DBusError error;
27 const gchar * bus_name = NULL;
28- gboolean use_private = FALSE;
29
30 dbus_error_init(&error);
31- use_private = (g_getenv("UPSTART_APP_LAUNCH_USE_SESSION") == NULL);
32-
33- if (use_private) {
34- const gchar * upstart_session;
35-
36- upstart_session = g_getenv("UPSTART_SESSION");
37- if (upstart_session == NULL) {
38- g_warning("Not running under Upstart User Session");
39- dbus_error_free(&error);
40- return NULL;
41- }
42-
43- conn = dbus_connection_open(upstart_session, &error);
44- } else {
45- conn = dbus_bus_get(DBUS_BUS_SESSION, &error);
46- bus_name = "com.ubuntu.Upstart";
47- }
48+
49+ conn = dbus_bus_get(DBUS_BUS_SESSION, &error);
50+ bus_name = "com.ubuntu.Upstart";
51
52 if (conn == NULL) {
53 g_warning("Unable to connect to the Upstart Session: %s", error.message);
54@@ -70,8 +55,6 @@
55
56 if (upstart == NULL) {
57 g_warning("Unable to build proxy to Upstart");
58- if (use_private)
59- dbus_connection_close(conn);
60 dbus_connection_unref(conn);
61 return NULL;
62 }
63@@ -251,22 +234,7 @@
64 }
65
66 GError * error = NULL;
67-
68- if (g_getenv("UPSTART_APP_LAUNCH_USE_SESSION") == NULL) {
69- const gchar * upstart_addr = g_getenv("UPSTART_SESSION");
70- if (upstart_addr == NULL) {
71- g_print("Doesn't appear to be an upstart user session\n");
72- return NULL;
73- }
74-
75- gdbus_upstart = g_dbus_connection_new_for_address_sync(upstart_addr,
76- G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT,
77- NULL, /* auth */
78- NULL, /* cancel */
79- &error);
80- } else {
81- gdbus_upstart = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
82- }
83+ gdbus_upstart = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
84
85 if (error != NULL) {
86 g_warning("Unable to connect to Upstart bus: %s", error->message);
87
88=== modified file 'test-conffile.sh'
89--- test-conffile.sh 2013-07-02 17:17:08 +0000
90+++ test-conffile.sh 2013-11-25 16:27:39 +0000
91@@ -5,7 +5,7 @@
92 # Only test on newer versions of Upstart, like not the
93 # versions on the builders
94 if [ ${UPSTARTVERSION} -gt 7 ] ; then
95- init-checkconf $1
96+ dbus-test-runner --task init-checkconf --parameter "$1" --task-name init-checkconf
97 else
98 echo "Upstart Version: $UPSTARTVERSION"
99 echo " ....Skipping Tests"
100
101=== modified file 'tests/libual-test.cc'
102--- tests/libual-test.cc 2013-11-19 03:02:31 +0000
103+++ tests/libual-test.cc 2013-11-25 16:27:39 +0000
104@@ -48,8 +48,6 @@
105 }
106
107 virtual void SetUp() {
108- g_setenv("UPSTART_APP_LAUNCH_USE_SESSION", "1", TRUE);
109-
110 service = dbus_test_service_new(NULL);
111
112 debugConnection();

Subscribers

People subscribed via source and target branches