Merge lp:~jamesodhunt/ubuntu/natty/upstart/proposed-stage2 into lp:ubuntu/natty/upstart

Proposed by James Hunt
Status: Merged
Merged at revision: 1304
Proposed branch: lp:~jamesodhunt/ubuntu/natty/upstart/proposed-stage2
Merge into: lp:ubuntu/natty/upstart
Diff against target: 491 lines (+162/-86)
8 files modified
ChangeLog (+12/-0)
NEWS (+5/-0)
configure.ac (+1/-1)
debian/changelog (+21/-0)
debian/manpages/upstart-events.7 (+73/-66)
init/tests/test_control.c (+4/-1)
po/upstart.pot (+2/-2)
scripts/initctl2dot.py (+44/-16)
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/natty/upstart/proposed-stage2
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+54718@code.launchpad.net

Description of the change

* debian/manpages/upstart-events.7:
  - Corrected reference to Upstart man page (actually init).
  - Changed to using proper troff quotes.
  - Escaped dashes in event names.
  - Updated date.
  - Table 1:
    - Improved name.
    - Sorted columns: Events, References, and Notes.
    - Added unmounted-remote-filesystems event.
* init/tests/test_control.c: Added comment.
* scripts/initctl2dot.py: Fixes to handle 'emits' glob syntax:
  - header(): Change default node to be an event to simplify handling
    globs in 'emits' stanzas.
  - footer(): Updated for glob event nodes.
  - sanitize(): Protect against glob syntax.
  - show_event(): Update for glob event nodes.
  - show_job(): Explicit specification of record node.
  - show_edges(): Handle 'emits' glob syntax.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2011-03-15 16:18:21 +0000
+++ ChangeLog 2011-03-24 16:01:02 +0000
@@ -1,3 +1,15 @@
12011-03-24 James Hunt <james.hunt@ubuntu.com>
2
3 * init/tests/test_control.c: Added comment.
4 * scripts/initctl2dot.py: Fixes to handle 'emits' glob syntax:
5 - header(): Change default node to be an event to simplify handling
6 globs in 'emits' stanzas.
7 - footer(): Updated for glob event nodes.
8 - sanitize(): Protect against glob syntax.
9 - show_event(): Update for glob event nodes.
10 - show_job(): Explicit specification of record node.
11 - show_edges(): Handle 'emits' glob syntax.
12
12011-03-15 James Hunt <james.hunt@ubuntu.com>132011-03-15 James Hunt <james.hunt@ubuntu.com>
214
3 * configure.ac: Bump version to 0.9.3.15 * configure.ac: Bump version to 0.9.3.
416
=== modified file 'NEWS'
--- NEWS 2011-03-15 12:15:28 +0000
+++ NEWS 2011-03-24 16:01:02 +0000
@@ -1,3 +1,8 @@
10.9.4 2011-03-24
2
3 * scripts/initctl2dot.py: Fix to handle 'emits' glob syntax
4 which was causing script to fail for upstart-udev-bridge.
5
10.9.3 2011-03-1560.9.3 2011-03-15
27
3 * Added missing emits stanzas for supplied .conf files.8 * Added missing emits stanzas for supplied .conf files.
49
=== modified file 'configure.ac'
--- configure.ac 2011-03-15 12:15:28 +0000
+++ configure.ac 2011-03-24 16:01:02 +0000
@@ -1,7 +1,7 @@
1# Process this file with autoconf to produce a configure script.1# Process this file with autoconf to produce a configure script.
22
3AC_PREREQ(2.61)3AC_PREREQ(2.61)
4AC_INIT([upstart], [0.9.3], [upstart-devel@lists.ubuntu.com])4AC_INIT([upstart], [0.9.4], [upstart-devel@lists.ubuntu.com])
5NIH_COPYRIGHT([[Copyright © 2011 Canonical Ltd.]])5NIH_COPYRIGHT([[Copyright © 2011 Canonical Ltd.]])
6AC_CONFIG_SRCDIR([init/main.c])6AC_CONFIG_SRCDIR([init/main.c])
7AC_CONFIG_MACRO_DIR([m4])7AC_CONFIG_MACRO_DIR([m4])
88
=== modified file 'debian/changelog'
--- debian/changelog 2011-03-15 12:15:28 +0000
+++ debian/changelog 2011-03-24 16:01:02 +0000
@@ -1,3 +1,24 @@
1upstart (0.9.4-1ubuntu1) natty; urgency=low
2
3 * debian/manpages/upstart-events.7:
4 - Corrected reference to Upstart man page (actually init).
5 - Changed to using proper troff quotes.
6 - Escaped dashes in event names.
7 - Updated date.
8 - Table 1:
9 - Improved name.
10 - Sorted columns: Events, References, and Notes.
11 - Added unmounted-remote-filesystems event.
12
13 -- James Hunt <james.hunt@ubuntu.com> Thu, 24 Mar 2011 14:34:12 +0000
14
15upstart (0.9.4-1) natty; urgency=low
16
17 * New upstream release 0.9.4:
18 - scripts/initctl2dot.py: Fixes to handle 'emits' glob syntax.
19
20 -- James Hunt <james.hunt@ubuntu.com> Thu, 24 Mar 2011 14:31:26 +0000
21
1upstart (0.9.3-1) natty; urgency=low22upstart (0.9.3-1) natty; urgency=low
223
3 * New upstream release 0.9.3:24 * New upstream release 0.9.3:
425
=== modified file 'debian/manpages/upstart-events.7'
--- debian/manpages/upstart-events.7 2011-03-04 17:17:18 +0000
+++ debian/manpages/upstart-events.7 2011-03-24 16:01:02 +0000
@@ -1,14 +1,16 @@
1'\" t1'\" t
2.TH upstart-events 7 2011-03-04 "Upstart-Events"2.TH upstart-events 7 2011-03-24 upstart
3.\"3.\"
4.SH NAME4.SH NAME
5upstart-events \- Well-known Upstart events summary5upstart-events \- Well-known Upstart events summary
6.\"6.\"
7.SH Event Summary7.SH Event Summary
88
9This manual page summarizes well-known \fBUpstart\fP(8) events. It is9This manual page summarizes well-known events generated by the Upstart
10not an exhaustive list of all possible events, but rather details a10.BR init (8)
11standard set of events expected to be generated on any Ubuntu system11daemon.
12It is not an exhaustive list of all possible events, but rather details
13a standard set of events expected to be generated on any Ubuntu system
12running Upstart.14running Upstart.
1315
14The primary table, \fBTable 1\fP, encodes the well-known events, along16The primary table, \fBTable 1\fP, encodes the well-known events, along
@@ -20,11 +22,11 @@
20The \fIRef\fP (Reference) column is used to refer to individual22The \fIRef\fP (Reference) column is used to refer to individual
21events succinctly in the \fITime\fP column.23events succinctly in the \fITime\fP column.
2224
23Note that the \'<\' and \'>\' characters in the \fITime\fP column denote25Note that the \(aq<\(aq and \(aq>\(aq characters in the \fITime\fP column denote
24that the event in the \fIEvent\fP column occurs respectively before or26that the event in the \fIEvent\fP column occurs respectively before or
25after the event specified in the \fITime\fP column (for example, the27after the event specified in the \fITime\fP column (for example, the
26\fBmounting\fP(7) event occurs "at some time" after the \fBstartup\fP(7)28\fBmounting\fP(7) event occurs "at some time" after the \fBstartup\fP(7)
27event, and the \fBvirtual-filesystems\fP(7) event occurs after the last29event, and the \fBvirtual\-filesystems\fP(7) event occurs after the last
28\fBmounted\fP(7) event relating to a virtual filesystem has been emitted).30\fBmounted\fP(7) event relating to a virtual filesystem has been emitted).
2931
30For further details on events, consult the manual pages and the job32For further details on events, consult the manual pages and the job
@@ -38,47 +40,52 @@
38.po 040.po 0
39.in 041.in 0
40.sp 142.sp 1
41\fBTable 1: Event Summary.\fP43\fBTable 1: Well-Known Event Summary.\fP
42.TS44.TS
43box, tab (@);45box, tab (@);
44c | c | c | c | c | c46c | c | c | c | c | c
45c | l | c | c | l | c.47c | l | c | c | l | c.
46Ref@Event@Type@Emit@Time@Note48Ref@Event@Type@Emit@Time@Note
47=49=
481@\fBstartup\fP(7)@S@I@Boot@A50 @\fBall\-swaps\fP@S@M@> (5)@
492@\fBmounting\fP(7)@H@M@> (1)@B51 @\fBcontrol\-alt\-delete\fP(7)@S@A@> (5)@A
503@\fBmounted\fP(7)@H@M@> associated (2)@C52 @dbus\-activation@S@B@> D\-Bus client request@
514@\fBvirtual-filesystems\fP(7)@S@M@> last virtual FS (3)@D53 @desktop\-session\-start@H@D@> \fBX\fP(7) session created@B
52 @\fBlocal-filesystems\fP(7)@S@M@> (4)@54 @drm\-device\-added@S@U@> (5)@C
53 @\fBremote-filesystems\fP(7)@S@M@> (4)@55 @\fBfilesystem\fP@S@M@After last (1)@D
54 @\fBfilesystem\fP@S@M@After last (3)@E56 @graphics\-device\-added@S@U@> (5)@C
55 @\fBall-swaps\fP@S@M@> (1)@57 @\fBkeyboard\-request\fP(7)@S@A@> (5)@E
56 @\fBcontrol-alt-delete\fP(7)@S@A@> (1)@F58 @\fBlocal\-filesystems\fP(7)@S@M@> (6)@
57 @\fBkeyboard-request\fP(7)@S@A@> (1)@G59 @login\-session\-start@H@D@< DM running@F
58 @\fBpower-status-changed\fP(7)@S@I@> (1)@H601@\fBmounted\fP(7)@H@M@> associated (2)@G
59 @\fBrunlevel\fP(7)@M@T@> (1)@612@\fBmounting\fP(7)@H@M@> (5)@H
60 @login-session-start@H@D@< DM running@I623@net\-device\-added@S@U@> (5)@C
61 @desktop-session-start@H@D@> \fBX\fP(7) session created@J63 @net\-device\-changed@S@U@> (5)@C
625@net-device-added@S@U@> (1)@K64 @net\-device\-down@S@F@< (4)@C
63 @net-device-changed@S@U@> (1)@K654@net\-device\-removed@S@U@> (5)@C
646@net-device-removed@S@U@> (1)@K66 @net\-device\-up@S@F,N@> (3)@C
65 @net-device-up@S@F,N@> (5)@K67 @\fBpower\-\%status\-\%changed\fP(7)@S@I@> (5)@I
66 @net-device-down@S@F@< (6)@K68 @\fBremote\-\%filesystems\fP(7)@S@M@> (6)@
67 @drm-device-added@S@U@> (1)@K69 @\fBrunlevel\fP(7)@M@T@> (5)@
68 @graphics-device-added@S@U@> (1)@K70 @\fBsocket\fP(7)@S@S@> socket connection@
69 @\fBstarting\fP(7)@H@I@< job starts@L715@\fBstartup\fP(7)@S@I@Boot@J
70 @\fBstarted\fP(7)@S@I@> job started@L72 @\fBstarted\fP(7)@S@I@> job started@K
71 @\fBstopping\fP(7)@H@I@< job stops@L73 @\fBstarting\fP(7)@H@I@< job starts@K
72 @\fBstopped\fP(7)@S@I@> job stopped@L74 @\fBstopped\fP(7)@S@I@> job stopped@K
73 @\fBsocket\fP(7)@S@I@> socket connection@75 @\fBstopping\fP(7)@H@I@< job stops@K
74 @dbus-activation@S@B@> D-Bus client request@76 @T{
77unmounted\-\:remote\-\:filesystems
78T}@H@V@T{
79> last remote FS unmounted
80T}@L
816@\fBvirtual\-\:filesystems\fP(7)@S@M@> last virtual FS (1)@M
75.TE82.TE
76.po \n[old_po]83.po \n[old_po]
77.in \n[old_in]84.in \n[old_in]
78.P85.P
79Key:86Key:
80 \'FS\' is an abbreviation for filesystem.87 \(aqFS\(aq is an abbreviation for filesystem.
81 \'DM\' is an abbreviation for Display Manager.88 \(aqDM\(aq is an abbreviation for Display Manager.
8289
83.\"90.\"
84.P91.P
@@ -119,15 +126,16 @@
119Ref@Emitter@Notes126Ref@Emitter@Notes
120=127=
121A@System Administrator (initiator)@Technically emitted by init(8).128A@System Administrator (initiator)@Technically emitted by init(8).
122B@\fBdbus-daemon\fP(1)@Run with "\fI--activation=upstart"\fP129B@\fBdbus\-daemon\fP(1)@Run with "\fI\-\-activation=upstart"\fP
123D@Display Manager@e.g. gdm/kdm/xdm.130D@Display Manager@e.g. gdm/kdm/xdm.
124F@\fBifup\fP(8) or \fBifdown\fP(8)@See \fI/etc/network/\fP.131F@\fBifup\fP(8) or \fBifdown\fP(8)@See \fI/etc/network/\fP.
125I@\fBinit\fP(8)@132I@\fBinit\fP(8)@
126M@\fBmountall\fP(8)@133M@\fBmountall\fP(8)@
127N@network-interface job@134N@network\-interface job@
128S@\fBupstart-socket-bridge\fP(8)@135S@\fBupstart\-socket\-bridge\fP(8)@
129T@\fBtelinit\fP(8), \fBshutdown\fP(8)@136T@\fBtelinit\fP(8), \fBshutdown\fP(8)@
130U@\fBupstart-udev-bridge\fP(8)@137U@\fBupstart\-udev\-bridge\fP(8)@
138V@System V init system@
131.TE139.TE
132.po \n[old_po]140.po \n[old_po]
133.in \n[old_in]141.in \n[old_in]
@@ -145,42 +153,41 @@
145c | l.153c | l.
146Note@Detail154Note@Detail
147=155=
148A@Initial event.156A@T{
149B@T{
150Emitted when mount attempt for single entry from \fBfstab\fP(5)
151for any filesystem type is about to begin.
152T}
153C@Generated for each mount that completes successfully.
154D@Emitted when all virtual filesystems (such as \fI/proc\fR) mounted.
155E@Note this is in the singular - there is no \'filesystems\' event.
156F@T{
157Requires administrator to press Control-Alt-Delete key157Requires administrator to press Control-Alt-Delete key
158combination on the console.158combination on the console.
159T}159T}
160G@T{160B@Event generated when user performs graphical login.
161C@T{
162These are specific examples. \fBupstart\-udev\-bridge\fP(8) will emit
163events which match the pattern, "\fIS\fP\-device\-\fIA\fP" where
164\(aqS\(aq is the udev \fIsubsystem\fP and \(aqA\(aq is the udev \fIaction\fP. See
165\fBudev\fP(7) and for further details. If you have sysfs
166mounted, you can look in \fI/sys/class/\fP for possible values for subsystem.
167T}
168D@Note this is in the singular - there is no \(aqfilesystems\(aq event.
169E@T{
161Emitted when administrator presses Alt-UpArrow key combination on170Emitted when administrator presses Alt-UpArrow key combination on
162the console.171the console.
163T}172T}
164H@Emitted when Upstart receives the SIGPWR signal.173F@T{
165I@T{
166Denotes Display Manager running (about to be displayed), but no users174Denotes Display Manager running (about to be displayed), but no users
167logged in yet.175logged in yet.
168T}176T}
169177G@Generated for each mount that completes successfully.
170J@Event generated when user performs graphical login.178H@T{
179Emitted when mount attempt for single entry from \fBfstab\fP(5)
180for any filesystem type is about to begin.
181T}
182I@Emitted when Upstart receives the SIGPWR signal.
183J@Initial event.
171K@T{184K@T{
172These are specific examples. \fBupstart-udev-bridge\fP(8) will emit
173events which match the pattern, "\fIS\fP-device-\fIA\fP" where \'S\' is
174the udev \fIsubsystem\fP and \'A\' is the udev \fIaction\fP. See
175\fBudev\fP(7) and for further details. If you have
176.BR sysfs (2)
177mounted, you can look in \fI/sys/class/\fP for possible values for subsystem.
178T}
179L@T{
180Although the events are emmitted by \fBinit\fP(8), the instigator may be185Although the events are emmitted by \fBinit\fP(8), the instigator may be
181\fBinitctl\fP(8) if a System Administrator has manually started or186\fBinitctl\fP(8) if a System Administrator has manually started or
182stopped a job.187stopped a job.
183T}188T}
189L@\fI/etc/init/umountnfs.sh\fP.
190M@Emitted when all virtual filesystems (such as \fI/proc\fR) mounted.
184.TE191.TE
185.po \n[old_po]192.po \n[old_po]
186.in \n[old_in]193.in \n[old_in]
@@ -193,7 +200,7 @@
193Upstart emits the \fBstarting\fP(7) event denoting the job is200Upstart emits the \fBstarting\fP(7) event denoting the job is
194"about to start". The \fBstarting\fP(7) event completes.201"about to start". The \fBstarting\fP(7) event completes.
195.IP \n+[step] 3202.IP \n+[step] 3
196If the \fBpre-start\fP stanza exists, the pre-start process is203If the \fBpre\-start\fP stanza exists, the pre\-start process is
197spawned.204spawned.
198.IP \n+[step] 3205.IP \n+[step] 3
199Upstart spawns the main process.206Upstart spawns the main process.
@@ -202,7 +209,7 @@
202descendent of the immediate child process if \fBexpect fork\fP or209descendent of the immediate child process if \fBexpect fork\fP or
203\fBexpect daemon\fP has been specified.210\fBexpect daemon\fP has been specified.
204.IP \n+[step] 3211.IP \n+[step] 3
205If the \fBpost-start\fP stanza exists, the post-start process is212If the \fBpost\-start\fP stanza exists, the post\-start process is
206spawned.213spawned.
207.IP \n+[step] 3214.IP \n+[step] 3
208Upstart emits the \fBstarted\fP(7) event.215Upstart emits the \fBstarted\fP(7) event.
@@ -214,7 +221,7 @@
214221
215.nr step 1 1222.nr step 1 1
216.IP \n[step] 3223.IP \n[step] 3
217If the \fBpre-stop\fP stanza exists, the pre-stop process is224If the \fBpre\-stop\fP stanza exists, the pre\-stop process is
218spawned.225spawned.
219.IP \n+[step] 3226.IP \n+[step] 3
220The main process is stopped:227The main process is stopped:
@@ -234,7 +241,7 @@
234.IP \n+[step] 3241.IP \n+[step] 3
235Upstart emits the \fBstopping\fP(7) event.242Upstart emits the \fBstopping\fP(7) event.
236.IP \n+[step] 3243.IP \n+[step] 3
237If the \fBpost-stop\fP stanza exists, the post-stop process is244If the \fBpost\-stop\fP stanza exists, the post\-stop process is
238spawned.245spawned.
239.IP \n+[step] 3246.IP \n+[step] 3
240Upstart emits the \fBstopped\fP(7) event.247Upstart emits the \fBstopped\fP(7) event.
241248
=== modified file 'init/tests/test_control.c'
--- init/tests/test_control.c 2011-02-23 09:35:03 +0000
+++ init/tests/test_control.c 2011-03-24 16:01:02 +0000
@@ -933,9 +933,12 @@
933933
934 strcpy (filename, dirname);934 strcpy (filename, dirname);
935 strcat (filename, "/baz");935 strcat (filename, "/baz");
936
937 /* XXX: note that this will generate an error message when this
938 * test runs sine "/baz" does not exist as a directory.
939 */
936 source3 = conf_source_new (NULL, filename, CONF_DIR);940 source3 = conf_source_new (NULL, filename, CONF_DIR);
937941
938
939 message = nih_new (NULL, NihDBusMessage);942 message = nih_new (NULL, NihDBusMessage);
940 message->connection = NULL;943 message->connection = NULL;
941 message->message = NULL;944 message->message = NULL;
942945
=== modified file 'po/upstart.pot'
--- po/upstart.pot 2011-03-15 16:22:27 +0000
+++ po/upstart.pot 2011-03-24 16:01:02 +0000
@@ -6,9 +6,9 @@
6#, fuzzy6#, fuzzy
7msgid ""7msgid ""
8msgstr ""8msgstr ""
9"Project-Id-Version: upstart 0.9.3\n"9"Project-Id-Version: upstart 0.9.4\n"
10"Report-Msgid-Bugs-To: new@bugs.launchpad.net\n"10"Report-Msgid-Bugs-To: new@bugs.launchpad.net\n"
11"POT-Creation-Date: 2011-03-15 14:08+0000\n"11"POT-Creation-Date: 2011-03-24 11:26+0000\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
1515
=== modified file 'scripts/initctl2dot.py'
--- scripts/initctl2dot.py 2011-03-10 14:06:37 +0000
+++ scripts/initctl2dot.py 2011-03-24 16:01:02 +0000
@@ -32,12 +32,12 @@
32# Usage:32# Usage:
33#33#
34# initctl show-config -e > initctl.out34# initctl show-config -e > initctl.out
35# initctl2dot.py -f initctl.out -o upstart.dot35# initctl2dot -f initctl.out -o upstart.dot
36# dot -Tpng -o upstart.png upstart.dot36# dot -Tpng -o upstart.png upstart.dot
37#37#
38# Or more simply:38# Or more simply:
39#39#
40# initctl2dot.py -o - | dot -Tpng -o upstart.png40# initctl2dot -o - | dot -Tpng -o upstart.png
41#41#
42# See also:42# See also:
43#43#
@@ -48,6 +48,7 @@
4848
49import sys49import sys
50import re50import re
51import fnmatch
51import os52import os
52from string import split53from string import split
53import datetime54import datetime
@@ -78,12 +79,15 @@
78def header(ofh):79def header(ofh):
79 global options80 global options
8081
81 str = "digraph upstart {"82 str = "digraph upstart {\n"
82 str += " node [shape=record];"83
83 str += " rankdir=LR;"84 # make the default node an event to simplify glob code
84 str += " overlap=false;"85 str += " node [shape=\"diamond\", fontcolor=\"%s\", fillcolor=\"%s\", style=\"filled\"];\n" \
85 str += " bgcolor=\"%s\";" % options.color_bg86 % (options.color_event_text, options.color_event)
86 str += " fontcolor=\"%s\";" % options.color_text87 str += " rankdir=LR;\n"
88 str += " overlap=false;\n"
89 str += " bgcolor=\"%s\";\n" % options.color_bg
90 str += " fontcolor=\"%s\";\n" % options.color_text
8791
88 ofh.write(str)92 ofh.write(str)
8993
@@ -107,11 +111,12 @@
107 (cmd, os.uname()[1])111 (cmd, os.uname()[1])
108112
109 epilog += "Boxes of color %s denote jobs.\\n" % options.color_job113 epilog += "Boxes of color %s denote jobs.\\n" % options.color_job
110 epilog += "Diamonds of color %s denote events.\\n" % options.color_event114 epilog += "Solid diamonds of color %s denote events.\\n" % options.color_event
115 epilog += "Dotted diamonds denote 'glob' events.\\n"
111 epilog += "Emits denoted by %s lines.\\n" % options.color_emits116 epilog += "Emits denoted by %s lines.\\n" % options.color_emits
112 epilog += "Start on denoted by %s lines.\\n" % options.color_start_on117 epilog += "Start on denoted by %s lines.\\n" % options.color_start_on
113 epilog += "Stop on denoted by %s lines.\\n" % options.color_stop_on118 epilog += "Stop on denoted by %s lines.\\n" % options.color_stop_on
114 epilog += "\";"119 epilog += "\";\n"
115 epilog += "}\n"120 epilog += "}\n"
116 ofh.write(epilog)121 ofh.write(epilog)
117122
@@ -121,7 +126,7 @@
121def sanitise(s):126def sanitise(s):
122 return s.replace('-', '_').replace('$', 'dollar_').replace('[', \127 return s.replace('-', '_').replace('$', 'dollar_').replace('[', \
123 'lbracket').replace(']', 'rbracket').replace('!', \128 'lbracket').replace(']', 'rbracket').replace('!', \
124 'bang').replace(':', '_')129 'bang').replace(':', '_').replace('*', 'star').replace('?', 'question')
125130
126131
127# Convert a dollar in @name to a unique-ish new name, based on @job and132# Convert a dollar in @name to a unique-ish new name, based on @job and
@@ -148,10 +153,17 @@
148153
149def show_event(ofh, name):154def show_event(ofh, name):
150 global options155 global options
151 ofh.write("""156 str = "%s [label=\"%s\", shape=diamond, fontcolor=\"%s\", fillcolor=\"%s\"," % \
152 %s [label=\"%s\", shape=diamond, fontcolor=\"%s\", fillcolor=\"%s\", style=\"filled\"];157 (mk_event_node_name(name), name, options.color_event_text, options.color_event)
153 """ % (mk_event_node_name(name), name, options.color_event_text, options.color_event))158
154159 if '*' in name:
160 str += " style=\"dotted\""
161 else:
162 str += " style=\"filled\""
163
164 str += "];\n"
165
166 ofh.write(str)
155167
156def show_events(ofh):168def show_events(ofh):
157 global events169 global events
@@ -193,7 +205,7 @@
193 global options205 global options
194206
195 ofh.write("""207 ofh.write("""
196 %s [label=\"<job> %s | { <start> start on | <stop> stop on }\", fontcolor=\"%s\", style=\"filled\", fillcolor=\"%s\"];208 %s [shape=\"record\", label=\"<job> %s | { <start> start on | <stop> stop on }\", fontcolor=\"%s\", style=\"filled\", fillcolor=\"%s\"];
197 """ % (mk_job_node_name(name), name, options.color_job_text, options.color_job))209 """ % (mk_job_node_name(name), name, options.color_job_text, options.color_job))
198210
199211
@@ -288,6 +300,8 @@
288 global options300 global options
289 global restrictions_list301 global restrictions_list
290302
303 glob_jobs = {}
304
291 if restrictions_list:305 if restrictions_list:
292 jobs_list = restrictions_list306 jobs_list = restrictions_list
293 else:307 else:
@@ -308,6 +322,14 @@
308 show_stop_on_event_edge(ofh, job, s)322 show_stop_on_event_edge(ofh, job, s)
309323
310 for e in jobs[job]['emits']:324 for e in jobs[job]['emits']:
325 if '*' in e:
326 # handle glob patterns in 'emits'
327 glob_events = []
328 for _e in events:
329 if e != _e and fnmatch.fnmatch(_e, e):
330 glob_events.append(_e)
331 glob_jobs[job] = glob_events
332
311 show_job_emits_edge(ofh, job, e)333 show_job_emits_edge(ofh, job, e)
312334
313 if not restrictions_list:335 if not restrictions_list:
@@ -325,6 +347,12 @@
325 for e in jobs[j]['emits']:347 for e in jobs[j]['emits']:
326 show_job_emits_edge(ofh, j, e)348 show_job_emits_edge(ofh, j, e)
327349
350 # Create links from jobs (which advertise they emits a class of
351 # events, via the glob syntax) to all the events they create.
352 for g in glob_jobs:
353 for ge in glob_jobs[g]:
354 show_job_emits_edge(ofh, g, ge)
355
328 if not restrictions_list:356 if not restrictions_list:
329 return357 return
330358

Subscribers

People subscribed via source and target branches

to all changes: