Merge lp:~ted/upstart/obj-path into lp:upstart

Proposed by Ted Gould on 2013-08-30
Status: Merged
Approved by: Steve Langasek on 2013-09-01
Approved revision: 1528
Merged at revision: 1527
Proposed branch: lp:~ted/upstart/obj-path
Merge into: lp:upstart
Diff against target: 33 lines (+3/-3)
2 files modified
extra/man/dbus-event.7 (+2/-2)
extra/upstart-dbus-bridge.c (+1/-1)
To merge this branch: bzr merge lp:~ted/upstart/obj-path
Reviewer Review Type Date Requested Status
Steve Langasek 2013-08-30 Approve on 2013-09-01
Review via email: mp+183259@code.launchpad.net

Commit message

Change dbus object path from PATH to OBJPATH

Description of the change

With dbus events one of the environment variables is PATH. Which makes sense as it is the path to the object emitting the signal. But, unfortunately it overrides the perhaps more common use of PATH, to say where to find binaries. This makes it very hard to have scripts in a job that is listening on dbus events. I'm suggesting we change it to OBJPATH. While I realize this is an interface change, I think that it might effect few enough people, and all of them will like it, that it would be worth it.

To post a comment you must log in.
Steve Langasek (vorlon) wrote :

Obviously correct that we should not be overriding the special variable name "PATH" with something here. This breaks compatibility, but the current behavior is sufficiently wrong that I don't think we need to worry about preserving compatibility.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'extra/man/dbus-event.7'
2--- extra/man/dbus-event.7 2013-07-24 09:22:25 +0000
3+++ extra/man/dbus-event.7 2013-08-30 19:37:14 +0000
4@@ -8,7 +8,7 @@
5 .BI [ "" BUS\fR= BUS_NAME ]
6 .BI SIGNAL\fR= SIGNAL
7 .BI INTERFACE\fR= INTERFACE
8-.BI PATH\fR= PATH
9+.BI OBJPATH\fR= PATH
10 .BI SENDER\fR= SENDER
11 .BI DESTINATION\fR= DESTINATION
12 .BI ARG0\fR= VALUE
13@@ -43,7 +43,7 @@
14 .\"
15 .SH EXAMPLES
16 .\"
17-.IP "start on dbus SIGNAL=NameAcquired INTERFACE=org.freedesktop.DBus PATH=/org/freedesktop/DBus SENDER=org.freedesktop.DBus ARG0=com.mycorp.foo"
18+.IP "start on dbus SIGNAL=NameAcquired INTERFACE=org.freedesktop.DBus OBJPATH=/org/freedesktop/DBus SENDER=org.freedesktop.DBus ARG0=com.mycorp.foo"
19 Start job when a particular
20 .I NameAcquired
21 D-Bus signal is received.
22
23=== modified file 'extra/upstart-dbus-bridge.c'
24--- extra/upstart-dbus-bridge.c 2013-07-24 09:40:15 +0000
25+++ extra/upstart-dbus-bridge.c 2013-08-30 19:37:14 +0000
26@@ -513,7 +513,7 @@
27
28 if (path) {
29 nih_local char *var = NULL;
30- var = NIH_MUST (nih_sprintf (NULL, "PATH=%s", path));
31+ var = NIH_MUST (nih_sprintf (NULL, "OBJPATH=%s", path));
32 NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var));
33 }
34

Subscribers

People subscribed via source and target branches