Ubuntu

Merge lp:~jamesodhunt/ubuntu/natty/vim/add-upstart-syntax into lp:ubuntu/natty/vim

Proposed by James Hunt on 2011-03-07
Status: Merged
Merge reported by: Colin Watson
Merged at revision: not available
Proposed branch: lp:~jamesodhunt/ubuntu/natty/vim/add-upstart-syntax
Merge into: lp:ubuntu/natty/vim
Diff against target: 130 lines (+107/-0) 3 files modified
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/natty/vim/add-upstart-syntax
Reviewer Review Type Date Requested Status
Colin Watson 2011-03-07 Approve on 2011-03-08
Dave Walker Needs Fixing on 2011-03-07
Review via email: mp+52440@code.launchpad.net

Description of the Change

* runtime/syntax/upstart.vim: New syntax file for Upstart.
* runtime/filetype.vim: Updated to recognise Upstart configuration
  files.

To post a comment you must log in.
Dave Walker (davewalker) wrote :

Oooo, nice addition.

Annoyingly, the package it's been based against isn't the latest version in natty. It seems lp:ubuntu/natty failed to import successfully, and is therefore outdated.

The latest version in Natty is currently, 2:7.3.035+hg~8fdc12103333-1ubuntu3. If one of the package-import maintainers can fix this, it shouldn't be too bad to rebase this branch.

I would suggest submitting this to Debian, as I'm sure the feature will be useful there - and will avoid increasing the delta next merge.

Would you consider this patch a new feature?

review: Needs Fixing
Colin Watson (cjwatson) wrote :

I've run into the package-import problem with vim before, and have generally just been doing uploads outside branches for the time being. I'm happy to do so again for this change, and will handle the rebasing.

You certainly should submit this to Debian. Relevant resources:

  http://www.debian.org/Bugs/Reporting
  https://wiki.ubuntu.com/Debian/Usertagging

While I suppose this is technically a feature, I don't think there's any need to worry about it with respect to feature freeze. It's pretty unlikely to break anything.

review: Approve

Preview Diff

1=== modified file 'debian/changelog'
2--- debian/changelog 2010-03-08 22:08:26 +0000
3+++ debian/changelog 2011-03-07 17:37:35 +0000
4@@ -1,3 +1,11 @@
5+vim (2:7.2.330-1ubuntu3) natty; urgency=low
6+
7+ * runtime/syntax/upstart.vim: New syntax file for Upstart.
8+ * runtime/filetype.vim: Updated to recognise Upstart configuration
9+ files.
10+
11+ -- James Hunt <james.hunt@ubuntu.com> Mon, 07 Mar 2011 17:27:39 +0000
12+
13 vim (2:7.2.330-1ubuntu2) lucid; urgency=low
14
15 * debian/rules: Temporarily disable parallel building until we figure out
16
17=== modified file 'runtime/filetype.vim'
18--- runtime/filetype.vim 2010-03-07 11:44:45 +0000
19+++ runtime/filetype.vim 2011-03-07 17:37:35 +0000
20@@ -113,6 +113,10 @@
21 au BufNewFile,BufRead .htaccess,/etc/httpd/*.conf setf apache
22 au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/apache2/*.conf*,/etc/httpd/conf.d/*.conf* call s:StarSetf('apache')
23
24+" Upstart (init(8)) config files
25+au BufNewFile,BufRead /etc/init/*.conf setf upstart
26+au BufNewFile,BufRead /etc/init/*.override setf upstart
27+
28 " XA65 MOS6510 cross assembler
29 au BufNewFile,BufRead *.a65 setf a65
30
31
32=== added file 'runtime/syntax/upstart.vim'
33--- runtime/syntax/upstart.vim 1970-01-01 00:00:00 +0000
34+++ runtime/syntax/upstart.vim 2011-03-07 17:37:35 +0000
35@@ -0,0 +1,95 @@
36+" Vim syntax file
37+" Language: Upstart job files
38+" Maintainer: Michael Biebl <biebl@debian.org>
39+" James Hunt <james.hunt@ubuntu.com>
40+" Last Change: 2011 Mar 7
41+" License: GPL v2
42+" Version: 0.2
43+" Remark: Syntax highlighting for Upstart (init(8)) job files.
44+"
45+" It is inspired by the initng syntax file and includes sh.vim to do the
46+" highlighting of script blocks.
47+
48+if version < 600
49+ syntax clear
50+elseif exists("b:current_syntax")
51+ finish
52+endif
53+
54+let is_bash = 1
55+"unlet! b:current_syntax
56+syn include @Shell syntax/sh.vim
57+
58+syn case match
59+
60+syn match upstartComment /#.*$/ contains=upstartTodo
61+syn keyword upstartTodo TODO FIXME contained
62+
63+syn region upstartString start=/"/ end=/"/ skip=/\\"/
64+
65+syn region upstartScript matchgroup=upstartStatement start="script" end="end script" contains=@upstartShellCluster
66+
67+syn cluster upstartShellCluster contains=@Shell
68+
69+" one argument
70+syn keyword upstartStatement description author version
71+syn keyword upstartStatement pid kill normal console env umask nice limit chroot chdir exec
72+
73+" one or more arguments (events)
74+syn keyword upstartStatement emits
75+
76+syn keyword upstartStatement on start stop
77+
78+" flag, no parameter
79+syn keyword upstartStatement daemon respawn service instance manual
80+
81+" prefix for exec or script
82+syn keyword upstartOption pre-start post-start pre-stop post-stop
83+
84+" options for pid
85+syn keyword upstartOption file binary timeout
86+" option for
87+syn keyword upstartOption timeout
88+" option for respawn
89+syn keyword upstartOption limit
90+" options for console
91+syn keyword upstartOption logged output owner none
92+
93+" Upstart itself and associated utilities
94+syn keyword upstartEvent runlevel
95+syn keyword upstartEvent started
96+syn keyword upstartEvent starting
97+syn keyword upstartEvent startup
98+syn keyword upstartEvent stopped
99+syn match upstartEvent /control-alt-delete/
100+syn match upstartEvent /keyboard-request/
101+syn match upstartEvent /power-status-changed/
102+
103+" dbus
104+syn match upstartEvent /dbus-activation/
105+
106+" Display Manager (ie gdm)
107+syn match upstartEvent /desktop-session-start/
108+syn match upstartEvent /login-session-start/
109+
110+" mountall
111+syn keyword upstartEvent filesystem
112+syn keyword upstartEvent mounted
113+syn keyword upstartEvent mounting
114+syn match upstartEvent /\(\<local\>\|\<virtual\>\|\<remote\>\)-filesystems/
115+syn match upstartEvent /all-swaps/
116+
117+" upstart-udev-bridge and ifup/down
118+syn match upstartEvent /\<[^-]\{-1,}-device-\(\<added\>\|\<removed\>\|\<up\>\|\<down\>\)/
119+
120+" upstart-socket-bridge
121+syn keyword upstartEvent socket
122+
123+hi def link upstartComment Comment
124+hi def link upstartTodo Todo
125+hi def link upstartString String
126+hi def link upstartStatement Statement
127+hi def link upstartOption Type
128+hi def link upstartEvent Define
129+
130+let b:current_syntax = "upstart"

Subscribers

People subscribed via source and target branches

to all changes: