puppet 0.24.4 → 0.24.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CHANGELOG +170 -0
- data/Rakefile +6 -4
- data/bin/filebucket +3 -2
- data/bin/puppet +7 -4
- data/bin/puppetca +32 -14
- data/bin/puppetd +12 -34
- data/bin/puppetmasterd +3 -2
- data/bin/puppetrun +5 -43
- data/bin/ralsh +2 -2
- data/conf/debian/README.source +2 -0
- data/conf/debian/TODO.Debian +1 -0
- data/conf/debian/changelog +257 -0
- data/conf/debian/compat +1 -0
- data/conf/debian/control +45 -0
- data/conf/debian/copyright +17 -0
- data/conf/debian/docs +1 -0
- data/conf/debian/fileserver.conf +12 -0
- data/conf/debian/puppet.NEWS +63 -0
- data/conf/debian/puppet.conf +8 -0
- data/conf/debian/puppet.dirs +7 -0
- data/conf/debian/puppet.files +6 -0
- data/conf/debian/puppet.init +64 -0
- data/conf/debian/puppet.logrotate +11 -0
- data/conf/debian/puppet.postinst +9 -0
- data/conf/debian/puppet.postrm +21 -0
- data/conf/debian/puppet.preinst +25 -0
- data/conf/debian/puppetmaster.files +4 -0
- data/conf/debian/puppetmaster.init +58 -0
- data/conf/debian/rules +115 -0
- data/conf/debian/watch +2 -0
- data/conf/gentoo/init.d/puppet +1 -1
- data/conf/gentoo/init.d/puppetmaster +32 -31
- data/conf/redhat/client.init +10 -2
- data/conf/redhat/puppet.spec +4 -1
- data/conf/redhat/server.init +9 -1
- data/examples/{code/allatonce → allatonce} +0 -0
- data/examples/{code/assignments → assignments} +0 -0
- data/examples/{code/components → components} +0 -0
- data/examples/{root/etc → etc}/init.d/sleeper +0 -0
- data/examples/{root/etc → etc}/otherfile +0 -0
- data/examples/{root/etc → etc}/puppet/fileserver.conf +0 -0
- data/examples/{root/etc → etc}/puppet/namespaceauth.conf +0 -0
- data/examples/{root/etc → etc}/puppet/puppet.conf +0 -0
- data/examples/{root/etc → etc}/puppet/tagmail.conf +0 -0
- data/examples/{code/execs → execs} +0 -0
- data/examples/{code/file.bl → file.bl} +0 -0
- data/examples/{code/filedefaults → filedefaults} +0 -0
- data/examples/{code/fileparsing → fileparsing} +0 -0
- data/examples/{code/filerecursion → filerecursion} +0 -0
- data/examples/{code/functions → functions} +0 -0
- data/examples/{code/groups → groups} +0 -0
- data/examples/{code/head → head} +0 -0
- data/examples/{code/importing → importing} +0 -0
- data/examples/{code/mac_automount.pp → mac_automount.pp} +0 -0
- data/examples/{code/mac_dscl.pp → mac_dscl.pp} +0 -0
- data/examples/{code/mac_dscl_revert.pp → mac_dscl_revert.pp} +0 -0
- data/examples/{code/mac_netinfo.pp → mac_netinfo.pp} +0 -0
- data/examples/{code/mac_pkgdmg.pp → mac_pkgdmg.pp} +0 -0
- data/examples/{code/modules → modules}/sample-module.pp +0 -0
- data/examples/{code/modules → modules}/sample-module/README.txt +0 -0
- data/examples/{code/modules → modules}/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +0 -0
- data/examples/{code/modules → modules}/sample-module/manifests/init.pp +0 -0
- data/examples/{code/modules → modules}/sample-module/templates/sample.erb +0 -0
- data/examples/{code/nodes → nodes} +0 -0
- data/examples/{code/one → one} +0 -0
- data/examples/{code/relationships → relationships} +0 -0
- data/examples/{code/selectors → selectors} +0 -0
- data/examples/{code/simpletests → simpletests} +0 -0
- data/examples/{code/svncommit → svncommit} +0 -0
- data/ext/autotest/Rakefile +8 -0
- data/ext/autotest/config +43 -0
- data/ext/autotest/readme.rst +16 -0
- data/{examples/root → ext}/bin/sleeper +1 -1
- data/ext/emacs/puppet-mode.el +246 -184
- data/ext/ldap/puppet.schema +7 -2
- data/ext/module_puppet +4 -3
- data/ext/nagios/check_puppet.rb +117 -0
- data/ext/puppetlast +40 -0
- data/install.rb +12 -3
- data/lib/puppet.rb +1 -44
- data/lib/puppet/defaults.rb +23 -10
- data/lib/puppet/dsl.rb +2 -2
- data/lib/puppet/executables/client/certhandler.rb +77 -0
- data/lib/puppet/external/nagios.rb +1 -1
- data/lib/puppet/external/nagios/base.rb +60 -46
- data/lib/puppet/file_serving/indirection_hooks.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +0 -9
- data/lib/puppet/file_serving/terminus_helper.rb +4 -4
- data/lib/puppet/indirector.rb +26 -28
- data/lib/puppet/indirector/catalog/compiler.rb +6 -28
- data/lib/puppet/indirector/checksum/file.rb +2 -2
- data/lib/puppet/indirector/direct_file_server.rb +7 -7
- data/lib/puppet/indirector/envelope.rb +13 -0
- data/lib/puppet/indirector/exec.rb +2 -2
- data/lib/puppet/indirector/facts/facter.rb +2 -2
- data/lib/puppet/indirector/file.rb +17 -14
- data/lib/puppet/indirector/file_metadata/file.rb +2 -2
- data/lib/puppet/indirector/file_server.rb +14 -14
- data/lib/puppet/indirector/indirection.rb +113 -48
- data/lib/puppet/indirector/ldap.rb +13 -25
- data/lib/puppet/indirector/memory.rb +7 -7
- data/lib/puppet/indirector/module_files.rb +14 -14
- data/lib/puppet/indirector/node/exec.rb +3 -10
- data/lib/puppet/indirector/node/ldap.rb +138 -41
- data/lib/puppet/indirector/node/plain.rb +1 -8
- data/lib/puppet/indirector/node/rest.rb +1 -1
- data/lib/puppet/indirector/plain.rb +2 -2
- data/lib/puppet/indirector/report/processor.rb +2 -2
- data/lib/puppet/indirector/request.rb +42 -0
- data/lib/puppet/indirector/rest.rb +51 -3
- data/lib/puppet/indirector/terminus.rb +0 -27
- data/lib/puppet/indirector/yaml.rb +12 -17
- data/lib/puppet/metatype/attributes.rb +3 -7
- data/lib/puppet/metatype/evaluation.rb +2 -2
- data/lib/puppet/module.rb +6 -2
- data/lib/puppet/network/client/master.rb +29 -81
- data/lib/puppet/network/handler/master.rb +12 -43
- data/lib/puppet/network/http.rb +8 -6
- data/lib/puppet/network/http/handler.rb +42 -32
- data/lib/puppet/network/http/mongrel.rb +8 -9
- data/lib/puppet/network/http/mongrel/rest.rb +42 -15
- data/lib/puppet/network/http/webrick.rb +27 -16
- data/lib/puppet/network/http/webrick/rest.rb +38 -14
- data/lib/puppet/network/http_pool.rb +3 -2
- data/lib/puppet/network/server.rb +24 -22
- data/lib/puppet/network/xmlrpc/client.rb +6 -1
- data/lib/puppet/node.rb +38 -79
- data/lib/puppet/node/catalog.rb +9 -0
- data/lib/puppet/node/facts.rb +9 -1
- data/lib/puppet/parser/ast/function.rb +1 -1
- data/lib/puppet/parser/collector.rb +6 -0
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions.rb +25 -1
- data/lib/puppet/parser/interpreter.rb +2 -17
- data/lib/puppet/parser/parser.rb +4 -4
- data/lib/puppet/parser/parser_support.rb +6 -2
- data/lib/puppet/parser/resource.rb +6 -0
- data/lib/puppet/parser/templatewrapper.rb +9 -0
- data/lib/puppet/pgraph.rb +1 -1
- data/lib/puppet/property.rb +0 -1
- data/lib/puppet/provider.rb +9 -95
- data/lib/puppet/provider/confine.rb +77 -0
- data/lib/puppet/provider/confine/exists.rb +22 -0
- data/lib/puppet/provider/confine/false.rb +19 -0
- data/lib/puppet/provider/confine/feature.rb +17 -0
- data/lib/puppet/provider/confine/true.rb +20 -0
- data/lib/puppet/provider/confine/variable.rb +42 -0
- data/lib/puppet/provider/confine_collection.rb +47 -0
- data/lib/puppet/provider/confiner.rb +20 -0
- data/lib/puppet/provider/cron/crontab.rb +6 -2
- data/lib/puppet/provider/group/groupadd.rb +1 -1
- data/lib/puppet/provider/group/ldap.rb +48 -0
- data/lib/puppet/provider/ldap.rb +137 -0
- data/lib/puppet/provider/nameservice.rb +1 -2
- data/lib/puppet/provider/nameservice/objectadd.rb +2 -5
- data/lib/puppet/provider/package/dpkg.rb +16 -1
- data/lib/puppet/provider/package/freebsd.rb +15 -4
- data/lib/puppet/provider/package/gem.rb +33 -12
- data/lib/puppet/provider/package/pkgdmg.rb +1 -60
- data/lib/puppet/provider/package/ports.rb +6 -1
- data/lib/puppet/provider/package/rpm.rb +14 -13
- data/lib/puppet/provider/package/urpmi.rb +3 -3
- data/lib/puppet/provider/service/base.rb +4 -4
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +5 -3
- data/lib/puppet/provider/service/redhat.rb +35 -7
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +69 -0
- data/lib/puppet/provider/user/ldap.rb +133 -0
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +14 -14
- data/lib/puppet/rails/database/schema.rb +9 -0
- data/lib/puppet/rails/resource.rb +1 -0
- data/lib/puppet/reference/providers.rb +8 -2
- data/lib/puppet/reference/report.rb +23 -0
- data/lib/puppet/reports/rrdgraph.rb +4 -2
- data/lib/puppet/sslcertificates/ca.rb +9 -4
- data/lib/puppet/sslcertificates/support.rb +26 -2
- data/lib/puppet/transaction.rb +11 -16
- data/lib/puppet/transaction/change.rb +94 -0
- data/lib/puppet/transaction/event.rb +21 -0
- data/lib/puppet/transaction/report.rb +4 -0
- data/lib/puppet/type.rb +0 -2
- data/lib/puppet/type/file/ensure.rb +0 -5
- data/lib/puppet/type/file/group.rb +13 -7
- data/lib/puppet/type/file/source.rb +8 -15
- data/lib/puppet/type/file/target.rb +2 -0
- data/lib/puppet/type/group.rb +1 -1
- data/lib/puppet/type/mount.rb +4 -2
- data/lib/puppet/type/nagios_hostescalation.rb +3 -0
- data/lib/puppet/type/nagios_servicegroup.rb +3 -0
- data/lib/puppet/type/ssh_authorized_key.rb +56 -0
- data/lib/puppet/type/user.rb +3 -0
- data/lib/puppet/type/yumrepo.rb +0 -1
- data/lib/puppet/util.rb +1 -1
- data/lib/puppet/util/ldap.rb +5 -0
- data/lib/puppet/util/ldap/connection.rb +69 -0
- data/lib/puppet/util/ldap/generator.rb +45 -0
- data/lib/puppet/util/ldap/manager.rb +281 -0
- data/lib/puppet/util/posix.rb +2 -2
- data/lib/puppet/util/resource_template.rb +61 -0
- data/lib/puppet/util/settings.rb +63 -3
- data/lib/puppet/util/storage.rb +4 -0
- data/lib/puppet/util/warnings.rb +7 -0
- data/man/man8/filebucket.8 +116 -0
- data/man/man8/pi.8 +34 -0
- data/man/man8/puppet.8 +78 -0
- data/man/man8/puppet.conf.8 +1747 -0
- data/man/man8/puppetca.8 +118 -0
- data/man/man8/puppetd.8 +184 -0
- data/man/man8/puppetdoc.8 +62 -0
- data/man/man8/puppetmasterd.8 +87 -0
- data/man/man8/puppetrun.8 +151 -0
- data/man/man8/ralsh.8 +135 -0
- data/test/README +24 -0
- data/test/certmgr/support.rb +28 -1
- data/test/data/failers/badclassnoparam +10 -0
- data/test/data/failers/badclassparam +10 -0
- data/test/data/failers/badcompnoparam +9 -0
- data/test/data/failers/badcompparam +9 -0
- data/test/data/failers/badtypeparam +3 -0
- data/test/data/failers/noobjectrvalue +1 -0
- data/test/data/providers/cron/crontab.allthree +17 -0
- data/test/data/providers/cron/crontab.envNcomment +12 -0
- data/test/data/providers/cron/crontab.envNname +11 -0
- data/test/data/providers/cron/crontab.multirecords +12 -0
- data/test/data/providers/cron/crontab_collections.yaml +44 -0
- data/test/data/providers/cron/crontab_multiple_with_env.yaml +54 -0
- data/test/data/providers/cron/crontab_sample_records.yaml +272 -0
- data/test/data/providers/cron/examples/freebsd +2 -0
- data/test/data/providers/cron/examples/one +14 -0
- data/test/data/providers/cron/examples/openbsd +20 -0
- data/test/data/providers/package/testpackages.yaml +65 -0
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys +5 -0
- data/test/data/reports/1.yaml +108 -0
- data/test/data/reports/2.yaml +108 -0
- data/test/data/reports/tagmail_failers.conf +3 -0
- data/test/data/reports/tagmail_passers.conf +30 -0
- data/test/data/snippets/aliastest.pp +16 -0
- data/test/data/snippets/argumentdefaults +14 -0
- data/test/data/snippets/casestatement.pp +58 -0
- data/test/data/snippets/classheirarchy.pp +15 -0
- data/test/data/snippets/classincludes.pp +17 -0
- data/test/data/snippets/classpathtest +11 -0
- data/test/data/snippets/collection.pp +10 -0
- data/test/data/snippets/collection_within_virtual_definitions.pp +20 -0
- data/test/data/snippets/componentmetaparams.pp +11 -0
- data/test/data/snippets/componentrequire.pp +8 -0
- data/test/data/snippets/deepclassheirarchy.pp +23 -0
- data/test/data/snippets/defineoverrides.pp +17 -0
- data/test/data/snippets/emptyclass.pp +9 -0
- data/test/data/snippets/emptyexec.pp +3 -0
- data/test/data/snippets/falsevalues.pp +3 -0
- data/test/data/snippets/filecreate +11 -0
- data/test/data/snippets/fqdefinition.pp +5 -0
- data/test/data/snippets/fqparents.pp +11 -0
- data/test/data/snippets/implicititeration +15 -0
- data/test/data/snippets/multipleinstances +7 -0
- data/test/data/snippets/multisubs.pp +13 -0
- data/test/data/snippets/namevartest +9 -0
- data/test/data/snippets/scopetest +13 -0
- data/test/data/snippets/selectorvalues.pp +42 -0
- data/test/data/snippets/simpledefaults +5 -0
- data/test/data/snippets/simpleselector +38 -0
- data/test/data/snippets/singleary.pp +19 -0
- data/test/data/snippets/singlequote.pp +11 -0
- data/test/data/snippets/singleselector.pp +22 -0
- data/test/data/snippets/subclass_name_duplication.pp +11 -0
- data/test/data/snippets/tag.pp +9 -0
- data/test/data/snippets/tagged.pp +35 -0
- data/test/data/snippets/virtualresources.pp +14 -0
- data/test/data/types/hosts/1 +3 -0
- data/test/data/types/hosts/2 +13 -0
- data/test/data/types/hosts/solaris +5 -0
- data/test/data/types/mailalias/file1 +183 -0
- data/test/data/types/mount/freebsd.fstab +7 -0
- data/test/data/types/mount/linux.fstab +11 -0
- data/test/data/types/mount/solaris.fstab +11 -0
- data/test/data/types/port/1 +533 -0
- data/test/data/types/port/darwin +11866 -0
- data/test/data/types/ssh_authorized_key/1 +2 -0
- data/test/data/types/sshkey/1 +21 -0
- data/test/data/types/yumrepos/fedora-devel.repo +26 -0
- data/test/data/types/yumrepos/fedora.repo +9 -0
- data/test/language/parser.rb +8 -1
- data/test/lib/puppettest/runnable_test.rb +3 -0
- data/test/lib/puppettest/support/utils.rb +1 -1
- data/test/lib/rake/puppet_testtask.rb +3 -0
- data/test/lib/stubba.rb +1 -1
- data/test/network/client/ca.rb +1 -0
- data/test/network/client/master.rb +13 -127
- data/test/network/handler/master.rb +61 -80
- data/test/other/provider.rb +0 -45
- data/test/other/transactions.rb +53 -15
- data/test/rails/host.rb +0 -37
- data/test/ral/providers/cron/crontab.rb +32 -3
- data/test/ral/providers/provider.rb +28 -7
- data/test/ral/type/filesources.rb +2 -18
- data/test/ral/type/sshkey.rb +0 -1
- data/test/ral/type/user.rb +6 -0
- data/test/test +241 -0
- metadata +289 -113
- data/examples/root/etc/configfile +0 -0
- data/examples/root/etc/debian-passwd +0 -29
- data/examples/root/etc/debian-syslog.conf +0 -71
- data/lib/puppet/event.rb +0 -28
- data/lib/puppet/network/handler/configuration.rb +0 -184
- data/lib/puppet/network/http/mongrel/xmlrpc.rb +0 -4
- data/lib/puppet/network/http/webrick/xmlrpc.rb +0 -4
- data/lib/puppet/propertychange.rb +0 -141
- data/lib/puppet/provider/interface/redhat.rb +0 -250
- data/lib/puppet/provider/interface/sunos.rb +0 -133
- data/lib/puppet/type/interface.rb +0 -60
- data/lib/puppet/util/variables.rb +0 -38
- data/test/network/handler/configuration.rb +0 -160
- data/test/other/propertychange.rb +0 -140
- data/test/util/loadedfile.rb +0 -121
data/conf/redhat/puppet.spec
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
Summary: A network tool for managing many disparate systems
|
9
9
|
Name: puppet
|
10
|
-
Version: 0.24.
|
10
|
+
Version: 0.24.5
|
11
11
|
Release: 1%{?dist}
|
12
12
|
License: GPLv2+
|
13
13
|
Group: System Environment/Base
|
@@ -157,6 +157,9 @@ fi
|
|
157
157
|
rm -rf %{buildroot}
|
158
158
|
|
159
159
|
%changelog
|
160
|
+
* Mon Jul 22 2008 James Turnbull <james@lovedthanlost.net> - 0.24.5-1
|
161
|
+
- New version
|
162
|
+
|
160
163
|
* Sat Dec 22 2007 David Lutterkort <dlutter@redhat.com> - 0.24.1-1
|
161
164
|
- New version
|
162
165
|
|
data/conf/redhat/server.init
CHANGED
@@ -62,6 +62,11 @@ restart() {
|
|
62
62
|
start
|
63
63
|
}
|
64
64
|
|
65
|
+
genconfig() {
|
66
|
+
echo -n $"Generate configuration puppetmaster: "
|
67
|
+
$PUPPETMASTER $PUPPETMASTER_OPTS --genconfig
|
68
|
+
}
|
69
|
+
|
65
70
|
case "$1" in
|
66
71
|
start)
|
67
72
|
start
|
@@ -79,8 +84,11 @@ case "$1" in
|
|
79
84
|
status $PUPPETMASTER
|
80
85
|
RETVAL=$?
|
81
86
|
;;
|
87
|
+
genconfig)
|
88
|
+
genconfig
|
89
|
+
;;
|
82
90
|
*)
|
83
|
-
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
|
91
|
+
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|genconfig}"
|
84
92
|
exit 1
|
85
93
|
esac
|
86
94
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/examples/{code/head → head}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/examples/{code/modules → modules}/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/examples/{code/one → one}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/ext/autotest/config
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# vim: syntax=ruby
|
2
|
+
# From http://pastie.caboo.se/115692, linked from rickbradley
|
3
|
+
|
4
|
+
require 'autotest/redgreen'
|
5
|
+
require 'autotest/timestamp'
|
6
|
+
|
7
|
+
Autotest.send(:alias_method, :real_find_files, :find_files)
|
8
|
+
Autotest.send(:define_method, :find_files) do |*args|
|
9
|
+
real_find_files.reject do |k, v|
|
10
|
+
if (ENV['AUTOTEST'] and !ENV['AUTOTEST'].empty?)
|
11
|
+
!Regexp.new(ENV['AUTOTEST']).match(k)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
module Autotest::Growl
|
17
|
+
|
18
|
+
def self.growl title, msg, img, pri=0, sticky=""
|
19
|
+
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
|
20
|
+
end
|
21
|
+
|
22
|
+
Autotest.add_hook :ran_command do |at|
|
23
|
+
image_root = "~/.autotest_images"
|
24
|
+
results = [at.results].flatten.join("\n")
|
25
|
+
output = results.slice(/(\d+)\stests,\s(\d+)\sassertions,\s(\d+)\sfailures,\s(\d+)\serrors/)
|
26
|
+
if output
|
27
|
+
if $~[3].to_i > 0 || $~[4].to_i > 0
|
28
|
+
growl "FAIL", "#{output}", "#{image_root}/fail.png", 2
|
29
|
+
else
|
30
|
+
growl "Pass", "#{output}", "#{image_root}/pass.png"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
output = results.slice(/(\d+)\sexamples,\s(\d+)\sfailures?(,\s+\d+\s+pending)?/)
|
35
|
+
if output
|
36
|
+
if $~[2].to_i > 0 || $~[4].to_i > 0
|
37
|
+
growl "FAIL", "#{output}", "#{image_root}/fail.png", 2
|
38
|
+
else
|
39
|
+
growl "Pass", "#{output}", "#{image_root}/pass.png"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Autotest is a simple tool that automatically links tests with the files being
|
2
|
+
tested, and runs tests automatically when either the test or code has changed.
|
3
|
+
|
4
|
+
If you are running on a Mac and have growlnotify_ installed, install the
|
5
|
+
ZenTest_ gem, then copy the ``config`` file to ``~/.autotest`` (or just
|
6
|
+
run ``rake`` in this directory).
|
7
|
+
|
8
|
+
Once you have ``autotest`` installed, change to the root of your Puppet
|
9
|
+
git repository and run ``autotest`` with no arguments. To refresh the list
|
10
|
+
of files to scan, hit ``^c`` (that is, control-c).
|
11
|
+
|
12
|
+
It's recommended you leave this running in another terminal during all
|
13
|
+
development, preferably on another monitor.
|
14
|
+
|
15
|
+
.. _zentest: http://www.zenspider.com/ZSS/Products/ZenTest/
|
16
|
+
.. _growlnotify: http://growl.info/extras.php
|
data/ext/emacs/puppet-mode.el
CHANGED
@@ -2,59 +2,52 @@
|
|
2
2
|
;;; puppet-mode.el
|
3
3
|
;;;
|
4
4
|
;;; Author: lutter
|
5
|
-
;;;
|
5
|
+
;;; Author: Russ Allbery <rra@stanford.edu>
|
6
6
|
;;;
|
7
|
+
;;; Description: A simple mode for editing puppet manifests
|
7
8
|
|
8
|
-
(defconst puppet-mode-version "0.
|
9
|
+
(defconst puppet-mode-version "0.2")
|
9
10
|
|
10
11
|
(defvar puppet-mode-abbrev-table nil
|
11
12
|
"Abbrev table in use in puppet-mode buffers.")
|
12
13
|
|
13
14
|
(define-abbrev-table 'puppet-mode-abbrev-table ())
|
14
15
|
|
15
|
-
(
|
16
|
+
(defcustom puppet-indent-level 2
|
17
|
+
"*Indentation of Puppet statements."
|
18
|
+
:type 'integer :group 'puppet)
|
16
19
|
|
17
|
-
(
|
18
|
-
|
19
|
-
|
20
|
-
;; (define-key puppet-mode-map "{" 'puppet-electric-brace)
|
21
|
-
;; (define-key puppet-mode-map "}" 'puppet-electric-brace)
|
22
|
-
;; (define-key puppet-mode-map "\e\C-a" 'puppet-beginning-of-defun)
|
23
|
-
;; (define-key puppet-mode-map "\e\C-e" 'puppet-end-of-defun)
|
24
|
-
;; (define-key puppet-mode-map "\e\C-b" 'puppet-backward-sexp)
|
25
|
-
;; (define-key puppet-mode-map "\e\C-f" 'puppet-forward-sexp)
|
26
|
-
;; (define-key puppet-mode-map "\e\C-p" 'puppet-beginning-of-block)
|
27
|
-
;; (define-key puppet-mode-map "\e\C-n" 'puppet-end-of-block)
|
28
|
-
;; (define-key puppet-mode-map "\e\C-h" 'puppet-mark-defun)
|
29
|
-
;; (define-key puppet-mode-map "\e\C-q" 'puppet-indent-exp)
|
30
|
-
;; (define-key puppet-mode-map "\t" 'puppet-indent-command)
|
31
|
-
;; (define-key puppet-mode-map "\C-c\C-e" 'puppet-insert-end)
|
32
|
-
;; (define-key puppet-mode-map "\C-j" 'puppet-reindent-then-newline-and-indent)
|
33
|
-
(define-key puppet-mode-map "\C-m" 'newline))
|
20
|
+
(defcustom puppet-include-indent 2
|
21
|
+
"*Indentation of continued Puppet include statements."
|
22
|
+
:type 'integer :group 'puppet)
|
34
23
|
|
35
|
-
(defvar puppet-mode-
|
36
|
-
|
24
|
+
(defvar puppet-mode-map
|
25
|
+
(let ((map (make-sparse-keymap)))
|
26
|
+
(define-key map "\C-j" 'newline-and-indent)
|
27
|
+
(define-key map "\C-m" 'newline-and-indent)
|
28
|
+
map)
|
29
|
+
"Key map used in puppet-mode buffers.")
|
37
30
|
|
38
|
-
(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
)
|
31
|
+
(defvar puppet-mode-syntax-table
|
32
|
+
(let ((table (make-syntax-table)))
|
33
|
+
(modify-syntax-entry ?\' "\"" table)
|
34
|
+
(modify-syntax-entry ?\" "\"" table)
|
35
|
+
(modify-syntax-entry ?# "<" table)
|
36
|
+
(modify-syntax-entry ?\n ">" table)
|
37
|
+
(modify-syntax-entry ?\\ "\\" table)
|
38
|
+
(modify-syntax-entry ?$ "." table)
|
39
|
+
(modify-syntax-entry ?- "_" table)
|
40
|
+
(modify-syntax-entry ?> "." table)
|
41
|
+
(modify-syntax-entry ?= "." table)
|
42
|
+
(modify-syntax-entry ?\; "." table)
|
43
|
+
(modify-syntax-entry ?\( "()" table)
|
44
|
+
(modify-syntax-entry ?\) ")(" table)
|
45
|
+
(modify-syntax-entry ?\{ "(}" table)
|
46
|
+
(modify-syntax-entry ?\} "){" table)
|
47
|
+
(modify-syntax-entry ?\[ "(]" table)
|
48
|
+
(modify-syntax-entry ?\] ")[" table)
|
49
|
+
table)
|
50
|
+
"Syntax table in use in puppet-mode buffers.")
|
58
51
|
|
59
52
|
(defcustom puppet-indent-tabs-mode nil
|
60
53
|
"*Indentation can insert tabs in puppet mode if this is non-nil."
|
@@ -64,36 +57,43 @@
|
|
64
57
|
"*Indentation column of comments."
|
65
58
|
:type 'integer :group 'puppet)
|
66
59
|
|
67
|
-
(defun puppet-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
(setq comment-start "# ")
|
76
|
-
(make-variable-buffer-local 'comment-end)
|
77
|
-
(setq comment-end "")
|
78
|
-
(make-variable-buffer-local 'comment-column)
|
79
|
-
(setq comment-column puppet-comment-column)
|
80
|
-
(make-variable-buffer-local 'comment-start-skip)
|
81
|
-
(setq comment-start-skip "#+ *")
|
82
|
-
(setq indent-tabs-mode puppet-indent-tabs-mode)
|
83
|
-
(make-local-variable 'parse-sexp-ignore-comments)
|
84
|
-
(setq parse-sexp-ignore-comments t)
|
85
|
-
(make-local-variable 'paragraph-start)
|
86
|
-
(setq paragraph-start (concat "$\\|" page-delimiter))
|
87
|
-
(make-local-variable 'paragraph-separate)
|
88
|
-
(setq paragraph-separate paragraph-start)
|
89
|
-
(make-local-variable 'paragraph-ignore-fill-prefix)
|
90
|
-
(setq paragraph-ignore-fill-prefix t))
|
60
|
+
(defun puppet-count-matches (re start end)
|
61
|
+
"The same as Emacs 22 count-matches, for portability to other versions
|
62
|
+
of Emacs."
|
63
|
+
(save-excursion
|
64
|
+
(let ((n 0))
|
65
|
+
(goto-char start)
|
66
|
+
(while (re-search-forward re end t) (setq n (1+ n)))
|
67
|
+
n)))
|
91
68
|
|
92
69
|
(defun puppet-comment-line-p ()
|
93
70
|
"Return non-nil iff this line is a comment."
|
94
71
|
(save-excursion
|
95
|
-
(
|
96
|
-
|
72
|
+
(save-match-data
|
73
|
+
(beginning-of-line)
|
74
|
+
(looking-at (format "\\s-*%s" comment-start)))))
|
75
|
+
|
76
|
+
(defun puppet-block-indent ()
|
77
|
+
"If point is in a block, return the indentation of the first line of that
|
78
|
+
block (the line containing the opening brace). Used to set the indentation
|
79
|
+
of the closing brace of a block."
|
80
|
+
(save-excursion
|
81
|
+
(save-match-data
|
82
|
+
(let ((opoint (point))
|
83
|
+
(apoint (search-backward "{" nil t)))
|
84
|
+
(when apoint
|
85
|
+
;; This is a bit of a hack and doesn't allow for strings. We really
|
86
|
+
;; want to parse by sexps at some point.
|
87
|
+
(let ((close-braces (puppet-count-matches "}" apoint opoint))
|
88
|
+
(open-braces 0))
|
89
|
+
(while (and apoint (> close-braces open-braces))
|
90
|
+
(setq apoint (search-backward "{" nil t))
|
91
|
+
(when apoint
|
92
|
+
(setq close-braces (puppet-count-matches "}" apoint opoint))
|
93
|
+
(setq open-braces (1+ open-braces)))))
|
94
|
+
(if apoint
|
95
|
+
(current-indentation)
|
96
|
+
nil))))))
|
97
97
|
|
98
98
|
(defun puppet-in-array ()
|
99
99
|
"If point is in an array, return the position of the opening '[' of
|
@@ -103,15 +103,36 @@ that array, else return nil."
|
|
103
103
|
(let ((opoint (point))
|
104
104
|
(apoint (search-backward "[" nil t)))
|
105
105
|
(when apoint
|
106
|
-
;;
|
107
|
-
;;
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
106
|
+
;; This is a bit of a hack and doesn't allow for strings. We really
|
107
|
+
;; want to parse by sexps at some point.
|
108
|
+
(let ((close-brackets (puppet-count-matches "]" apoint opoint))
|
109
|
+
(open-brackets 0))
|
110
|
+
(while (and apoint (> close-brackets open-brackets))
|
111
|
+
(setq apoint (search-backward "[" nil t))
|
112
|
+
(when apoint
|
113
|
+
(setq close-brackets (puppet-count-matches "]" apoint opoint))
|
114
|
+
(setq open-brackets (1+ open-brackets)))))
|
115
|
+
apoint)))))
|
116
|
+
|
117
|
+
(defun puppet-in-include ()
|
118
|
+
"If point is in a continued list of include statements, return the position
|
119
|
+
of the initial include plus puppet-include-indent."
|
120
|
+
(save-excursion
|
121
|
+
(save-match-data
|
122
|
+
(let ((include-column nil)
|
123
|
+
(not-found t))
|
124
|
+
(while not-found
|
125
|
+
(forward-line -1)
|
126
|
+
(cond
|
127
|
+
((bobp)
|
128
|
+
(setq not-found nil))
|
129
|
+
((looking-at "^\\s-*include\\s-+.*,\\s-*$")
|
130
|
+
(setq include-column
|
131
|
+
(+ (current-indentation) puppet-include-indent))
|
132
|
+
(setq not-found nil))
|
133
|
+
((not (looking-at ".*,\\s-*$"))
|
134
|
+
(setq not-found nil))))
|
135
|
+
include-column))))
|
115
136
|
|
116
137
|
(defun puppet-indent-line ()
|
117
138
|
"Indent current line as puppet code."
|
@@ -121,6 +142,8 @@ that array, else return nil."
|
|
121
142
|
(indent-line-to 0) ; First line is always non-indented
|
122
143
|
(let ((not-indented t)
|
123
144
|
(array-start (puppet-in-array))
|
145
|
+
(include-start (puppet-in-include))
|
146
|
+
(block-indent (puppet-block-indent))
|
124
147
|
cur-indent)
|
125
148
|
(cond
|
126
149
|
(array-start
|
@@ -155,18 +178,13 @@ that array, else return nil."
|
|
155
178
|
(re-search-forward "\\S-")
|
156
179
|
(forward-char -1)
|
157
180
|
(setq cur-indent (current-column))))
|
158
|
-
(
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
(setq cur-indent (- (current-indentation) 2))
|
166
|
-
(setq not-indented nil))
|
167
|
-
(setq cur-indent (- (current-indentation) 2))))
|
168
|
-
(if (< cur-indent 0) ; We can't indent past the left margin
|
169
|
-
(setq cur-indent 0)))
|
181
|
+
(include-start
|
182
|
+
(setq cur-indent include-start))
|
183
|
+
((and (looking-at "^\\s-*}\\s-*$") block-indent)
|
184
|
+
;; This line contains only a closing brace and we're at the inner
|
185
|
+
;; block, so we should indent it matching the indentation of the
|
186
|
+
;; opening brace of the block.
|
187
|
+
(setq cur-indent block-indent))
|
170
188
|
(t
|
171
189
|
;; Otherwise, we did not start on a block-ending-only line.
|
172
190
|
(save-excursion
|
@@ -174,123 +192,167 @@ that array, else return nil."
|
|
174
192
|
(while not-indented
|
175
193
|
(forward-line -1)
|
176
194
|
(cond
|
195
|
+
;; Comment lines are ignored unless we're at the start of the
|
196
|
+
;; buffer.
|
177
197
|
((puppet-comment-line-p)
|
178
198
|
(if (bobp)
|
179
|
-
(setq not-indented nil)
|
180
|
-
|
181
|
-
|
182
|
-
|
199
|
+
(setq not-indented nil)))
|
200
|
+
|
201
|
+
;; Brace or paren on a line by itself will already be indented to
|
202
|
+
;; the right level, so we can cheat and stop there.
|
203
|
+
((looking-at "^\\s-*[\)}]\\s-*")
|
183
204
|
(setq cur-indent (current-indentation))
|
184
205
|
(setq not-indented nil))
|
185
|
-
((looking-at "^.*{") ; indent an extra level
|
186
|
-
(setq cur-indent (+ (current-indentation) 2))
|
187
|
-
(setq not-indented nil))
|
188
|
-
((bobp)
|
189
|
-
(setq not-indented nil))
|
190
|
-
)))))
|
191
|
-
(if cur-indent
|
192
|
-
(indent-line-to cur-indent)
|
193
|
-
(indent-line-to 0)))))
|
194
206
|
|
207
|
+
;; Brace or paren not on a line by itself will be indented one
|
208
|
+
;; level too much, but don't catch cases where the block is
|
209
|
+
;; started and closed on the same line.
|
210
|
+
((looking-at "^[^\n\({]*[\)}]\\s-*$")
|
211
|
+
(setq cur-indent (- (current-indentation) puppet-indent-level))
|
212
|
+
(setq not-indented nil))
|
195
213
|
|
196
|
-
|
197
|
-
|
198
|
-
|
214
|
+
;; Indent by one level more than the start of our block. We lose
|
215
|
+
;; if there is more than one block opened and closed on the same
|
216
|
+
;; line but it's still unbalanced; hopefully people don't do that.
|
217
|
+
((looking-at "^.*{[^\n}]*$")
|
218
|
+
(setq cur-indent (+ (current-indentation) puppet-indent-level))
|
219
|
+
(setq not-indented nil))
|
199
220
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
(use-local-map puppet-mode-map)
|
205
|
-
(setq mode-name "Puppet")
|
206
|
-
(setq major-mode 'puppet-mode)
|
207
|
-
(puppet-mode-variables)
|
208
|
-
;; Register our indentation function
|
209
|
-
(set (make-local-variable 'indent-line-function) 'puppet-indent-line)
|
210
|
-
(run-hooks 'puppet-mode-hook))
|
221
|
+
;; Indent by one level if the line ends with an open paren.
|
222
|
+
((looking-at "^.*\(\\s-*$")
|
223
|
+
(setq cur-indent (+ (current-indentation) puppet-indent-level))
|
224
|
+
(setq not-indented nil))
|
211
225
|
|
226
|
+
;; Semicolon ends a block for a resource when multiple resources
|
227
|
+
;; are defined in the same block, but try not to get the case of
|
228
|
+
;; a complete resource on a single line wrong.
|
229
|
+
((looking-at "^\\([^'\":\n]\\|\"[^\n\"]*\"\\|'[^\n']'\\)**;\\s-*$")
|
230
|
+
(setq cur-indent (- (current-indentation) puppet-indent-level))
|
231
|
+
(setq not-indented nil))
|
212
232
|
|
233
|
+
;; Indent an extra level after : since it introduces a resource.
|
234
|
+
((looking-at "^.*:\\s-*$")
|
235
|
+
(setq cur-indent (+ (current-indentation) puppet-indent-level))
|
236
|
+
(setq not-indented nil))
|
213
237
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
(setq font-lock-variable-name-face font-lock-type-face))
|
238
|
+
;; Start of buffer.
|
239
|
+
((bobp)
|
240
|
+
(setq not-indented nil)))))
|
218
241
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
(6 (7 . ?/)))
|
224
|
-
("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
|
225
|
-
("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))))
|
242
|
+
;; If this line contains only a closing paren, we should lose one
|
243
|
+
;; level of indentation.
|
244
|
+
(if (looking-at "^\\s-*\)\\s-*$")
|
245
|
+
(setq cur-indent (- cur-indent puppet-indent-level)))))
|
226
246
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
beginning-of-line
|
232
|
-
(font-lock-syntactic-keywords
|
233
|
-
. puppet-font-lock-syntactic-keywords))))
|
234
|
-
(t
|
235
|
-
(add-hook 'puppet-mode-hook
|
236
|
-
'(lambda ()
|
237
|
-
(make-local-variable 'font-lock-defaults)
|
238
|
-
(make-local-variable 'font-lock-keywords)
|
239
|
-
(make-local-variable 'font-lock-syntax-table)
|
240
|
-
(make-local-variable 'font-lock-syntactic-keywords)
|
241
|
-
(setq font-lock-defaults '((puppet-font-lock-keywords) nil nil))
|
242
|
-
(setq font-lock-keywords puppet-font-lock-keywords)
|
243
|
-
(setq font-lock-syntax-table puppet-font-lock-syntax-table)
|
244
|
-
(setq font-lock-syntactic-keywords puppet-font-lock-syntactic-keywords)))))
|
247
|
+
;; We've figured out the indentation, so do it.
|
248
|
+
(if (and cur-indent (> cur-indent 0))
|
249
|
+
(indent-line-to cur-indent)
|
250
|
+
(indent-line-to 0)))))
|
245
251
|
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
252
|
+
(defvar puppet-font-lock-syntax-table
|
253
|
+
(let* ((tbl (copy-syntax-table puppet-mode-syntax-table)))
|
254
|
+
(modify-syntax-entry ?_ "w" tbl)
|
255
|
+
tbl))
|
250
256
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
"
|
276
|
-
|
277
|
-
|
257
|
+
(defvar puppet-font-lock-keywords
|
258
|
+
(list
|
259
|
+
;; defines, classes, and nodes
|
260
|
+
'("^\\s *\\(class\\|define\\|node\\)\\s +\\([^( \t\n]+\\)"
|
261
|
+
2 font-lock-function-name-face)
|
262
|
+
;; inheritence
|
263
|
+
'("\\s +inherits\\s +\\([^( \t\n]+\\)"
|
264
|
+
1 font-lock-function-name-face)
|
265
|
+
;; include
|
266
|
+
'("\\(^\\|\\s +\\)include\\s +\\(\\([a-zA-Z0-9:_-]+\\(,[ \t\n]*\\)?\\)+\\)"
|
267
|
+
2 font-lock-reference-face)
|
268
|
+
;; keywords
|
269
|
+
(cons (concat
|
270
|
+
"\\b\\(\\("
|
271
|
+
(mapconcat
|
272
|
+
'identity
|
273
|
+
'("alert"
|
274
|
+
"case"
|
275
|
+
"class"
|
276
|
+
"crit"
|
277
|
+
"debug"
|
278
|
+
"default"
|
279
|
+
"define"
|
280
|
+
"defined"
|
281
|
+
"else"
|
282
|
+
"emerg"
|
283
|
+
"err"
|
284
|
+
"fail"
|
285
|
+
"false"
|
286
|
+
"file"
|
287
|
+
"filebucket"
|
288
|
+
"generate"
|
289
|
+
"if"
|
290
|
+
"import"
|
291
|
+
"include"
|
292
|
+
"info"
|
293
|
+
"inherits"
|
294
|
+
"node"
|
295
|
+
"notice"
|
296
|
+
"realize"
|
297
|
+
"search"
|
298
|
+
"tag"
|
299
|
+
"tagged"
|
300
|
+
"template"
|
301
|
+
"true"
|
302
|
+
"warning"
|
303
|
+
)
|
304
|
+
"\\|")
|
305
|
+
"\\)\\>\\)")
|
306
|
+
1)
|
278
307
|
;; variables
|
279
|
-
'("\\(^\\|[^_:.@$]
|
308
|
+
'("\\(^\\|[^_:.@$]\\)\\b\\(true\\|false\\)\\>"
|
280
309
|
2 font-lock-variable-name-face)
|
281
|
-
;; variables
|
282
310
|
'("\\(\\$\\([^a-zA-Z0-9 \n]\\|[0-9]\\)\\)\\W"
|
283
311
|
1 font-lock-variable-name-face)
|
284
|
-
'("\\(\\$\\|@\\|@@\\)\\(\\w\\|_
|
312
|
+
'("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\|:\\)+"
|
285
313
|
0 font-lock-variable-name-face)
|
286
314
|
;; usage of types
|
287
|
-
'("^\\s
|
315
|
+
'("^\\s *\\([a-zA-Z_-]+\\)\\s +{"
|
316
|
+
1 font-lock-type-face)
|
317
|
+
;; overrides and type references
|
318
|
+
'("\\s +\\([A-Z][a-zA-Z_:-]*\\)\\["
|
288
319
|
1 font-lock-type-face)
|
289
320
|
;; general delimited string
|
290
321
|
'("\\(^\\|[[ \t\n<+(,=]\\)\\(%[xrqQwW]?\\([^<[{(a-zA-Z0-9 \n]\\)[^\n\\\\]*\\(\\\\.[^\n\\\\]*\\)*\\(\\3\\)\\)"
|
291
|
-
(2 font-lock-string-face))
|
292
|
-
|
293
|
-
|
294
|
-
|
322
|
+
(2 font-lock-string-face)))
|
323
|
+
"*Additional expressions to highlight in puppet mode.")
|
324
|
+
|
325
|
+
;;;###autoload
|
326
|
+
(defun puppet-mode ()
|
327
|
+
"Major mode for editing puppet manifests.
|
328
|
+
|
329
|
+
The variable puppet-indent-level controls the amount of indentation.
|
330
|
+
\\{puppet-mode-map}"
|
331
|
+
(interactive)
|
332
|
+
(kill-all-local-variables)
|
333
|
+
(use-local-map puppet-mode-map)
|
334
|
+
(setq mode-name "Puppet")
|
335
|
+
(setq major-mode 'puppet-mode)
|
336
|
+
(set-syntax-table puppet-mode-syntax-table)
|
337
|
+
(set (make-local-variable 'local-abbrev-table) puppet-mode-abbrev-table)
|
338
|
+
(set (make-local-variable 'comment-start) "# ")
|
339
|
+
(set (make-local-variable 'comment-start-skip) "#+ *")
|
340
|
+
(set (make-local-variable 'comment-end) "")
|
341
|
+
(set (make-local-variable 'comment-column) puppet-comment-column)
|
342
|
+
(set (make-local-variable 'indent-line-function) 'puppet-indent-line)
|
343
|
+
(set (make-local-variable 'indent-tabs-mode) puppet-indent-tabs-mode)
|
344
|
+
(set (make-local-variable 'require-final-newline) t)
|
345
|
+
(set (make-local-variable 'paragraph-ignore-fill-prefix) t)
|
346
|
+
(set (make-local-variable 'paragraph-start) "\f\\|[ ]*$")
|
347
|
+
(set (make-local-variable 'paragraph-separate) "[ \f]*$")
|
348
|
+
(or (boundp 'font-lock-variable-name-face)
|
349
|
+
(setq font-lock-variable-name-face font-lock-type-face))
|
350
|
+
(set (make-local-variable 'font-lock-keywords) puppet-font-lock-keywords)
|
351
|
+
(set (make-local-variable 'font-lock-multiline) t)
|
352
|
+
(set (make-local-variable 'font-lock-defaults)
|
353
|
+
'((puppet-font-lock-keywords) nil nil))
|
354
|
+
(set (make-local-variable 'font-lock-syntax-table)
|
355
|
+
puppet-font-lock-syntax-table)
|
356
|
+
(run-hooks 'puppet-mode-hook))
|
295
357
|
|
296
358
|
(provide 'puppet-mode)
|