From 0040bc87a1a4afac3a97165cd2e6e3c38f373261 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 24 Sep 2008 18:08:06 -0500 Subject: Fixed #1045 - Multiple metaparams all get added to resources. The problem was that I was using a 'return' in a loop where I should have been using a 'next'. Signed-off-by: Luke Kanies --- lib/puppet/parser/resource.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index d214a60ee..747338b3b 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -369,7 +369,7 @@ class Puppet::Parser::Resource next unless val = scope.lookupvar(name.to_s, false) and val != :undefined # The default case: just set the value - return set_parameter(name, val) unless @params[name] + set_parameter(name, val) and next unless @params[name] # For relationship params, though, join the values (a la #446). @params[name].value = [@params[name].value, val].flatten -- cgit From 98e79f8b7dbbdcb29c91b6099569e180bd8267c7 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 24 Sep 2008 17:46:57 -0500 Subject: Fixed #1472 -- defined, exported resources in the current compile now get expanded correctly. This was working for defined resources in the db, but not in the current compile. I just had to mark the resources as non-exported. --- lib/puppet/parser/collector.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index bcba9528e..0f9072510 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -72,7 +72,8 @@ class Puppet::Parser::Collector def collect_exported # First get everything from the export table. Just reuse our # collect_virtual method but tell it to use 'exported? for the test. - resources = collect_virtual(true).reject { |r| ! r.virtual? } + resources = collect_virtual(true).reject { |r| ! r.virtual? }.each { |r| r.exported = false } + #resources = collect_virtual(true).reject { |r| ! r.virtual? } count = resources.length -- cgit From aa629ec3c01de5b1bfdcb761376d1f417704fd8c Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 25 Sep 2008 13:10:06 +1000 Subject: Fixed #1607 - Added ubuntu to defaultfor for Debian service provider --- lib/puppet/provider/service/debian.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/provider/service/debian.rb b/lib/puppet/provider/service/debian.rb index da38c10a2..ca433cbe6 100755 --- a/lib/puppet/provider/service/debian.rb +++ b/lib/puppet/provider/service/debian.rb @@ -5,7 +5,7 @@ Puppet::Type.type(:service).provide :debian, :parent => :init do is that this supports service enabling and disabling via ``update-rc.d``." commands :update => "/usr/sbin/update-rc.d" - defaultfor :operatingsystem => :debian + defaultfor :operatingsystem => [:debian, :ubuntu] def self.defpath superclass.defpath -- cgit From 2da6d19d8ac9b089e1a563b95fcc97b735fd4720 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 25 Sep 2008 13:23:16 +1000 Subject: Fixed #1608 - Added ubuntu to defaultfor for apt provider --- lib/puppet/provider/package/apt.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/provider/package/apt.rb b/lib/puppet/provider/package/apt.rb index 016623d71..d0e520f0a 100755 --- a/lib/puppet/provider/package/apt.rb +++ b/lib/puppet/provider/package/apt.rb @@ -10,7 +10,7 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do commands :aptcache => "/usr/bin/apt-cache" commands :preseed => "/usr/bin/debconf-set-selections" - defaultfor :operatingsystem => :debian + defaultfor :operatingsystem => [:debian, :ubuntu] ENV['DEBIAN_FRONTEND'] = "noninteractive" -- cgit From 074abd4d0d4823c067ef5704218d8258eb9c5ecd Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 25 Sep 2008 14:02:15 +1000 Subject: Fixed #1609 - Added confines for the Gentoo, FreeBSD and SMF (Solaris) service providers --- lib/puppet/provider/service/freebsd.rb | 2 ++ lib/puppet/provider/service/gentoo.rb | 2 ++ lib/puppet/provider/service/smf.rb | 2 ++ 3 files changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/puppet/provider/service/freebsd.rb b/lib/puppet/provider/service/freebsd.rb index e5d0453c3..95bde7784 100644 --- a/lib/puppet/provider/service/freebsd.rb +++ b/lib/puppet/provider/service/freebsd.rb @@ -2,6 +2,8 @@ Puppet::Type.type(:service).provide :freebsd, :parent => :init do desc "FreeBSD's (and probably NetBSD?) form of ``init``-style service management; uses ``rc.conf.d`` for service enabling and disabling." + + confine :operatingsystem => [:freebsd, :netbsd, :openbsd] defaultfor :operatingsystem => :freebsd diff --git a/lib/puppet/provider/service/gentoo.rb b/lib/puppet/provider/service/gentoo.rb index adbee6970..c5ba7b5f1 100644 --- a/lib/puppet/provider/service/gentoo.rb +++ b/lib/puppet/provider/service/gentoo.rb @@ -6,6 +6,8 @@ Puppet::Type.type(:service).provide :gentoo, :parent => :init do commands :update => "/sbin/rc-update" + confine :operatingsystem => :gentoo + defaultfor :operatingsystem => :gentoo def self.defpath diff --git a/lib/puppet/provider/service/smf.rb b/lib/puppet/provider/service/smf.rb index c74ce3f8f..ab1fe88c2 100755 --- a/lib/puppet/provider/service/smf.rb +++ b/lib/puppet/provider/service/smf.rb @@ -7,6 +7,8 @@ Puppet::Type.type(:service).provide :smf, :parent => :base do defaultfor :operatingsystem => :solaris + confine :operatingsystem => :solaris + commands :adm => "/usr/sbin/svcadm", :svcs => "/usr/bin/svcs" def enable -- cgit From f792b645fa1f1237e144aa79d84e53c49ed64564 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 25 Sep 2008 14:19:52 +1000 Subject: Added a number of confines to package providers --- lib/puppet/provider/package/blastwave.rb | 2 ++ lib/puppet/provider/package/fink.rb | 2 +- lib/puppet/provider/package/hpux.rb | 7 ++++++- lib/puppet/provider/package/portage.rb | 2 ++ lib/puppet/provider/package/sun.rb | 2 ++ lib/puppet/provider/package/sunfreeware.rb | 3 +++ 6 files changed, 16 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/package/blastwave.rb b/lib/puppet/provider/package/blastwave.rb index 402e8a1de..a2f86aa5a 100755 --- a/lib/puppet/provider/package/blastwave.rb +++ b/lib/puppet/provider/package/blastwave.rb @@ -6,6 +6,8 @@ Puppet::Type.type(:package).provide :blastwave, :parent => :sun, :source => :sun pkgget = "/opt/csw/bin/pkg-get" end + confine :operatingsystem => :solaris + commands :pkgget => pkgget # This is so stupid, but then, so is blastwave. diff --git a/lib/puppet/provider/package/fink.rb b/lib/puppet/provider/package/fink.rb index 030e1a347..4d560666b 100755 --- a/lib/puppet/provider/package/fink.rb +++ b/lib/puppet/provider/package/fink.rb @@ -4,7 +4,7 @@ Puppet::Type.type(:package).provide :fink, :parent => :dpkg, :source => :dpkg do desc "Package management via ``fink``." - commands :fink => "/sw/bin/fink" + commands :fink => "/sw/bin/fink" commands :aptget => "/sw/bin/apt-get" commands :aptcache => "/sw/bin/apt-cache" commands :dpkgquery => "/sw/bin/dpkg-query" diff --git a/lib/puppet/provider/package/hpux.rb b/lib/puppet/provider/package/hpux.rb index aa756ead0..202fa24c9 100644 --- a/lib/puppet/provider/package/hpux.rb +++ b/lib/puppet/provider/package/hpux.rb @@ -3,11 +3,16 @@ require 'puppet/provider/package' Puppet::Type.type(:package).provide :hpux, :parent => Puppet::Provider::Package do + desc "HP-UX's packaging system." + commands :swinstall => "/usr/sbin/swinstall", :swlist => "/usr/sbin/swlist", :swremove => "/usr/sbin/swremove" - defaultfor :operatingsystem => 'hp-ux' + + confine :operatingsystem => "hp-ux" + + defaultfor :operatingsystem => "hp-ux" def self.instances # TODO: This is very hard on HP-UX! diff --git a/lib/puppet/provider/package/portage.rb b/lib/puppet/provider/package/portage.rb index f795d0302..b382d80da 100644 --- a/lib/puppet/provider/package/portage.rb +++ b/lib/puppet/provider/package/portage.rb @@ -7,6 +7,8 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa commands :emerge => "/usr/bin/emerge", :eix => "/usr/bin/eix", :update_eix => "/usr/bin/update-eix" + confine :operatingsystem => :gentoo + defaultfor :operatingsystem => :gentoo def self.instances diff --git a/lib/puppet/provider/package/sun.rb b/lib/puppet/provider/package/sun.rb index 927596df2..0d366388a 100755 --- a/lib/puppet/provider/package/sun.rb +++ b/lib/puppet/provider/package/sun.rb @@ -9,6 +9,8 @@ Puppet::Type.type(:package).provide :sun, :parent => Puppet::Provider::Package d :pkgadd => "/usr/sbin/pkgadd", :pkgrm => "/usr/sbin/pkgrm" + confine :operatingsystem => :solaris + defaultfor :operatingsystem => :solaris def self.instances diff --git a/lib/puppet/provider/package/sunfreeware.rb b/lib/puppet/provider/package/sunfreeware.rb index 8b573fe2b..d7bcd0982 100755 --- a/lib/puppet/provider/package/sunfreeware.rb +++ b/lib/puppet/provider/package/sunfreeware.rb @@ -4,5 +4,8 @@ Puppet::Type.type(:package).provide :sunfreeware, :parent => :blastwave, :source At this point, support is exactly the same as ``blastwave`` support and has not actually been tested." commands :pkgget => "pkg-get" + + confine :operatingsystem => :solaris + end -- cgit From 3749267093923692d6e7bc0c9ce83b43a487b19e Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Fri, 26 Sep 2008 14:26:45 +1000 Subject: Fixed #1610 - Raise "Filebucketed" messages to Notice priority --- lib/puppet/type/file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 875f8c370..2a5e61de8 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -368,7 +368,7 @@ module Puppet Find.find(self[:path]) do |f| if File.file?(f) sum = backup.backup(f) - self.info "Filebucketed %s to %s with sum %s" % + self.notice "Filebucketed %s to %s with sum %s" % [f, backup.name, sum] end end @@ -403,7 +403,7 @@ module Puppet case backup when Puppet::Network::Client.client(:Dipper): sum = backup.backup(file) - self.info "Filebucketed to %s with sum %s" % + self.notice "Filebucketed to %s with sum %s" % [backup.name, sum] return true when String: -- cgit From a30ecf2aeffd71960bd806fb28cd6d1b8adc2452 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Tue, 23 Sep 2008 15:21:29 +0100 Subject: Make fileserver use fileset for recursion and handle dangling links by ignoring them fixing #1544 --- lib/puppet/file_serving/fileset.rb | 2 +- lib/puppet/network/handler/fileserver.rb | 65 ++++++++++++-------------------- 2 files changed, 25 insertions(+), 42 deletions(-) (limited to 'lib') diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb index fe54350b1..7cd7366be 100644 --- a/lib/puppet/file_serving/fileset.rb +++ b/lib/puppet/file_serving/fileset.rb @@ -120,7 +120,7 @@ class Puppet::FileServing::Fileset return result end - + public # Stat a given file, using the links-appropriate method. def stat(path) unless defined?(@stat_method) diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index 3e62cdbd9..ff9b96f6c 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -651,55 +651,38 @@ class Puppet::Network::Handler # and "bad batch". # def list(relpath, recurse, ignore, client = nil) - reclist(file_path(relpath, client), nil, recurse, ignore) - end - - # Recursively list the files in this tree. - def reclist(basepath, abspath, recurse, ignore) - abspath = basepath if abspath.nil? - relpath = abspath.sub(%r{^#{basepath}}, '') - relpath = "/#{relpath}" if relpath[0] != ?/ #/ - - return unless FileTest.exists?(abspath) - - desc = [relpath] - - ftype = File.stat(abspath).ftype - - desc << ftype - if recurse.is_a?(Integer) - recurse -= 1 + require 'puppet/file_serving' + require 'puppet/file_serving/fileset' + abspath = file_path(relpath, client) + if FileTest.exists?(abspath) + if FileTest.directory?(abspath) and recurse + return reclist(abspath, recurse, ignore) + else + return [["/", File.stat(abspath).ftype]] + end end + return nil + end - ary = [desc] - if recurse == true or (recurse.is_a?(Integer) and recurse > -1) - if ftype == "directory" - children = Dir.entries(abspath) - if ignore - children = handleignore(children, abspath, ignore) - end - children.each { |child| - next if child =~ /^\.\.?$/ - reclist(basepath, File.join(abspath, child), recurse, ignore).each { |cobj| - ary << cobj - } - } + def reclist(abspath, recurse, ignore) + args = { :recurse => recurse, :links => :follow } + args[:ignore] = ignore if ignore + fs = Puppet::FileServing::Fileset.new(abspath, args) + ary = fs.files.collect do |file| + if file == "." + file = "/" + else + file = File.join("/", file ) end + stat = fs.stat(File.join(abspath, file)) + next if stat.nil? + [ file, stat.ftype ] end return ary.compact end - # Deal with ignore parameters. - def handleignore(files, path, ignore_patterns) - ignore_patterns.each do |ignore| - files.delete_if do |entry| - File.fnmatch(ignore, entry, File::FNM_DOTMATCH) - end - end - return files - end - end + end # A special mount class specifically for the plugins mount -- just # has some magic to effectively do a union mount of the 'plugins' -- cgit From b2f0d872a273760c5ac65663685faea9be9ecfd5 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Mon, 29 Sep 2008 11:57:26 +0100 Subject: Fix ticket 1596 in new fileset code, use tmpdir in fileserver tests. --- lib/puppet/file_serving/fileset.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb index 7cd7366be..3cb76317d 100644 --- a/lib/puppet/file_serving/fileset.rb +++ b/lib/puppet/file_serving/fileset.rb @@ -20,7 +20,7 @@ class Puppet::FileServing::Fileset # Now strip off the leading path, so each file becomes relative, and remove # any slashes that might end up at the beginning of the path. - result = files.collect { |file| file.sub(%r{^#{@path}/*}, '') } + result = files.collect { |file| file.sub(%r{^#{Regexp.escape(@path)}/*}, '') } # And add the path itself. result.unshift(".") -- cgit From 860bdb120df93c3ad9f323529f22f71ca8548cf8 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Tue, 30 Sep 2008 22:13:08 +1000 Subject: Fixed #1603 - Added support for running Puppet inside a Rack application --- lib/puppet/network/http_server/rack.rb | 148 +++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 lib/puppet/network/http_server/rack.rb (limited to 'lib') diff --git a/lib/puppet/network/http_server/rack.rb b/lib/puppet/network/http_server/rack.rb new file mode 100644 index 000000000..806007a05 --- /dev/null +++ b/lib/puppet/network/http_server/rack.rb @@ -0,0 +1,148 @@ +# Author: Christian Hofstaedtler +# Copyright (c) 2006 Manuel Holtgrewe, 2007 Luke Kanies, +# 2008 Christian Hofstaedtler +# +# This file is mostly based on the mongrel module, which is part of +# the standard puppet distribution. +# +# puppet/network/http_server/mongrel.rb has the following license, +# and is based heavily on a file retrieved from: +# http://ttt.ggnore.net/2006/11/15/xmlrpc-with-mongrel-and-ruby-off-rails/ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +require 'puppet' +require 'puppet/network/handler' +require 'puppet/sslcertificates' + +require 'xmlrpc/server' +require 'puppet/network/xmlrpc/server' +require 'puppet/network/http_server' +require 'puppet/network/client_request' +require 'puppet/network/handler' + +require 'resolv' +require 'rack' + +# A handler for a Rack-style puppet(master)d. For the most part, it works +# exactly the same as HTTPServer::Mongrel: +# After checking whether the request itself is sane, the handler forwards +# it to an internal instance of XMLRPC::BasicServer to process it. +module Puppet::Network + class HTTPServer::Rack + attr_reader :xmlrpc_server + + def initialize(handlers) + @debug = false + if Puppet[:debug] + @debug = true + end + + Puppet.info "Starting Rack server for puppet version %s" % Puppet.version + if Puppet[:name] != "puppetmasterd" then + Puppet.warn 'Rack server is not named "puppetmasterd", this may be not what you want. ($0 = %s)' % $0 + end + + @xmlrpc_server = Puppet::Network::XMLRPCServer.new + handlers.each do |name, args| + unless handler = Puppet::Network::Handler.handler(name) + raise ArgumentError, "Invalid handler %s" % name + end + h = handler.new(args) + @xmlrpc_server.add_handler(handler.interface, h) + end + Puppet.info "Rack server is waiting to serve requests." + end + + # Validate a rack-style request (in env), and run the requested XMLRPC + # call. + def process(env) + # time to serve a request + req = Rack::Request.new(env) + + if @debug then + Puppet.info "Handling request, details:" + env.each do |name, val| + l = " env: %s ->" % name + l = l + ' %s' % val + Puppet.info l + end + end + + if not req.post? then + return [405, { "Content-Type" => "text/html" }, "Method Not Allowed"] + end + if req.media_type() != "text/xml" then + return [400, { "Content-Type" => "text/html" }, "Bad Request"] + end + if req.content_length().to_i <= 0 then + return [411, { "Content-Type" => "text/html" }, "Length Required"] + end + + body = '' + req.body().each { |line| body = body + line } + if @debug then + Puppet.info "Request Body: %s" % body + end + if body.size != req.content_length().to_i then + if @debug then + Puppet.info "body length didnt match %d" % body.size + Puppet.info " vs. -> %d" % req.content_length().to_i + end + return [400, { "Content-Type" => "text/html" }, "Bad Request Length"] + end + info = client_info(env) + begin + data = @xmlrpc_server.process(body, info) + return [200, { "Content-Type" => "text/xml; charset=utf-8" }, data] + rescue => detail + Puppet.err "Rack: Internal Server Error: XMLRPC_Server.process problem. Details follow: " + detail.backtrace.each { |line| Puppet.err " --> %s" % line } + return [500, { "Content-Type" => "text/html" }, "Internal Server Error"] + end + end + + private + + def client_info(request) + ip = request["REMOTE_ADDR"] + # JJM #906 The following dn.match regular expression is forgiving + # enough to match the two Distinguished Name string contents + # coming from Apache, Pound or other reverse SSL proxies. + if dn = request[Puppet[:ssl_client_header]] and dn_matchdata = dn.match(/^.*?CN\s*=\s*(.*)/) + client = dn_matchdata[1].to_str + valid = (request[Puppet[:ssl_client_verify_header]] == 'SUCCESS') + else + begin + client = Resolv.getname(ip) + rescue => detail + Puppet.err "Could not resolve %s: %s" % [ip, detail] + client = "unknown" + end + valid = false + end + info = Puppet::Network::ClientRequest.new(client, ip, valid) + return info + end + end +end + -- cgit From af8c70650b028a70ed50ac6c2bd7f4f00c17ae03 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Fri, 19 Sep 2008 11:41:45 +0100 Subject: Fix metadata class for cases when checksum_type set --- lib/puppet/file_serving/metadata.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/file_serving/metadata.rb b/lib/puppet/file_serving/metadata.rb index beecaef48..b277955ac 100644 --- a/lib/puppet/file_serving/metadata.rb +++ b/lib/puppet/file_serving/metadata.rb @@ -60,10 +60,10 @@ class Puppet::FileServing::Metadata < Puppet::FileServing::FileBase case stat.ftype when "file": - @checksum = ("{%s}" % @checksum_type) + send("%s_file" % @checksum_type, real_path) + @checksum = ("{%s}" % @checksum_type) + send("%s_file" % @checksum_type, real_path).to_s when "directory": # Always just timestamp the directory. - sumtype = @checksum_type.to_s =~ /time/ ? @checksum_type : "ctime" - @checksum = ("{%s}" % sumtype) + send("%s_file" % sumtype, path).to_s + @checksum_type = "ctime" + @checksum = ("{%s}" % @checksum_type) + send("%s_file" % @checksum_type, path).to_s when "link": @destination = File.readlink(real_path) else -- cgit From e6698c2b8624fe2c2bbeef594318e3e8d932d345 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Thu, 25 Sep 2008 16:05:57 +0100 Subject: Add warning and forcibly set to :md5 fixing #1564 --- lib/puppet/type/file/checksum.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/puppet/type/file/checksum.rb b/lib/puppet/type/file/checksum.rb index 3be147cb7..27edee13d 100755 --- a/lib/puppet/type/file/checksum.rb +++ b/lib/puppet/type/file/checksum.rb @@ -53,6 +53,9 @@ Puppet::Type.type(:file).newproperty(:checksum) do else if FileTest.directory?(@resource[:path]) return :time + elsif @resource[:source] + self.warning("Files with source set must use md5 as checksum. Forcing to md5 from %s for %s" % [ value, @resource[:path] ]) + return :md5 else return symbolize(value) end @@ -161,6 +164,7 @@ Puppet::Type.type(:file).newproperty(:checksum) do checktype = :mtime if checktype == :timestamp checktype = :ctime if checktype == :time + self.should = checktype = :md5 if @resource.property(:source) file ||= @resource[:path] -- cgit From 8372dc4ca80d95e62c407708a48e51ac09ad2f55 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Fri, 26 Sep 2008 22:56:17 +0200 Subject: Add boolean operators to AST --- lib/puppet/parser/ast.rb | 1 + lib/puppet/parser/ast/boolean_operator.rb | 48 +++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 lib/puppet/parser/ast/boolean_operator.rb (limited to 'lib') diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb index c9bd7c9e8..66744525e 100644 --- a/lib/puppet/parser/ast.rb +++ b/lib/puppet/parser/ast.rb @@ -76,6 +76,7 @@ end # And include all of the AST subclasses. require 'puppet/parser/ast/astarray' require 'puppet/parser/ast/branch' +require 'puppet/parser/ast/boolean_operator' require 'puppet/parser/ast/caseopt' require 'puppet/parser/ast/casestatement' require 'puppet/parser/ast/collection' diff --git a/lib/puppet/parser/ast/boolean_operator.rb b/lib/puppet/parser/ast/boolean_operator.rb new file mode 100644 index 000000000..c3b5c7d41 --- /dev/null +++ b/lib/puppet/parser/ast/boolean_operator.rb @@ -0,0 +1,48 @@ +require 'puppet' +require 'puppet/parser/ast/branch' + +class Puppet::Parser::AST + class BooleanOperator < AST::Branch + + attr_accessor :operator, :lval, :rval + + # Iterate across all of our children. + def each + [@lval,@rval,@operator].each { |child| yield child } + end + + # Returns a boolean which is the result of the boolean operation + # of lval and rval operands + def evaluate(scope) + # evaluate the first operand, should return a boolean value + lval = @lval.safeevaluate(scope) + + # return result + # lazy evaluate right operand + case @operator + when "and"; + if Puppet::Parser::Scope.true?(lval) + rval = @rval.safeevaluate(scope) + Puppet::Parser::Scope.true?(rval) + else # false and false == false + false + end + when "or"; + if Puppet::Parser::Scope.true?(lval) + true + else + rval = @rval.safeevaluate(scope) + Puppet::Parser::Scope.true?(rval) + end + end + end + + def initialize(hash) + super + + unless %w{and or}.include?(@operator) + raise ArgumentError, "Invalid boolean operator %s" % @operator + end + end + end +end -- cgit From 9cdecfecce84b9e0a88b5ea86b3136a1025ac9d9 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Fri, 26 Sep 2008 22:59:27 +0200 Subject: Add comparison operators (< > == != <= >=) to AST --- lib/puppet/parser/ast.rb | 1 + lib/puppet/parser/ast/comparison_operator.rb | 37 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lib/puppet/parser/ast/comparison_operator.rb (limited to 'lib') diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb index 66744525e..da82a30c7 100644 --- a/lib/puppet/parser/ast.rb +++ b/lib/puppet/parser/ast.rb @@ -81,6 +81,7 @@ require 'puppet/parser/ast/caseopt' require 'puppet/parser/ast/casestatement' require 'puppet/parser/ast/collection' require 'puppet/parser/ast/collexpr' +require 'puppet/parser/ast/comparison_operator' require 'puppet/parser/ast/definition' require 'puppet/parser/ast/else' require 'puppet/parser/ast/function' diff --git a/lib/puppet/parser/ast/comparison_operator.rb b/lib/puppet/parser/ast/comparison_operator.rb new file mode 100644 index 000000000..63aa36c7f --- /dev/null +++ b/lib/puppet/parser/ast/comparison_operator.rb @@ -0,0 +1,37 @@ +require 'puppet' +require 'puppet/parser/ast/branch' + +class Puppet::Parser::AST + class ComparisonOperator < AST::Branch + + attr_accessor :operator, :lval, :rval + + # Iterate across all of our children. + def each + [@lval,@rval,@operator].each { |child| yield child } + end + + # Returns a boolean which is the result of the boolean operation + # of lval and rval operands + def evaluate(scope) + # evaluate the operands, should return a boolean value + lval = @lval.safeevaluate(scope) + rval = @rval.safeevaluate(scope) + + # return result + unless @operator == '!=' + lval.send(@operator,rval) + else + lval != rval + end + end + + def initialize(hash) + super + + unless %w{== != < > <= >=}.include?(@operator) + raise ArgumentError, "Invalid comparison operator %s" % @operator + end + end + end +end -- cgit From 850e0baf0fbe321f14d4b9d913ce7dea39c9aa27 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Fri, 26 Sep 2008 22:59:50 +0200 Subject: Add not operator to AST --- lib/puppet/parser/ast.rb | 1 + lib/puppet/parser/ast/not.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 lib/puppet/parser/ast/not.rb (limited to 'lib') diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb index da82a30c7..572771201 100644 --- a/lib/puppet/parser/ast.rb +++ b/lib/puppet/parser/ast.rb @@ -89,6 +89,7 @@ require 'puppet/parser/ast/hostclass' require 'puppet/parser/ast/ifstatement' require 'puppet/parser/ast/leaf' require 'puppet/parser/ast/node' +require 'puppet/parser/ast/not' require 'puppet/parser/ast/resource' require 'puppet/parser/ast/resource_defaults' require 'puppet/parser/ast/resource_override' diff --git a/lib/puppet/parser/ast/not.rb b/lib/puppet/parser/ast/not.rb new file mode 100644 index 000000000..c8fa1df2c --- /dev/null +++ b/lib/puppet/parser/ast/not.rb @@ -0,0 +1,19 @@ +require 'puppet' +require 'puppet/parser/ast/branch' + +# An object that returns a boolean which is the boolean not +# of the given value. +class Puppet::Parser::AST + class Not < AST::Branch + attr_accessor :value + + def each + yield @value + end + + def evaluate(scope) + val = @value.safeevaluate(scope) + return ! Puppet::Parser::Scope.true?(val) + end + end +end -- cgit From cfa230a2d7b0c5e57cc0379785bd2025520f1c35 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Fri, 26 Sep 2008 22:54:42 +0200 Subject: Add arithmetic operators to AST This changeset adds +,-,/,*,<< and >> computation and AST parse nodes. --- lib/puppet/parser/ast.rb | 2 ++ lib/puppet/parser/ast/arithmetic_operator.rb | 41 ++++++++++++++++++++++++++++ lib/puppet/parser/ast/minus.rb | 23 ++++++++++++++++ lib/puppet/parser/scope.rb | 23 ++++++++++++++++ 4 files changed, 89 insertions(+) create mode 100644 lib/puppet/parser/ast/arithmetic_operator.rb create mode 100644 lib/puppet/parser/ast/minus.rb (limited to 'lib') diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb index 572771201..5aa9f528a 100644 --- a/lib/puppet/parser/ast.rb +++ b/lib/puppet/parser/ast.rb @@ -74,6 +74,7 @@ class Puppet::Parser::AST end # And include all of the AST subclasses. +require 'puppet/parser/ast/arithmetic_operator' require 'puppet/parser/ast/astarray' require 'puppet/parser/ast/branch' require 'puppet/parser/ast/boolean_operator' @@ -88,6 +89,7 @@ require 'puppet/parser/ast/function' require 'puppet/parser/ast/hostclass' require 'puppet/parser/ast/ifstatement' require 'puppet/parser/ast/leaf' +require 'puppet/parser/ast/minus' require 'puppet/parser/ast/node' require 'puppet/parser/ast/not' require 'puppet/parser/ast/resource' diff --git a/lib/puppet/parser/ast/arithmetic_operator.rb b/lib/puppet/parser/ast/arithmetic_operator.rb new file mode 100644 index 000000000..8d9cef86a --- /dev/null +++ b/lib/puppet/parser/ast/arithmetic_operator.rb @@ -0,0 +1,41 @@ +require 'puppet' +require 'puppet/parser/ast/branch' + +class Puppet::Parser::AST + class ArithmeticOperator < AST::Branch + + attr_accessor :operator, :lval, :rval + + # Iterate across all of our children. + def each + [@lval,@rval,@operator].each { |child| yield child } + end + + # Returns a boolean which is the result of the boolean operation + # of lval and rval operands + def evaluate(scope) + # evaluate the operands, should return a boolean value + lval = @lval.safeevaluate(scope) + lval = Puppet::Parser::Scope.number?(lval) + if lval == nil + raise ArgumentError, "left operand of %s is not a number" % @operator + end + rval = @rval.safeevaluate(scope) + rval = Puppet::Parser::Scope.number?(rval) + if rval == nil + raise ArgumentError, "right operand of %s is not a number" % @operator + end + + # compute result + lval.send(@operator, rval) + end + + def initialize(hash) + super + + unless %w{+ - * / << >>}.include?(@operator) + raise ArgumentError, "Invalid arithmetic operator %s" % @operator + end + end + end +end diff --git a/lib/puppet/parser/ast/minus.rb b/lib/puppet/parser/ast/minus.rb new file mode 100644 index 000000000..b0779a8ee --- /dev/null +++ b/lib/puppet/parser/ast/minus.rb @@ -0,0 +1,23 @@ +require 'puppet' +require 'puppet/parser/ast/branch' + +# An object that returns a boolean which is the boolean not +# of the given value. +class Puppet::Parser::AST + class Minus < AST::Branch + attr_accessor :value + + def each + yield @value + end + + def evaluate(scope) + val = @value.safeevaluate(scope) + val = Puppet::Parser::Scope.number?(val) + if val == nil + raise ArgumentError, "minus operand %s is not a number" % val + end + return -val + end + end +end diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index 1ff998d96..4acdf41c9 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -43,6 +43,29 @@ class Puppet::Parser::Scope end end + # Is the value a number?, return the correct object or nil if not a number + def self.number?(value) + unless value.is_a?(Fixnum) or value.is_a?(Bignum) or value.is_a?(Float) or value.is_a?(String) + return nil + end + + if value.is_a?(String) + if value =~ /^-?\d+(:?\.\d+|(:?\.\d+)?e\d+)$/ + return value.to_f + elsif value =~ /^0x\d+/i + return value.to_i(16) + elsif value =~ /^0\d+/i + return value.to_i(8) + elsif value =~ /^-?\d+/ + return value.to_i + else + return nil + end + end + # it is one of Fixnum,Bignum or Float + return value + end + # Add to our list of namespaces. def add_namespace(ns) return false if @namespaces.include?(ns) -- cgit From 4cf9710bd27fdb5f0720f4d8478ef940e7c4ba59 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Fri, 26 Sep 2008 23:03:39 +0200 Subject: Add parser for arbitrary expressions The expressions can be used in if 'test' and in the right side of assignements. The expressions can contain any number of sub-expressions combined by either arithmetic operators, comparison operators, or boolean operators. Random Usage Examples: $result = ((( $two + 2) / $one) + 4 * 5.45) - (6 << 7) + (0x800 + -9) or if ($a < 10) and ($a + 10 != 200) { ... } --- lib/puppet/parser/grammar.ra | 87 ++- lib/puppet/parser/lexer.rb | 14 +- lib/puppet/parser/parser.rb | 1564 +++++++++++++++++++++++++----------------- 3 files changed, 1020 insertions(+), 645 deletions(-) (limited to 'lib') diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index 07666acb4..b44cd0612 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -9,7 +9,19 @@ token FALSE EQUALS APPENDS LESSEQUAL NOTEQUAL DOT COLON LLCOLLECT RRCOLLECT token QMARK LPAREN RPAREN ISEQUAL GREATEREQUAL GREATERTHAN LESSTHAN token IF ELSE IMPORT DEFINE ELSIF VARIABLE CLASS INHERITS NODE BOOLEAN token NAME SEMIC CASE DEFAULT AT LCOLLECT RCOLLECT CLASSNAME CLASSREF -token NOT OR AND UNDEF PARROW +token NOT OR AND UNDEF PARROW PLUS MINUS TIMES DIV LSHIFT RSHIFT UMINUS + +prechigh + right NOT + nonassoc UMINUS + left TIMES DIV + left MINUS PLUS + left LSHIFT RSHIFT + left NOTEQUAL ISEQUAL + left GREATEREQUAL GREATERTHAN LESSTHAN LESSEQUAL + left AND + left OR +preclow rule program: statements { @@ -283,7 +295,7 @@ resourcename: quotedtext | variable | array -assignment: VARIABLE EQUALS rvalue { +assignment: VARIABLE EQUALS expression { if val[0] =~ /::/ raise Puppet::ParseError, "Cannot assign to variables in other namespaces" end @@ -292,7 +304,7 @@ assignment: VARIABLE EQUALS rvalue { result = ast AST::VarDef, :name => variable, :value => val[2] } -append: VARIABLE APPENDS rvalue { +append: VARIABLE APPENDS expression { variable = ast AST::Name, :value => val[0] result = ast AST::VarDef, :name => variable, :value => val[2], :append => true } @@ -395,7 +407,7 @@ resourceref: NAME LBRACK rvalue RBRACK { result = ast AST::ResourceReference, :type => val[0], :title => val[2] } -ifstatement: IF iftest LBRACE statements RBRACE else { +ifstatement: IF expression LBRACE statements RBRACE else { args = { :test => val[1], :statements => val[3] @@ -413,9 +425,70 @@ else: # nothing result = ast AST::Else, :statements => val[2] } -# Currently we only support a single value, but eventually one assumes -# we'll support operators and such. -iftest: rvalue +# Unlike yacc/bison, it seems racc +# gives tons of shift/reduce warnings +# with the following syntax: +# +# expression: ... +# | expression arithop expressio { ... } +# +# arithop: PLUS | MINUS | DIVIDE | TIMES ... +# +# So I had to develop the expression by adding one rule +# per operator :-( + +expression: rvalue + | expression PLUS expression { + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression MINUS expression { + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression DIV expression { + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression TIMES expression { + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression LSHIFT expression { + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression RSHIFT expression { + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | MINUS expression =UMINUS { + result = ast AST::Minus, :value => val[1] +} + | expression NOTEQUAL expression { + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression ISEQUAL expression { + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression GREATERTHAN expression { + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression GREATEREQUAL expression { + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression LESSTHAN expression { + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression LESSEQUAL expression { + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | NOT expression { + result = ast AST::Not, :value => val[1] +} + | expression AND expression { + result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | expression OR expression { + result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2] +} + | LPAREN expression RPAREN { + result = val[1] +} casestatement: CASE rvalue LBRACE caseopts RBRACE { options = val[3] diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb index 71210d919..5dd036e52 100644 --- a/lib/puppet/parser/lexer.rb +++ b/lib/puppet/parser/lexer.rb @@ -126,12 +126,22 @@ class Puppet::Parser::Lexer '\\' => :BACKSLASH, '=>' => :FARROW, '+>' => :PARROW, + '+' => :PLUS, + '-' => :MINUS, + '/' => :DIV, + '*' => :TIMES, + '<<' => :LSHIFT, + '>>' => :RSHIFT, %r{([a-z][-\w]*::)+[a-z][-\w]*} => :CLASSNAME, %r{((::){0,1}[A-Z][-\w]*)+} => :CLASSREF ) TOKENS.add_tokens "Whatever" => :DQTEXT, "Nomatter" => :SQTEXT, "alsonomatter" => :BOOLEAN + TOKENS.add_token :NUMBER, %r{\b(?:0[xX][0-9A-Fa-f]+|0?\d+(?:\.\d+)?(?:[eE]-?\d+)?)\b} do |lexer, value| + [TOKENS[:NAME], value] + end + TOKENS.add_token :NAME, %r{[a-z0-9][-\w]*} do |lexer, value| string_token = self # we're looking for keywords here @@ -145,10 +155,6 @@ class Puppet::Parser::Lexer [string_token, value] end - TOKENS.add_token :NUMBER, %r{[0-9]+} do |lexer, value| - [TOKENS[:NAME], value] - end - TOKENS.add_token :COMMENT, %r{#.*}, :skip => true TOKENS.add_token :RETURN, "\n", :skip => true, :incr_line => true, :skip_text => true diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index 69225cc2b..b8aa4b5ed 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -29,7 +29,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..id7dbe8301d1', 'grammar.ra', 644 +module_eval <<'..end grammar.ra modeval..id272fb19b12', 'grammar.ra', 717 # It got too annoying having code in a file that needs to be compiled. require 'puppet/parser/parser_support' @@ -41,524 +41,687 @@ require 'puppet/parser/parser_support' # $Id$ -..end grammar.ra modeval..id7dbe8301d1 +..end grammar.ra modeval..id272fb19b12 ##### racc 1.4.5 generates ### racc_reduce_table = [ 0, 0, :racc_error, - 1, 53, :_reduce_1, - 1, 53, :_reduce_none, - 1, 54, :_reduce_none, - 2, 54, :_reduce_4, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 1, 56, :_reduce_none, - 4, 64, :_reduce_18, - 3, 64, :_reduce_19, - 2, 64, :_reduce_20, - 1, 70, :_reduce_none, - 1, 70, :_reduce_none, - 1, 71, :_reduce_none, - 3, 71, :_reduce_24, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_32, - 1, 72, :_reduce_none, - 3, 72, :_reduce_34, - 5, 57, :_reduce_35, - 5, 57, :_reduce_36, - 5, 57, :_reduce_37, - 5, 68, :_reduce_38, - 2, 58, :_reduce_39, - 1, 89, :_reduce_40, - 2, 89, :_reduce_41, - 2, 59, :_reduce_42, - 3, 90, :_reduce_43, - 3, 90, :_reduce_44, - 1, 91, :_reduce_none, - 1, 91, :_reduce_none, - 3, 91, :_reduce_47, - 1, 92, :_reduce_none, - 3, 92, :_reduce_49, - 1, 93, :_reduce_none, - 1, 93, :_reduce_none, - 3, 94, :_reduce_52, - 3, 94, :_reduce_53, - 1, 95, :_reduce_none, - 1, 95, :_reduce_none, - 4, 97, :_reduce_56, - 1, 83, :_reduce_none, - 3, 83, :_reduce_58, - 0, 84, :_reduce_none, - 1, 84, :_reduce_none, - 1, 99, :_reduce_61, - 1, 74, :_reduce_62, - 1, 76, :_reduce_63, - 1, 98, :_reduce_none, - 1, 98, :_reduce_none, + 1, 60, :_reduce_1, + 1, 60, :_reduce_none, + 1, 61, :_reduce_none, + 2, 61, :_reduce_4, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 1, 63, :_reduce_none, + 4, 71, :_reduce_18, + 3, 71, :_reduce_19, + 2, 71, :_reduce_20, + 1, 77, :_reduce_none, + 1, 77, :_reduce_none, + 1, 78, :_reduce_none, + 3, 78, :_reduce_24, + 1, 80, :_reduce_none, + 1, 80, :_reduce_none, + 1, 80, :_reduce_none, + 1, 80, :_reduce_none, + 1, 80, :_reduce_none, + 1, 80, :_reduce_none, + 1, 80, :_reduce_none, + 1, 80, :_reduce_32, + 1, 79, :_reduce_none, + 3, 79, :_reduce_34, + 5, 64, :_reduce_35, + 5, 64, :_reduce_36, + 5, 64, :_reduce_37, + 5, 75, :_reduce_38, + 2, 65, :_reduce_39, + 1, 96, :_reduce_40, + 2, 96, :_reduce_41, + 2, 66, :_reduce_42, + 3, 97, :_reduce_43, + 3, 97, :_reduce_44, 1, 98, :_reduce_none, 1, 98, :_reduce_none, - 1, 98, :_reduce_none, - 1, 98, :_reduce_none, - 3, 60, :_reduce_70, - 3, 69, :_reduce_71, - 0, 85, :_reduce_72, - 1, 85, :_reduce_73, - 3, 85, :_reduce_74, - 3, 102, :_reduce_75, - 3, 103, :_reduce_76, - 1, 104, :_reduce_none, - 1, 104, :_reduce_none, - 0, 88, :_reduce_79, - 1, 88, :_reduce_80, - 3, 88, :_reduce_81, + 3, 98, :_reduce_47, + 1, 99, :_reduce_none, + 3, 99, :_reduce_49, + 1, 100, :_reduce_none, + 1, 100, :_reduce_none, + 3, 101, :_reduce_52, + 3, 101, :_reduce_53, + 1, 102, :_reduce_none, + 1, 102, :_reduce_none, + 4, 104, :_reduce_56, + 1, 90, :_reduce_none, + 3, 90, :_reduce_58, + 0, 91, :_reduce_none, + 1, 91, :_reduce_none, + 1, 106, :_reduce_61, + 1, 81, :_reduce_62, + 1, 83, :_reduce_63, 1, 105, :_reduce_none, - 3, 105, :_reduce_83, - 1, 96, :_reduce_none, - 1, 96, :_reduce_none, - 1, 96, :_reduce_none, - 1, 96, :_reduce_none, - 1, 96, :_reduce_none, - 1, 96, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 1, 101, :_reduce_none, - 4, 78, :_reduce_100, - 3, 78, :_reduce_101, - 1, 80, :_reduce_102, - 1, 80, :_reduce_103, - 1, 77, :_reduce_104, - 4, 81, :_reduce_105, - 4, 81, :_reduce_106, - 6, 62, :_reduce_107, - 0, 108, :_reduce_none, - 4, 108, :_reduce_109, - 1, 107, :_reduce_none, - 5, 61, :_reduce_111, - 1, 109, :_reduce_none, - 2, 109, :_reduce_113, - 5, 110, :_reduce_114, - 4, 110, :_reduce_115, - 1, 111, :_reduce_none, - 3, 111, :_reduce_117, - 3, 79, :_reduce_118, - 1, 113, :_reduce_none, - 4, 113, :_reduce_120, - 1, 115, :_reduce_none, - 3, 115, :_reduce_122, - 3, 114, :_reduce_123, - 1, 112, :_reduce_none, - 1, 112, :_reduce_none, - 1, 112, :_reduce_none, - 1, 112, :_reduce_none, - 1, 112, :_reduce_none, + 1, 105, :_reduce_none, + 1, 105, :_reduce_none, + 1, 105, :_reduce_none, + 1, 105, :_reduce_none, + 1, 105, :_reduce_none, + 3, 67, :_reduce_70, + 3, 76, :_reduce_71, + 0, 92, :_reduce_72, + 1, 92, :_reduce_73, + 3, 92, :_reduce_74, + 3, 109, :_reduce_75, + 3, 111, :_reduce_76, 1, 112, :_reduce_none, 1, 112, :_reduce_none, - 1, 112, :_reduce_131, - 1, 116, :_reduce_132, - 3, 116, :_reduce_133, - 2, 63, :_reduce_134, - 6, 65, :_reduce_135, - 5, 65, :_reduce_136, - 6, 66, :_reduce_137, - 5, 66, :_reduce_138, - 6, 67, :_reduce_139, - 5, 67, :_reduce_140, - 1, 87, :_reduce_none, - 1, 82, :_reduce_none, - 1, 82, :_reduce_none, - 1, 119, :_reduce_none, - 3, 119, :_reduce_145, - 1, 121, :_reduce_none, - 1, 121, :_reduce_none, - 1, 121, :_reduce_none, - 1, 121, :_reduce_none, - 0, 55, :_reduce_150, - 0, 122, :_reduce_151, - 1, 117, :_reduce_none, - 3, 117, :_reduce_153, - 3, 117, :_reduce_154, - 1, 123, :_reduce_none, - 3, 123, :_reduce_156, - 3, 124, :_reduce_157, - 1, 124, :_reduce_158, - 3, 124, :_reduce_159, - 1, 124, :_reduce_160, - 1, 120, :_reduce_none, - 2, 120, :_reduce_162, + 0, 95, :_reduce_79, + 1, 95, :_reduce_80, + 3, 95, :_reduce_81, + 1, 113, :_reduce_none, + 3, 113, :_reduce_83, + 1, 103, :_reduce_none, + 1, 103, :_reduce_none, + 1, 103, :_reduce_none, + 1, 103, :_reduce_none, + 1, 103, :_reduce_none, + 1, 103, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 1, 110, :_reduce_none, + 4, 85, :_reduce_100, + 3, 85, :_reduce_101, + 1, 87, :_reduce_102, + 1, 87, :_reduce_103, + 1, 84, :_reduce_104, + 4, 88, :_reduce_105, + 4, 88, :_reduce_106, + 6, 69, :_reduce_107, + 0, 115, :_reduce_none, + 4, 115, :_reduce_109, + 1, 108, :_reduce_none, + 3, 108, :_reduce_111, + 3, 108, :_reduce_112, + 3, 108, :_reduce_113, + 3, 108, :_reduce_114, + 3, 108, :_reduce_115, + 3, 108, :_reduce_116, + 2, 108, :_reduce_117, + 3, 108, :_reduce_118, + 3, 108, :_reduce_119, + 3, 108, :_reduce_120, + 3, 108, :_reduce_121, + 3, 108, :_reduce_122, + 3, 108, :_reduce_123, + 2, 108, :_reduce_124, + 3, 108, :_reduce_125, + 3, 108, :_reduce_126, + 3, 108, :_reduce_127, + 5, 68, :_reduce_128, + 1, 116, :_reduce_none, + 2, 116, :_reduce_130, + 5, 117, :_reduce_131, + 4, 117, :_reduce_132, 1, 118, :_reduce_none, - 2, 118, :_reduce_164, - 1, 125, :_reduce_none, + 3, 118, :_reduce_134, + 3, 86, :_reduce_135, + 1, 120, :_reduce_none, + 4, 120, :_reduce_137, + 1, 122, :_reduce_none, + 3, 122, :_reduce_139, + 3, 121, :_reduce_140, + 1, 119, :_reduce_none, + 1, 119, :_reduce_none, + 1, 119, :_reduce_none, + 1, 119, :_reduce_none, + 1, 119, :_reduce_none, + 1, 119, :_reduce_none, + 1, 119, :_reduce_none, + 1, 119, :_reduce_148, + 1, 123, :_reduce_149, + 3, 123, :_reduce_150, + 2, 70, :_reduce_151, + 6, 72, :_reduce_152, + 5, 72, :_reduce_153, + 6, 73, :_reduce_154, + 5, 73, :_reduce_155, + 6, 74, :_reduce_156, + 5, 74, :_reduce_157, + 1, 94, :_reduce_none, + 1, 89, :_reduce_none, + 1, 89, :_reduce_none, + 1, 126, :_reduce_none, + 3, 126, :_reduce_162, + 1, 128, :_reduce_none, + 1, 128, :_reduce_none, + 1, 128, :_reduce_none, + 1, 128, :_reduce_none, + 0, 62, :_reduce_167, + 0, 129, :_reduce_168, + 1, 124, :_reduce_none, + 3, 124, :_reduce_170, + 3, 124, :_reduce_171, + 1, 130, :_reduce_none, + 3, 130, :_reduce_173, + 3, 131, :_reduce_174, + 1, 131, :_reduce_175, + 3, 131, :_reduce_176, + 1, 131, :_reduce_177, + 1, 127, :_reduce_none, + 2, 127, :_reduce_179, 1, 125, :_reduce_none, - 1, 75, :_reduce_167, - 3, 100, :_reduce_168, - 2, 100, :_reduce_169, - 1, 106, :_reduce_none, - 1, 106, :_reduce_none, - 0, 86, :_reduce_none, - 1, 86, :_reduce_173 ] + 2, 125, :_reduce_181, + 1, 132, :_reduce_none, + 1, 132, :_reduce_none, + 1, 82, :_reduce_184, + 3, 107, :_reduce_185, + 2, 107, :_reduce_186, + 1, 114, :_reduce_none, + 1, 114, :_reduce_none, + 0, 93, :_reduce_none, + 1, 93, :_reduce_190 ] -racc_reduce_n = 174 +racc_reduce_n = 191 -racc_shift_n = 279 +racc_shift_n = 314 racc_action_table = [ - 77, 57, 60, 246, 167, 105, 77, 57, 60, 101, - 199, 235, -124, 167, 241, 203, 77, 57, 60, 234, - 54, 92, 77, 57, 60, 94, 131, 240, 208, 209, - 104, 47, 77, 57, 60, 59, 63, 47, 95, 68, - 131, 59, 63, 137, 55, 68, 166, 47, 65, 211, - 55, 59, 178, 47, 65, 68, -125, 59, 63, 173, - 116, 68, 96, 47, 65, -126, 55, 59, 119, -128, - 65, 68, 77, 57, 60, 147, 116, 208, 209, 147, - 65, 213, 77, 57, 60, 147, 47, 40, 41, 212, - 47, 151, 54, 57, 60, 151, 47, 35, 77, 57, - 60, 151, 188, 47, 4, 9, 172, 59, 63, 199, - 9, 68, 50, 47, 203, -125, 55, 59, 63, 204, - 65, 68, 42, 47, 205, 43, 55, 59, 63, 47, - 65, 68, 35, 59, 63, 51, 55, 68, 167, 4, - 65, 147, 55, 77, 57, 60, 65, 33, 34, 77, - 57, 60, 47, 171, 40, 41, 35, 151, -127, 77, - 57, 60, -129, 4, 214, 77, 57, 60, 208, 209, - 40, 41, 57, 60, 47, 77, 57, 60, 59, 63, - 47, 171, 68, -124, 59, 63, -130, 55, 68, 42, - 47, 65, 43, 55, 59, 63, 47, 65, 68, -125, - 59, 63, 219, 55, 68, 42, 47, 65, 43, 55, - 59, 63, 111, 65, 68, 77, 57, 60, 92, 55, - 191, 262, -127, 65, -124, 77, 57, 60, 135, 57, - 60, 35, 57, 60, 159, 189, 224, 225, 4, 191, - 192, 145, 57, 60, 145, 228, 47, 131, 57, 60, - 59, 63, 127, 133, 68, 231, 47, 54, 132, 55, - 59, 63, 47, 65, 68, -126, 59, 63, 168, 55, - 68, -141, 47, 65, 51, 55, 59, 178, 47, 65, - 68, 238, 59, 178, 239, 116, 68, 57, 60, 65, - -126, 116, 242, 57, 60, 65, 129, 245, -128, 138, - -129, 111, 94, 57, 60, -127, 171, 91, 165, 263, - 265, 90, 163, 57, 60, 139, 140, 47, 46, 57, - 60, 59, 178, 47, -129, 68, -126, 59, 178, 51, - 116, 68, -124, 47, 65, -127, 116, 59, 178, 184, - 65, 68, -125, 47, 57, 60, 116, 59, 178, 47, - 65, 68, 45, 59, 63, 272, 116, 68, -173, 273, - 65, 51, 55, 160, 57, 60, 65, 179, 143, 145, - 183, 57, 60, nil, 47, 237, nil, nil, 59, 178, - nil, nil, 68, nil, nil, nil, nil, 116, nil, nil, - nil, 65, nil, nil, 47, nil, 278, nil, 59, 178, - nil, 47, 68, nil, nil, 59, 178, 116, nil, 68, - nil, 65, nil, nil, 116, 257, nil, 20, 65, 24, - 26, nil, 1, 5, nil, 12, nil, 18, nil, 22, - nil, 27, nil, nil, 4, 9, 20, 243, 24, 26, - nil, 1, 5, nil, 12, nil, 18, nil, 22, nil, - 27, nil, nil, 4, 9, nil, 270, nil, 20, nil, - 24, 26, nil, 1, 5, nil, 12, nil, 18, nil, - 22, nil, 27, nil, nil, 4, 9, 20, 233, 24, - 26, nil, 1, 5, nil, 12, nil, 18, nil, 22, - nil, 27, nil, nil, 4, 9, nil, 277, nil, 20, - nil, 24, 26, nil, 1, 5, nil, 12, nil, 18, - nil, 22, nil, 27, nil, nil, 4, 9, 20, 274, - 24, 26, nil, 1, 5, nil, 12, nil, 18, nil, - 22, nil, 27, nil, nil, 4, 9, nil, 217, nil, - 20, nil, 24, 26, nil, 1, 5, nil, 12, nil, - 18, nil, 22, nil, 27, nil, nil, 4, 9, 20, - 215, 24, 26, nil, 1, 5, nil, 12, nil, 18, - nil, 22, nil, 27, nil, nil, 4, 9, nil, 256, - nil, 20, nil, 24, 26, nil, 1, 5, nil, 12, - nil, 18, nil, 22, nil, 27, nil, nil, 4, 9, - 20, nil, 24, 26, nil, 1, 5, nil, 12, nil, - 18, nil, 22, nil, 27, nil, nil, 4, 9, 20, - nil, 24, 26, nil, 1, 5, nil, 12, nil, 18, - nil, 22, nil, 27, nil, nil, 4, 9, 20, nil, - 24, 26, nil, 1, 5, nil, 12, nil, 18, nil, - 22, nil, 27, nil, nil, 4, 9, 20, nil, 24, - 26, nil, 1, 5, nil, 12, nil, 18, nil, 22, - nil, 27, nil, nil, 4, 9, 20, nil, 24, 26, - nil, 1, 5, nil, 12, nil, 18, nil, 22, nil, - 27, nil, nil, 4, 9 ] + 75, 54, 57, 270, 178, 39, 40, 283, 88, 237, + 51, 178, 89, 238, 244, 282, 286, 235, 236, 245, + 72, 75, 54, 57, 135, 90, 39, 40, 235, 236, + 135, 45, 39, 40, 129, 56, 59, 235, 236, 66, + 41, 72, 154, 44, 52, 76, 177, 162, 62, 92, + 146, 84, 45, 75, 54, 57, 56, 59, 45, 126, + 66, 41, 178, 167, 44, 52, 76, 41, 188, 62, + 44, 249, 84, 72, 75, 54, 57, 288, 156, 157, + 158, 144, 145, 147, 45, 198, 54, 57, 56, 59, + 287, 233, 66, 8, 72, 154, -141, 52, 76, 232, + 162, 62, 137, 146, 84, 45, 75, 54, 57, 56, + 59, 45, 252, 66, 37, 105, 167, 37, 52, 76, + 183, 4, 62, 37, 4, 84, 72, 75, 54, 57, + 4, 156, 157, 158, 144, 145, 147, 45, -143, 211, + 256, 56, 59, 212, 213, 66, 136, 72, 154, 258, + 52, 76, 161, 162, 62, 161, 146, 84, 45, 75, + 54, 57, 56, 59, 45, 244, 66, 54, 57, 167, + 245, 52, 76, 33, 34, 62, 212, 296, 84, 72, + 75, 54, 57, -145, 156, 157, 158, 144, 145, 147, + 45, 158, 144, 135, 56, 59, 158, 144, 66, 51, + 72, 154, 263, 52, 76, -146, 162, 62, 266, 146, + 84, 45, 75, 54, 57, 56, 59, 45, -142, 66, + 229, -142, 167, -147, 52, 76, 88, -144, 62, -146, + -141, 84, 72, 75, 54, 57, 134, 156, 157, 158, + 144, 145, 147, 45, -158, -145, 132, 56, 59, -143, + 161, 66, 269, 72, 37, 172, 52, 76, 173, 108, + 62, 4, 8, 84, 45, 89, 105, 174, 56, 59, + 155, 284, 66, 156, 157, 158, 144, 52, 76, 150, + 154, 62, 285, -144, 84, 180, 100, 184, 146, 148, + 151, 153, 188, 186, 75, 54, 57, 156, 157, 158, + 144, 145, 147, 156, 157, 158, 144, 145, 147, -141, + 196, 299, 149, 152, 72, -141, 156, 157, 158, 144, + 145, 147, -144, -142, -146, 45, 75, 54, 57, 56, + 59, -143, 300, 66, 156, 157, 158, 144, 52, 76, + 188, 71, 62, 193, 191, 84, 72, 75, 54, 57, + 38, -143, 307, -190, 308, 35, 189, 45, -142, -144, + nil, 56, 59, nil, nil, 66, nil, 72, nil, nil, + 52, 76, nil, nil, 62, nil, nil, 84, 45, 75, + 54, 57, 56, 59, nil, nil, 66, nil, nil, nil, + nil, 52, 76, nil, nil, 62, nil, nil, 84, 72, + 75, 54, 57, nil, nil, nil, nil, nil, nil, nil, + 45, nil, nil, nil, 56, 59, nil, nil, 66, nil, + 72, nil, nil, 52, 76, nil, nil, 62, nil, nil, + 84, 45, 75, 54, 57, 56, 59, nil, nil, 66, + nil, nil, nil, nil, 52, 76, nil, nil, 62, nil, + nil, 84, 72, 75, 54, 57, nil, nil, nil, nil, + nil, nil, nil, 45, nil, nil, nil, 56, 59, nil, + nil, 66, nil, 72, nil, nil, 52, 76, nil, nil, + 62, nil, nil, 84, 45, 75, 54, 57, 56, 59, + nil, nil, 66, nil, nil, nil, nil, 52, 76, nil, + nil, 62, nil, nil, 84, 72, 75, 54, 57, nil, + nil, nil, nil, nil, nil, nil, 45, 75, 54, 57, + 56, 59, nil, nil, 66, nil, 72, nil, nil, 52, + 76, nil, nil, 62, nil, nil, 84, 45, 75, 54, + 57, 56, 59, nil, nil, 66, nil, nil, 45, nil, + 52, 76, 56, 116, 62, nil, 66, 84, 72, nil, + nil, 111, 75, 54, 57, 62, nil, nil, nil, 45, + nil, nil, nil, 56, 59, nil, nil, 66, 75, 54, + 57, 141, 52, 76, nil, nil, 62, nil, nil, 84, + nil, nil, nil, 45, 75, 54, 57, 56, 59, nil, + nil, 66, nil, nil, nil, nil, 52, nil, nil, 45, + 62, nil, nil, 56, 59, nil, nil, 66, 75, 54, + 57, nil, 52, nil, nil, 45, 62, nil, nil, 56, + 59, nil, nil, 66, 75, 54, 57, nil, 52, nil, + nil, nil, 62, nil, 75, 54, 57, nil, nil, 45, + 75, 54, 57, 56, 59, nil, nil, 66, nil, nil, + nil, nil, 52, nil, nil, 45, 62, nil, nil, 56, + 59, nil, nil, 66, nil, 45, nil, nil, 52, 56, + 59, 45, 62, 66, nil, 56, 59, nil, 52, 66, + nil, nil, 62, nil, 52, 75, 54, 57, 62, nil, + nil, 51, 54, 57, nil, nil, nil, nil, nil, nil, + nil, 75, 54, 57, nil, nil, nil, 75, 54, 57, + nil, 48, nil, nil, nil, nil, 45, 75, 54, 57, + 56, 59, 45, nil, 66, nil, 56, 59, nil, 52, + 66, nil, 45, 62, 49, 52, 56, 59, 45, 62, + 66, nil, 56, 195, nil, 52, 66, nil, 45, 62, + nil, 111, 56, 59, nil, 62, 66, 54, 57, 54, + 57, 52, nil, nil, nil, 62, nil, nil, nil, nil, + nil, nil, nil, 54, 57, 54, 57, nil, nil, 281, + nil, nil, nil, nil, nil, nil, nil, 45, nil, 45, + nil, 56, 195, 56, 195, 66, nil, 66, 54, 57, + 111, nil, 111, 45, 62, 45, 62, 56, 195, 56, + 195, 66, nil, 66, nil, 49, 111, nil, 111, nil, + 62, nil, 62, 54, 57, 54, 57, nil, 45, nil, + nil, nil, 56, 195, nil, nil, 66, nil, nil, 54, + 57, 111, nil, nil, nil, 62, 54, 57, nil, 205, + nil, nil, nil, 45, nil, 45, nil, 56, 195, 56, + 195, 66, nil, 66, nil, nil, 111, nil, 111, 45, + 62, nil, 62, 56, 195, nil, 45, 66, 54, 57, + 56, 195, 111, nil, 66, nil, 62, nil, nil, 111, + nil, nil, nil, 62, 54, 57, nil, nil, 131, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 45, nil, + nil, nil, 56, 59, 200, nil, 66, nil, nil, nil, + 49, 52, nil, nil, 45, 62, nil, nil, 56, 59, + nil, nil, 66, 150, 154, nil, 49, 52, nil, nil, + nil, 62, 146, 148, 151, 153, 150, 154, nil, nil, + nil, nil, nil, nil, 209, 146, 148, 151, 153, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + 156, 157, 158, 144, 145, 147, nil, nil, nil, 149, + 152, 150, 154, 156, 157, 158, 144, 145, 147, nil, + 146, 148, 151, 153, 150, 154, nil, nil, nil, nil, + nil, nil, nil, 146, 148, 151, 153, nil, nil, nil, + nil, nil, nil, nil, 149, 152, nil, nil, 156, 157, + 158, 144, 145, 147, nil, nil, 293, nil, 152, 150, + 154, 156, 157, 158, 144, 145, 147, nil, 146, 148, + 151, 153, nil, nil, nil, nil, nil, 16, nil, 23, + 27, 291, 1, 5, nil, 10, nil, 13, nil, 20, + nil, 28, 149, 152, 4, 8, 156, 157, 158, 144, + 145, 147, 16, 290, 23, 27, nil, 1, 5, nil, + 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, + 8, nil, 268, nil, 16, nil, 23, 27, nil, 1, + 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, + nil, 4, 8, 16, 305, 23, 27, nil, 1, 5, + nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, + 4, 8, nil, 310, nil, 16, nil, 23, 27, nil, + 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, + nil, nil, 4, 8, 16, 262, 23, 27, nil, 1, + 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, + nil, 4, 8, nil, 312, nil, 16, nil, 23, 27, + nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, + 28, nil, nil, 4, 8, 16, 255, 23, 27, nil, + 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, + nil, nil, 4, 8, nil, 313, nil, 16, nil, 23, + 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, + nil, 28, nil, nil, 4, 8, 16, nil, 23, 27, + nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, + 28, nil, nil, 4, 8, 16, nil, 23, 27, nil, + 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, + nil, nil, 4, 8, 16, nil, 23, 27, nil, 1, + 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, + nil, 4, 8, 16, nil, 23, 27, nil, 1, 5, + nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, + 4, 8, 16, nil, 23, 27, nil, 1, 5, nil, + 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, + 8 ] racc_action_check = [ - 228, 228, 228, 207, 111, 44, 54, 54, 54, 36, - 241, 195, 83, 119, 201, 241, 168, 168, 168, 195, - 63, 30, 92, 92, 92, 30, 119, 201, 207, 207, - 44, 228, 46, 46, 46, 228, 228, 54, 30, 228, - 63, 54, 54, 82, 228, 54, 111, 168, 228, 149, - 54, 168, 168, 92, 54, 168, 85, 92, 92, 128, - 168, 92, 30, 46, 168, 80, 92, 46, 46, 75, - 92, 46, 167, 167, 167, 95, 46, 149, 149, 147, - 46, 153, 166, 166, 166, 96, 95, 105, 105, 153, - 147, 95, 18, 18, 18, 147, 96, 6, 20, 20, - 20, 96, 133, 167, 6, 6, 126, 167, 167, 140, - 133, 167, 18, 166, 140, 125, 167, 166, 166, 142, - 167, 166, 105, 18, 144, 105, 166, 18, 18, 20, - 166, 18, 5, 20, 20, 18, 18, 20, 145, 5, - 18, 210, 20, 22, 22, 22, 20, 1, 1, 242, - 242, 242, 210, 146, 12, 12, 26, 210, 123, 238, - 238, 238, 74, 26, 156, 34, 34, 34, 156, 156, - 104, 104, 139, 139, 22, 33, 33, 33, 22, 22, - 242, 122, 22, 121, 242, 242, 73, 22, 242, 12, - 238, 22, 12, 242, 238, 238, 34, 242, 238, 72, - 34, 34, 164, 238, 34, 104, 33, 238, 104, 34, - 33, 33, 165, 34, 33, 190, 190, 190, 71, 33, - 230, 230, 70, 33, 69, 77, 77, 77, 77, 24, - 24, 101, 50, 50, 101, 136, 169, 170, 101, 136, - 136, 171, 235, 235, 172, 174, 190, 178, 138, 138, - 190, 190, 50, 66, 190, 185, 77, 188, 64, 190, - 77, 77, 50, 190, 77, 58, 50, 50, 120, 77, - 50, 55, 235, 77, 50, 50, 235, 235, 138, 50, - 235, 199, 138, 138, 200, 235, 138, 132, 132, 235, - 118, 138, 203, 260, 260, 138, 53, 206, 52, 86, - 49, 45, 38, 213, 213, 84, 227, 29, 107, 233, - 234, 27, 106, 212, 212, 88, 89, 132, 17, 131, - 131, 132, 132, 260, 248, 132, 250, 260, 260, 132, - 132, 260, 251, 213, 132, 253, 260, 213, 213, 131, - 260, 213, 254, 212, 179, 179, 213, 212, 212, 131, - 213, 212, 15, 131, 131, 261, 212, 131, 262, 263, - 212, 131, 131, 102, 129, 129, 131, 129, 91, 94, - 130, 197, 197, nil, 179, 197, nil, nil, 179, 179, - nil, nil, 179, nil, nil, nil, nil, 179, nil, nil, - nil, 179, nil, nil, 129, nil, 276, nil, 129, 129, - nil, 197, 129, nil, nil, 197, 197, 129, nil, 197, - nil, 129, nil, nil, 197, 218, nil, 276, 197, 276, - 276, nil, 276, 276, nil, 276, nil, 276, nil, 276, - nil, 276, nil, nil, 276, 276, 218, 204, 218, 218, - nil, 218, 218, nil, 218, nil, 218, nil, 218, nil, - 218, nil, nil, 218, 218, nil, 244, nil, 204, nil, - 204, 204, nil, 204, 204, nil, 204, nil, 204, nil, - 204, nil, 204, nil, nil, 204, 204, 244, 193, 244, - 244, nil, 244, 244, nil, 244, nil, 244, nil, 244, - nil, 244, nil, nil, 244, 244, nil, 275, nil, 193, - nil, 193, 193, nil, 193, 193, nil, 193, nil, 193, - nil, 193, nil, 193, nil, nil, 193, 193, 275, 265, - 275, 275, nil, 275, 275, nil, 275, nil, 275, nil, - 275, nil, 275, nil, nil, 275, 275, nil, 163, nil, - 265, nil, 265, 265, nil, 265, 265, nil, 265, nil, - 265, nil, 265, nil, 265, nil, nil, 265, 265, 163, - 160, 163, 163, nil, 163, 163, nil, 163, nil, 163, - nil, 163, nil, 163, nil, nil, 163, 163, nil, 216, - nil, 160, nil, 160, 160, nil, 160, 160, nil, 160, - nil, 160, nil, 160, nil, 160, nil, nil, 160, 160, - 216, nil, 216, 216, nil, 216, 216, nil, 216, nil, - 216, nil, 216, nil, 216, nil, nil, 216, 216, 273, - nil, 273, 273, nil, 273, 273, nil, 273, nil, 273, - nil, 273, nil, 273, nil, nil, 273, 273, 32, nil, - 32, 32, nil, 32, 32, nil, 32, nil, 32, nil, - 32, nil, 32, nil, nil, 32, 32, 137, nil, 137, - 137, nil, 137, 137, nil, 137, nil, 137, nil, 137, - nil, 137, nil, nil, 137, 137, 0, nil, 0, 0, - nil, 0, 0, nil, 0, nil, 0, nil, 0, nil, - 0, nil, nil, 0, 0 ] + 33, 33, 33, 231, 105, 129, 129, 241, 17, 170, + 59, 116, 17, 171, 288, 241, 246, 171, 171, 288, + 33, 158, 158, 158, 116, 17, 10, 10, 231, 231, + 59, 33, 126, 126, 42, 33, 33, 170, 170, 33, + 129, 158, 220, 129, 33, 33, 105, 92, 33, 17, + 220, 33, 158, 144, 144, 144, 158, 158, 92, 42, + 158, 10, 161, 92, 10, 158, 158, 126, 160, 158, + 126, 175, 158, 144, 76, 76, 76, 247, 220, 220, + 220, 220, 220, 220, 144, 134, 23, 23, 144, 144, + 247, 165, 144, 134, 76, 223, 77, 144, 144, 165, + 162, 144, 71, 223, 144, 76, 145, 145, 145, 76, + 76, 162, 179, 76, 27, 180, 162, 108, 76, 76, + 108, 27, 76, 5, 108, 76, 145, 72, 72, 72, + 5, 223, 223, 223, 223, 223, 223, 145, 70, 140, + 185, 145, 145, 140, 140, 145, 68, 72, 221, 187, + 145, 145, 188, 90, 145, 189, 221, 145, 72, 154, + 154, 154, 72, 72, 90, 174, 72, 173, 173, 90, + 174, 72, 72, 1, 1, 72, 265, 265, 72, 154, + 84, 84, 84, 67, 221, 221, 221, 221, 221, 221, + 154, 227, 227, 195, 154, 154, 226, 226, 154, 198, + 84, 218, 199, 154, 154, 65, 234, 154, 206, 218, + 154, 84, 16, 16, 16, 84, 84, 234, 63, 84, + 159, 79, 234, 80, 84, 84, 61, 60, 84, 81, + 58, 84, 16, 146, 146, 146, 53, 218, 218, 218, + 218, 218, 218, 16, 52, 82, 50, 16, 16, 87, + 89, 16, 230, 146, 24, 94, 16, 16, 95, 36, + 16, 24, 24, 16, 146, 97, 35, 99, 146, 146, + 85, 244, 146, 217, 217, 217, 217, 146, 146, 85, + 85, 146, 245, 78, 146, 106, 28, 109, 85, 85, + 85, 85, 260, 112, 153, 153, 153, 224, 224, 224, + 224, 224, 224, 216, 216, 216, 216, 216, 216, 113, + 133, 268, 85, 85, 153, 271, 85, 85, 85, 85, + 85, 85, 273, 274, 275, 153, 152, 152, 152, 153, + 153, 277, 282, 153, 215, 215, 215, 215, 153, 153, + 114, 15, 153, 130, 127, 153, 152, 147, 147, 147, + 6, 125, 295, 296, 299, 2, 119, 152, 118, 115, + nil, 152, 152, nil, nil, 152, nil, 147, nil, nil, + 152, 152, nil, nil, 152, nil, nil, 152, 147, 148, + 148, 148, 147, 147, nil, nil, 147, nil, nil, nil, + nil, 147, 147, nil, nil, 147, nil, nil, 147, 148, + 149, 149, 149, nil, nil, nil, nil, nil, nil, nil, + 148, nil, nil, nil, 148, 148, nil, nil, 148, nil, + 149, nil, nil, 148, 148, nil, nil, 148, nil, nil, + 148, 149, 156, 156, 156, 149, 149, nil, nil, 149, + nil, nil, nil, nil, 149, 149, nil, nil, 149, nil, + nil, 149, 156, 34, 34, 34, nil, nil, nil, nil, + nil, nil, nil, 156, nil, nil, nil, 156, 156, nil, + nil, 156, nil, 34, nil, nil, 156, 156, nil, nil, + 156, nil, nil, 156, 34, 151, 151, 151, 34, 34, + nil, nil, 34, nil, nil, nil, nil, 34, 34, nil, + nil, 34, nil, nil, 34, 151, 150, 150, 150, nil, + nil, nil, nil, nil, nil, nil, 151, 38, 38, 38, + 151, 151, nil, nil, 151, nil, 150, nil, nil, 151, + 151, nil, nil, 151, nil, nil, 151, 150, 157, 157, + 157, 150, 150, nil, nil, 150, nil, nil, 38, nil, + 150, 150, 38, 38, 150, nil, 38, 150, 157, nil, + nil, 38, 177, 177, 177, 38, nil, nil, nil, 157, + nil, nil, nil, 157, 157, nil, nil, 157, 75, 75, + 75, 75, 157, 157, nil, nil, 157, nil, nil, 157, + nil, nil, nil, 177, 51, 51, 51, 177, 177, nil, + nil, 177, nil, nil, nil, nil, 177, nil, nil, 75, + 177, nil, nil, 75, 75, nil, nil, 75, 285, 285, + 285, nil, 75, nil, nil, 51, 75, nil, nil, 51, + 51, nil, nil, 51, 266, 266, 266, nil, 51, nil, + nil, nil, 51, nil, 88, 88, 88, nil, nil, 285, + 178, 178, 178, 285, 285, nil, nil, 285, nil, nil, + nil, nil, 285, nil, nil, 266, 285, nil, nil, 266, + 266, nil, nil, 266, nil, 88, nil, nil, 266, 88, + 88, 178, 266, 88, nil, 178, 178, nil, 88, 178, + nil, nil, 88, nil, 178, 20, 20, 20, 178, nil, + nil, 13, 13, 13, nil, nil, nil, nil, nil, nil, + nil, 210, 210, 210, nil, nil, nil, 186, 186, 186, + nil, 13, nil, nil, nil, nil, 20, 284, 284, 284, + 20, 20, 13, nil, 20, nil, 13, 13, nil, 20, + 13, nil, 210, 20, 13, 13, 210, 210, 186, 13, + 210, nil, 186, 186, nil, 210, 186, nil, 284, 210, + nil, 186, 284, 284, nil, 186, 284, 205, 205, 283, + 283, 284, nil, nil, nil, 284, nil, nil, nil, nil, + nil, nil, nil, 132, 132, 239, 239, nil, nil, 239, + nil, nil, nil, nil, nil, nil, nil, 205, nil, 283, + nil, 205, 205, 283, 283, 205, nil, 283, 233, 233, + 205, nil, 283, 132, 205, 239, 283, 132, 132, 239, + 239, 132, nil, 239, nil, 132, 132, nil, 239, nil, + 132, nil, 239, 294, 294, 232, 232, nil, 233, nil, + nil, nil, 233, 233, nil, nil, 233, nil, nil, 172, + 172, 233, nil, nil, nil, 233, 136, 136, nil, 136, + nil, nil, nil, 294, nil, 232, nil, 294, 294, 232, + 232, 294, nil, 232, nil, nil, 294, nil, 232, 172, + 294, nil, 232, 172, 172, nil, 136, 172, 48, 48, + 136, 136, 172, nil, 136, nil, 172, nil, nil, 136, + nil, nil, nil, 136, 135, 135, nil, nil, 48, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 48, nil, + nil, nil, 48, 48, 135, nil, 48, nil, nil, nil, + 48, 48, nil, nil, 135, 48, nil, nil, 135, 135, + nil, nil, 135, 222, 222, nil, 135, 135, nil, nil, + nil, 135, 222, 222, 222, 222, 138, 138, nil, nil, + nil, nil, nil, nil, 138, 138, 138, 138, 138, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + 222, 222, 222, 222, 222, 222, nil, nil, nil, 138, + 138, 101, 101, 138, 138, 138, 138, 138, 138, nil, + 101, 101, 101, 101, 219, 219, nil, nil, nil, nil, + nil, nil, nil, 219, 219, 219, 219, nil, nil, nil, + nil, nil, nil, nil, 101, 101, nil, nil, 101, 101, + 101, 101, 101, 101, nil, nil, 261, nil, 219, 102, + 102, 219, 219, 219, 219, 219, 219, nil, 102, 102, + 102, 102, nil, nil, nil, nil, nil, 261, nil, 261, + 261, 254, 261, 261, nil, 261, nil, 261, nil, 261, + nil, 261, 102, 102, 261, 261, 102, 102, 102, 102, + 102, 102, 254, 249, 254, 254, nil, 254, 254, nil, + 254, nil, 254, nil, 254, nil, 254, nil, nil, 254, + 254, nil, 225, nil, 249, nil, 249, 249, nil, 249, + 249, nil, 249, nil, 249, nil, 249, nil, 249, nil, + nil, 249, 249, 225, 289, 225, 225, nil, 225, 225, + nil, 225, nil, 225, nil, 225, nil, 225, nil, nil, + 225, 225, nil, 300, nil, 289, nil, 289, 289, nil, + 289, 289, nil, 289, nil, 289, nil, 289, nil, 289, + nil, nil, 289, 289, 300, 191, 300, 300, nil, 300, + 300, nil, 300, nil, 300, nil, 300, nil, 300, nil, + nil, 300, 300, nil, 309, nil, 191, nil, 191, 191, + nil, 191, 191, nil, 191, nil, 191, nil, 191, nil, + 191, nil, nil, 191, 191, 309, 184, 309, 309, nil, + 309, 309, nil, 309, nil, 309, nil, 309, nil, 309, + nil, nil, 309, 309, nil, 311, nil, 184, nil, 184, + 184, nil, 184, 184, nil, 184, nil, 184, nil, 184, + nil, 184, nil, nil, 184, 184, 311, nil, 311, 311, + nil, 311, 311, nil, 311, nil, 311, nil, 311, nil, + 311, nil, nil, 311, 311, 308, nil, 308, 308, nil, + 308, 308, nil, 308, nil, 308, nil, 308, nil, 308, + nil, nil, 308, 308, 155, nil, 155, 155, nil, 155, + 155, nil, 155, nil, 155, nil, 155, nil, 155, nil, + nil, 155, 155, 19, nil, 19, 19, nil, 19, 19, + nil, 19, nil, 19, nil, 19, nil, 19, nil, nil, + 19, 19, 0, nil, 0, 0, nil, 0, 0, nil, + 0, nil, 0, nil, 0, nil, 0, nil, nil, 0, + 0 ] racc_action_pointer = [ - 648, 134, nil, nil, nil, 94, 59, nil, nil, nil, - nil, nil, 151, nil, nil, 346, nil, 312, 90, nil, - 96, nil, 141, nil, 226, nil, 118, 269, nil, 307, - 19, nil, 610, 173, 163, nil, -26, nil, 296, nil, - nil, nil, nil, nil, -5, 263, 30, nil, nil, 279, - 229, nil, 277, 275, 4, 269, nil, nil, 244, nil, - nil, nil, nil, 18, 248, nil, 243, nil, nil, 203, - 201, 216, 178, 165, 141, 48, nil, 223, nil, nil, - 44, nil, 37, -9, 284, 35, 293, nil, 305, 294, - nil, 368, 20, nil, 331, 53, 63, nil, nil, nil, - nil, 193, 357, nil, 167, 84, 306, 298, nil, nil, - nil, -5, nil, nil, nil, nil, nil, nil, 269, 4, - 229, 162, 171, 137, nil, 94, 88, nil, 36, 361, - 365, 316, 284, 64, nil, nil, 230, 629, 245, 169, - 76, nil, 113, nil, 119, 129, 143, 57, nil, 29, - nil, nil, nil, 65, nil, nil, 120, nil, nil, nil, - 553, nil, nil, 531, 195, 174, 80, 70, 14, 229, - 230, 203, 206, nil, 236, nil, nil, nil, 225, 341, - nil, nil, nil, nil, nil, 232, nil, nil, 255, nil, - 213, nil, nil, 471, nil, 1, nil, 368, nil, 268, - 261, 4, nil, 279, 430, nil, 290, -20, nil, nil, - 119, nil, 310, 300, nil, nil, 572, nil, 408, nil, - nil, nil, nil, nil, nil, nil, nil, 296, -2, nil, - 211, nil, nil, 280, 304, 239, nil, nil, 157, nil, - nil, -23, 147, nil, 449, nil, nil, nil, 303, nil, - 305, 311, nil, 314, 321, nil, nil, nil, nil, nil, - 290, 348, 351, 353, nil, 512, nil, nil, nil, nil, - nil, nil, nil, 591, nil, 490, 389, nil, nil ] + 1294, 160, 349, nil, nil, 85, 344, nil, nil, nil, + 23, nil, nil, 699, nil, 341, 210, 6, nil, 1275, + 693, nil, nil, 83, 216, nil, nil, 76, 244, nil, + nil, nil, nil, -2, 451, 228, 224, nil, 515, nil, + nil, nil, 24, nil, nil, nil, nil, nil, 885, nil, + 236, 592, 242, 226, nil, nil, nil, nil, 209, 8, + 206, 224, nil, 197, nil, 184, nil, 162, 125, nil, + 117, 102, 125, nil, nil, 576, 72, 75, 262, 200, + 202, 208, 224, nil, 178, 264, nil, 228, 642, 212, + 131, nil, 25, nil, 249, 248, nil, 259, nil, 245, + nil, 976, 1024, nil, nil, -5, 275, nil, 79, 281, + nil, nil, 254, 288, 330, 338, 2, nil, 337, 338, + nil, nil, nil, nil, nil, 330, 29, 338, nil, 2, + 320, nil, 780, 305, 47, 901, 853, nil, 941, nil, + 134, nil, nil, nil, 51, 104, 231, 345, 377, 398, + 504, 483, 324, 292, 157, 1256, 430, 536, 19, 215, + 58, 53, 78, nil, nil, 75, nil, nil, nil, nil, + -11, -31, 846, 164, 132, 65, nil, 560, 648, 105, + 77, nil, nil, nil, 1199, 133, 715, 142, 114, 117, + nil, 1158, nil, nil, nil, 171, nil, nil, 197, 179, + nil, nil, nil, nil, nil, 764, 199, nil, nil, nil, + 709, nil, nil, nil, nil, 282, 251, 221, 185, 989, + 26, 132, 928, 79, 245, 1095, 142, 137, nil, nil, + 245, -20, 832, 805, 184, nil, nil, nil, nil, 782, + nil, -3, nil, nil, 258, 269, -7, 67, nil, 1076, + nil, nil, nil, nil, 1054, nil, nil, nil, nil, nil, + 282, 1029, nil, nil, nil, 167, 632, nil, 282, nil, + nil, 294, nil, 301, 302, 303, nil, 310, nil, nil, + nil, nil, 326, 766, 725, 616, nil, nil, -19, 1117, + nil, nil, nil, nil, 830, 345, 346, nil, nil, 348, + 1136, nil, nil, nil, nil, nil, nil, nil, 1237, 1177, + nil, 1218, nil, nil ] racc_action_default = [ - -150, -174, -14, -2, -143, -174, -174, -15, -3, -141, - -16, -5, -174, -17, -6, -174, -7, -174, -142, -8, - -174, -9, -174, -10, -174, -11, -174, -40, -12, -174, - -174, -13, -1, -174, -174, -142, -150, -39, -174, -144, - -148, -147, -146, -149, -150, -79, -72, -167, -130, -28, - -174, -32, -29, -174, -174, -63, -30, -102, -31, -104, - -103, -33, -20, -62, -21, -61, -22, -23, -131, -25, - -26, -174, -27, -99, -93, -98, -96, -174, -110, -94, - -90, -97, -174, -91, -95, -92, -174, -132, -134, -150, - -41, -174, -174, -42, -72, -150, -150, -4, -70, -71, - -163, -174, -174, -161, -174, -174, -174, -172, -77, -78, - -80, -174, -129, -128, -69, -67, -63, -73, -64, -62, - -59, -65, -172, -68, -57, -66, -174, -19, -174, -174, - -174, -174, -174, -174, -82, -169, -174, -174, -174, -174, - -151, -152, -174, 279, -174, -174, -172, -150, -45, -174, - -46, -62, -48, -174, -55, -54, -174, -164, -165, -166, - -174, -162, -145, -174, -174, -173, -174, -174, -60, -174, - -174, -173, -72, -18, -174, -126, -118, -119, -62, -174, - -124, -127, -125, -105, -101, -174, -24, -34, -174, -168, - -174, -170, -171, -174, -112, -174, -116, -174, -133, -160, - -174, -174, -155, -158, -174, -106, -174, -174, -51, -50, - -174, -44, -174, -174, -43, -138, -174, -140, -174, -38, - -81, -76, -75, -58, -35, -36, -74, -172, -174, -121, - -172, -100, -83, -108, -174, -174, -113, -111, -174, -153, - -154, -174, -174, -136, -174, -37, -49, -47, -87, -88, - -84, -85, -52, -89, -86, -53, -137, -139, -56, -123, - -174, -174, -171, -174, -107, -174, -117, -159, -156, -157, - -135, -122, -120, -174, -115, -174, -174, -114, -109 ] + -167, -191, -191, -7, -160, -191, -191, -8, -158, -9, + -191, -10, -11, -159, -12, -191, -191, -191, -13, -1, + -191, -14, -2, -191, -191, -15, -3, -191, -40, -16, + -5, -17, -6, -191, -191, -79, -167, -159, -72, -165, + -164, -163, -167, -161, -166, -184, -33, -20, -191, -32, + -21, -191, -63, -22, -102, -23, -104, -103, -25, -62, + -26, -191, -61, -27, -147, -28, -148, -29, -191, -30, + -31, -191, -191, -110, -97, -191, -191, -91, -95, -92, + -99, -93, -98, -96, -191, -191, -94, -90, -191, -72, + -167, -42, -167, -4, -191, -151, -149, -191, -39, -167, + -41, -70, -71, -78, -80, -191, -189, -77, -191, -191, + -180, -63, -59, -65, -189, -68, -62, -57, -66, -191, + -146, -145, -69, -67, -73, -64, -191, -191, -178, -191, + -191, -19, -191, -191, -191, -191, -191, 314, -191, -82, + -191, -186, -124, -117, -191, -191, -191, -191, -191, -191, + -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, + -189, -191, -167, -46, -48, -191, -55, -62, -54, -45, + -191, -191, -191, -191, -168, -191, -169, -191, -191, -191, + -190, -181, -182, -183, -191, -191, -60, -191, -190, -72, + -179, -191, -162, -18, -24, -62, -105, -34, -191, -191, + -101, -136, -141, -144, -142, -191, -191, -143, -135, -127, + -191, -185, -187, -188, -113, -115, -119, -116, -121, -126, + -123, -120, -125, -122, -118, -191, -111, -112, -114, -106, + -191, -191, -191, -191, -191, -51, -50, -44, -43, -191, + -129, -191, -133, -150, -177, -175, -191, -191, -172, -191, + -76, -75, -38, -81, -191, -155, -35, -58, -36, -74, + -189, -191, -157, -100, -138, -189, -191, -83, -108, -37, + -49, -85, -52, -89, -86, -87, -88, -84, -53, -47, + -130, -128, -191, -191, -191, -191, -170, -171, -191, -191, + -153, -154, -56, -156, -191, -191, -188, -140, -107, -191, + -191, -134, -176, -174, -173, -152, -139, -137, -191, -191, + -132, -191, -131, -109 ] racc_goto_table = [ - 30, 32, 56, 108, 174, 97, 38, 110, 52, 39, - 122, 177, 62, 196, 190, 3, 202, 114, 194, 29, - 58, 124, 149, 156, 164, 247, 87, 136, 36, 93, - 115, 82, 30, 264, 56, 197, 113, 252, 255, 170, - 52, 107, 169, 176, 128, 120, 230, 88, 118, 89, - 142, 100, 58, 102, 174, 44, 106, 186, 146, 103, - 49, 229, 200, 206, 201, 37, 157, nil, nil, nil, - nil, 61, 196, 81, 207, 81, nil, 236, nil, nil, - nil, nil, nil, nil, nil, nil, 81, 81, 112, nil, - nil, nil, 49, nil, nil, nil, nil, nil, nil, nil, - nil, 161, 162, 61, 141, nil, nil, 81, 260, nil, - 266, nil, nil, nil, nil, 56, 56, 268, 72, 113, - nil, 52, 52, 108, 158, 185, nil, 220, 113, 226, - 81, 175, nil, 58, 58, 174, 227, 30, 193, 114, - 175, 198, 271, 223, 258, 81, 125, 261, nil, nil, - 72, nil, 115, nil, nil, nil, nil, nil, 113, nil, - 30, 216, nil, 30, 218, nil, 97, nil, nil, 113, - 118, 112, nil, 49, 49, nil, nil, nil, nil, 70, - 112, 175, nil, nil, 61, nil, 187, 113, nil, 97, - nil, 97, nil, 30, nil, nil, 249, 249, nil, 175, - nil, nil, 113, 113, 30, 244, nil, 123, nil, nil, - 112, 70, nil, nil, 250, 250, 30, 97, 30, 81, - 81, 112, nil, nil, nil, 113, nil, nil, nil, 182, - nil, 72, 72, nil, nil, nil, nil, 175, 182, 112, - nil, nil, nil, 81, 30, nil, nil, nil, 97, 97, - 113, nil, nil, nil, 248, 248, 155, 155, nil, nil, - nil, nil, 175, nil, nil, 30, 275, nil, 125, 78, - nil, 86, 69, 30, 276, 30, 30, 112, nil, 182, - nil, 81, 98, 99, nil, nil, nil, nil, nil, nil, - 181, 81, 70, 70, nil, 81, nil, 182, nil, 181, - 121, nil, 112, 130, 69, nil, nil, nil, 155, 73, - nil, 73, 254, 254, nil, nil, nil, nil, nil, nil, - nil, nil, 73, 73, nil, nil, 134, nil, nil, 123, - nil, nil, nil, nil, nil, 182, nil, nil, nil, nil, - 181, 144, nil, 73, nil, nil, nil, nil, nil, 154, - 154, nil, nil, nil, nil, nil, nil, nil, 181, nil, - 182, nil, nil, nil, nil, nil, 73, nil, nil, nil, - nil, 155, nil, 253, 253, nil, nil, nil, nil, nil, - nil, 73, nil, 180, nil, 69, 69, nil, nil, nil, - nil, nil, 180, nil, nil, nil, 181, nil, nil, nil, - nil, 154, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 221, 222, nil, nil, nil, - nil, 181, 121, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, 180, nil, nil, nil, nil, nil, 232, + 2, 69, 19, 206, 17, 93, 179, 70, 122, 107, + 47, 210, 201, 46, 187, 117, 36, 96, 15, 2, + 114, 43, 22, 17, 64, 248, 123, 170, 97, 171, + 104, 240, 125, 272, 278, 279, 69, 140, 99, 242, + 91, 298, 70, 239, 106, 130, 185, 208, 46, 64, + 63, 112, 265, 95, 175, 109, 42, 127, 110, 64, + 230, 194, 246, 247, 128, 98, 181, nil, nil, nil, + nil, 160, 206, 94, nil, 118, nil, nil, nil, nil, + nil, 264, nil, nil, nil, 63, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 280, 231, + nil, nil, nil, nil, 133, nil, 242, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 182, + 69, 176, nil, 69, nil, nil, 70, nil, 139, 70, + 207, nil, 199, 58, 197, 46, 294, 190, nil, 304, + 192, 159, nil, 64, nil, nil, 64, 64, nil, nil, + 301, nil, nil, nil, 107, 2, 122, 225, 113, 17, + 292, 206, 259, 257, nil, 295, 207, 243, 58, 63, + 306, 260, 63, 204, 123, 253, nil, nil, nil, nil, + 125, nil, nil, 64, 2, nil, 254, nil, 17, nil, + nil, 2, nil, 261, nil, 17, nil, 64, nil, 207, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 204, + 166, 93, 166, 65, nil, nil, 64, nil, nil, nil, + 276, 276, nil, 118, nil, 2, 277, 277, nil, 17, + 250, 251, nil, 207, nil, nil, nil, nil, 120, 67, + 93, nil, 204, 64, 64, nil, nil, 93, 65, 2, + 64, 289, 58, 17, 2, 58, 202, nil, 17, nil, + nil, 2, nil, 267, 121, 17, nil, nil, nil, 274, + 274, nil, nil, nil, 67, 93, 204, 207, nil, nil, + nil, nil, 166, nil, nil, nil, nil, nil, 207, 2, + nil, nil, 202, 17, 64, 93, nil, 93, 60, nil, + 2, nil, 309, nil, 17, 64, 113, nil, 2, 2, + 311, 2, 17, 17, nil, 17, nil, nil, nil, 297, + 204, nil, nil, 115, nil, 202, nil, nil, nil, nil, + nil, 204, 65, 60, nil, 65, 120, 302, 303, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 180, nil, nil, nil, 73, 73, nil, nil, nil, - nil, nil, nil, nil, 154, nil, 251, 251, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 259, nil, 73, - nil, nil, nil, nil, nil, nil, nil, 267, nil, 180, - nil, 269, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 271, 271, 166, nil, nil, nil, 67, 202, + nil, 67, 121, nil, nil, nil, nil, nil, nil, nil, + 85, nil, 120, nil, nil, 168, nil, 168, nil, nil, + nil, nil, nil, nil, nil, nil, 120, 101, 102, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 121, nil, + nil, nil, nil, 202, nil, 120, nil, nil, nil, nil, + nil, nil, 121, nil, 202, nil, nil, 60, nil, nil, + 60, 203, nil, nil, nil, nil, 138, nil, nil, nil, + 142, 121, 275, 275, nil, nil, nil, nil, 143, 120, + nil, nil, nil, nil, nil, nil, nil, 168, nil, nil, + nil, nil, nil, nil, nil, nil, nil, 203, 121, 121, + nil, nil, nil, nil, nil, 121, nil, nil, nil, nil, + nil, 115, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, 120, nil, nil, nil, nil, nil, nil, + 203, nil, nil, nil, 120, nil, nil, nil, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 121, + 226, 227, 228, nil, nil, nil, nil, 273, 273, 168, + 121, nil, nil, nil, 203, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 180, nil, nil, 73, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 73, nil, nil, - nil, 73 ] + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 203, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 203 ] racc_goto_check = [ - 35, 2, 27, 50, 60, 4, 35, 52, 26, 69, - 33, 62, 18, 60, 54, 3, 72, 48, 58, 1, - 28, 45, 39, 39, 34, 40, 28, 53, 30, 38, - 27, 55, 35, 56, 27, 57, 26, 44, 44, 34, - 26, 36, 32, 61, 18, 31, 63, 64, 28, 30, - 65, 3, 28, 66, 60, 67, 68, 21, 33, 3, - 25, 62, 70, 34, 71, 5, 73, nil, nil, nil, - nil, 29, 60, 29, 39, 29, nil, 58, nil, nil, - nil, nil, nil, nil, nil, nil, 29, 29, 25, nil, - nil, nil, 25, nil, nil, nil, nil, nil, nil, nil, - nil, 69, 69, 29, 3, nil, nil, 29, 54, nil, - 60, nil, nil, nil, nil, 27, 27, 72, 24, 26, - nil, 26, 26, 50, 30, 18, nil, 52, 26, 50, - 29, 28, nil, 28, 28, 60, 33, 35, 2, 48, - 28, 28, 62, 45, 34, 29, 24, 34, nil, nil, - 24, nil, 27, nil, nil, nil, nil, nil, 26, nil, - 35, 2, nil, 35, 2, nil, 4, nil, nil, 26, - 28, 25, nil, 25, 25, nil, nil, nil, nil, 23, - 25, 28, nil, nil, 29, nil, 29, 26, nil, 4, - nil, 4, nil, 35, nil, nil, 27, 27, nil, 28, - nil, nil, 26, 26, 35, 2, nil, 23, nil, nil, - 25, 23, nil, nil, 28, 28, 35, 4, 35, 29, - 29, 25, nil, nil, nil, 26, nil, nil, nil, 24, - nil, 24, 24, nil, nil, nil, nil, 28, 24, 25, - nil, nil, nil, 29, 35, nil, nil, nil, 4, 4, - 26, nil, nil, nil, 25, 25, 23, 23, nil, nil, - nil, nil, 28, nil, nil, 35, 2, nil, 24, 49, - nil, 49, 22, 35, 2, 35, 35, 25, nil, 24, - nil, 29, 49, 49, nil, nil, nil, nil, nil, nil, - 23, 29, 23, 23, nil, 29, nil, 24, nil, 23, - 22, nil, 25, 49, 22, nil, nil, nil, 23, 47, - nil, 47, 24, 24, nil, nil, nil, nil, nil, nil, - nil, nil, 47, 47, nil, nil, 49, nil, nil, 23, - nil, nil, nil, nil, nil, 24, nil, nil, nil, nil, - 23, 49, nil, 47, nil, nil, nil, nil, nil, 22, - 22, nil, nil, nil, nil, nil, nil, nil, 23, nil, - 24, nil, nil, nil, nil, nil, 47, nil, nil, nil, - nil, 23, nil, 23, 23, nil, nil, nil, nil, nil, - nil, 47, nil, 22, nil, 22, 22, nil, nil, nil, - nil, nil, 22, nil, nil, nil, 23, nil, nil, nil, - nil, 22, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 49, 49, nil, nil, nil, - nil, 23, 22, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, 22, nil, nil, nil, nil, nil, 49, + 29, 27, 2, 60, 35, 4, 34, 28, 48, 50, + 18, 55, 62, 29, 34, 45, 30, 28, 1, 29, + 33, 69, 3, 35, 47, 72, 27, 39, 35, 39, + 53, 58, 28, 44, 44, 40, 27, 54, 30, 60, + 38, 56, 28, 57, 36, 18, 32, 61, 29, 47, + 24, 31, 63, 64, 65, 66, 67, 68, 3, 47, + 34, 21, 70, 71, 3, 5, 73, nil, nil, nil, + nil, 33, 60, 51, nil, 24, nil, nil, nil, nil, + nil, 62, nil, nil, nil, 24, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 58, 39, + nil, nil, nil, nil, 51, nil, 60, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 30, + 27, 3, nil, 27, nil, nil, 28, nil, 51, 28, + 28, nil, 18, 22, 29, 29, 55, 69, nil, 72, + 69, 51, nil, 47, nil, nil, 47, 47, nil, nil, + 60, nil, nil, nil, 50, 29, 48, 2, 22, 35, + 34, 60, 50, 45, nil, 34, 28, 28, 22, 24, + 62, 33, 24, 24, 27, 53, nil, nil, nil, nil, + 28, nil, nil, 47, 29, nil, 2, nil, 35, nil, + nil, 29, nil, 2, nil, 35, nil, 47, nil, 28, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 24, + 22, 4, 22, 25, nil, nil, 47, nil, nil, nil, + 27, 27, nil, 24, nil, 29, 28, 28, nil, 35, + 51, 51, nil, 28, nil, nil, nil, nil, 25, 26, + 4, nil, 24, 47, 47, nil, nil, 4, 25, 29, + 47, 2, 22, 35, 29, 22, 22, nil, 35, nil, + nil, 29, nil, 51, 26, 35, nil, nil, nil, 24, + 24, nil, nil, nil, 26, 4, 24, 28, nil, nil, + nil, nil, 22, nil, nil, nil, nil, nil, 28, 29, + nil, nil, 22, 35, 47, 4, nil, 4, 23, nil, + 29, nil, 2, nil, 35, 47, 22, nil, 29, 29, + 2, 29, 35, 35, nil, 35, nil, nil, nil, 51, + 24, nil, nil, 23, nil, 22, nil, nil, nil, nil, + nil, 24, 25, 23, nil, 25, 25, 51, 51, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 22, 22, 22, nil, nil, nil, 26, 22, + nil, 26, 26, nil, nil, nil, nil, nil, nil, nil, + 49, nil, 25, nil, nil, 23, nil, 23, nil, nil, + nil, nil, nil, nil, nil, nil, 25, 49, 49, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 26, nil, + nil, nil, nil, 22, nil, 25, nil, nil, nil, nil, + nil, nil, 26, nil, 22, nil, nil, 23, nil, nil, + 23, 23, nil, nil, nil, nil, 49, nil, nil, nil, + 49, 26, 25, 25, nil, nil, nil, nil, 49, 25, + nil, nil, nil, nil, nil, nil, nil, 23, nil, nil, + nil, nil, nil, nil, nil, nil, nil, 23, 26, 26, + nil, nil, nil, nil, nil, 26, nil, nil, nil, nil, + nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, 25, nil, nil, nil, nil, nil, nil, + 23, nil, nil, nil, 25, nil, nil, nil, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 26, + 49, 49, 49, nil, nil, nil, nil, 23, 23, 23, + 26, nil, nil, nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 22, nil, nil, nil, 47, 47, nil, nil, nil, - nil, nil, nil, nil, 22, nil, 22, 22, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 49, nil, 47, - nil, nil, nil, nil, nil, nil, nil, 49, nil, 22, - nil, 49, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 22, nil, nil, 47, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 47, nil, nil, - nil, 47 ] + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 23, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 23 ] racc_goto_pointer = [ - nil, 19, 1, 15, -27, 59, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, -6, nil, - nil, -75, 254, 161, 100, 42, -10, -16, 2, 53, - 23, -1, -78, -36, -83, 0, -4, nil, -1, -73, - -185, nil, nil, nil, -175, -25, nil, 289, -29, 249, - -42, nil, -38, -50, -122, 11, -200, -103, -120, nil, - -125, -86, -118, -133, 23, -39, 17, 43, 12, -3, - -78, -76, -124, -35 ] + nil, 18, 2, 22, -14, 41, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, -3, nil, + nil, -71, 120, 285, 37, 200, 226, -12, -6, 0, + 11, 13, -66, -18, -100, 4, 9, nil, 23, -63, + -199, nil, nil, nil, -199, -23, nil, 11, -30, 354, + -26, 53, nil, -5, -38, -129, -227, -129, -141, nil, + -133, -89, -124, -153, 30, -45, 19, 46, 15, 11, + -112, -111, -149, -42 ] racc_goto_default = [ - nil, nil, nil, 148, 8, 11, 14, 16, 19, 21, - 23, 25, 28, 31, 2, 7, 10, 13, nil, 64, - 66, 67, 83, 84, 85, 74, 75, 79, 80, 15, - 17, nil, nil, nil, nil, 71, nil, 6, nil, nil, - 150, 210, 152, 153, nil, nil, 126, 48, 76, nil, - 117, 109, nil, nil, nil, nil, nil, nil, nil, 195, - 53, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, 169, 26, 30, 32, 3, 7, 9, + 11, 12, 14, 18, 21, 25, 29, 31, nil, 50, + 53, 55, 77, 78, 79, 81, 82, 86, 87, 74, + 6, nil, nil, nil, nil, 61, nil, 24, nil, nil, + 163, 234, 164, 165, nil, nil, 119, 80, 83, nil, + 124, 73, 103, nil, nil, nil, nil, nil, nil, 241, + 68, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ] racc_token_table = { @@ -613,11 +776,18 @@ racc_token_table = { :OR => 48, :AND => 49, :UNDEF => 50, - :PARROW => 51 } + :PARROW => 51, + :PLUS => 52, + :MINUS => 53, + :TIMES => 54, + :DIV => 55, + :LSHIFT => 56, + :RSHIFT => 57, + :UMINUS => 58 } racc_use_result_var = true -racc_nt_base = 52 +racc_nt_base = 59 Racc_arg = [ racc_action_table, @@ -688,6 +858,13 @@ Racc_token_to_s_table = [ 'AND', 'UNDEF', 'PARROW', +'PLUS', +'MINUS', +'TIMES', +'DIV', +'LSHIFT', +'RSHIFT', +'UMINUS', '$start', 'program', 'statements', @@ -737,13 +914,13 @@ Racc_token_to_s_table = [ 'resourcename', 'undef', 'array', -'rvalue', +'expression', 'param', +'rvalue', 'addparam', 'anyparam', 'rvalues', 'comma', -'iftest', 'else', 'caseopts', 'caseopt', @@ -763,13 +940,13 @@ Racc_token_to_s_table = [ 'argument', 'classnameordefault'] -Racc_debug_parser = false +Racc_debug_parser = true ##### racc system variables end ##### # reduce 0 omitted -module_eval <<'.,.,', 'grammar.ra', 30 +module_eval <<'.,.,', 'grammar.ra', 42 def _reduce_1( val, _values, result ) if val[0] # Make sure we always return an array. @@ -793,7 +970,7 @@ module_eval <<'.,.,', 'grammar.ra', 30 # reduce 3 omitted -module_eval <<'.,.,', 'grammar.ra', 46 +module_eval <<'.,.,', 'grammar.ra', 58 def _reduce_4( val, _values, result ) if val[0] and val[1] if val[0].instance_of?(AST::ASTArray) @@ -836,7 +1013,7 @@ module_eval <<'.,.,', 'grammar.ra', 46 # reduce 17 omitted -module_eval <<'.,.,', 'grammar.ra', 69 +module_eval <<'.,.,', 'grammar.ra', 81 def _reduce_18( val, _values, result ) args = aryfy(val[2]) result = ast AST::Function, @@ -847,7 +1024,7 @@ module_eval <<'.,.,', 'grammar.ra', 69 end .,., -module_eval <<'.,.,', 'grammar.ra', 75 +module_eval <<'.,.,', 'grammar.ra', 87 def _reduce_19( val, _values, result ) result = ast AST::Function, :name => val[0], @@ -857,7 +1034,7 @@ module_eval <<'.,.,', 'grammar.ra', 75 end .,., -module_eval <<'.,.,', 'grammar.ra', 82 +module_eval <<'.,.,', 'grammar.ra', 94 def _reduce_20( val, _values, result ) args = aryfy(val[1]) result = ast AST::Function, @@ -874,7 +1051,7 @@ module_eval <<'.,.,', 'grammar.ra', 82 # reduce 23 omitted -module_eval <<'.,.,', 'grammar.ra', 92 +module_eval <<'.,.,', 'grammar.ra', 104 def _reduce_24( val, _values, result ) result = aryfy(val[0], val[2]) result.line = @lexer.line @@ -897,7 +1074,7 @@ module_eval <<'.,.,', 'grammar.ra', 92 # reduce 31 omitted -module_eval <<'.,.,', 'grammar.ra', 105 +module_eval <<'.,.,', 'grammar.ra', 117 def _reduce_32( val, _values, result ) result = ast AST::Name, :value => val[0] result @@ -906,7 +1083,7 @@ module_eval <<'.,.,', 'grammar.ra', 105 # reduce 33 omitted -module_eval <<'.,.,', 'grammar.ra', 116 +module_eval <<'.,.,', 'grammar.ra', 128 def _reduce_34( val, _values, result ) unless val[0].is_a?(AST::ASTArray) val[0] = aryfy(val[0]) @@ -919,7 +1096,7 @@ module_eval <<'.,.,', 'grammar.ra', 116 end .,., -module_eval <<'.,.,', 'grammar.ra', 137 +module_eval <<'.,.,', 'grammar.ra', 149 def _reduce_35( val, _values, result ) array = val[2] if array.instance_of?(AST::ResourceInstance) @@ -943,7 +1120,7 @@ module_eval <<'.,.,', 'grammar.ra', 137 end .,., -module_eval <<'.,.,', 'grammar.ra', 140 +module_eval <<'.,.,', 'grammar.ra', 152 def _reduce_36( val, _values, result ) # This is a deprecated syntax. error "All resource specifications require names" @@ -951,7 +1128,7 @@ module_eval <<'.,.,', 'grammar.ra', 140 end .,., -module_eval <<'.,.,', 'grammar.ra', 143 +module_eval <<'.,.,', 'grammar.ra', 155 def _reduce_37( val, _values, result ) # a defaults setting for a type result = ast(AST::ResourceDefaults, :type => val[0], :params => val[2]) @@ -959,14 +1136,14 @@ module_eval <<'.,.,', 'grammar.ra', 143 end .,., -module_eval <<'.,.,', 'grammar.ra', 148 +module_eval <<'.,.,', 'grammar.ra', 160 def _reduce_38( val, _values, result ) result = ast AST::ResourceOverride, :object => val[0], :params => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 175 +module_eval <<'.,.,', 'grammar.ra', 187 def _reduce_39( val, _values, result ) type = val[0] @@ -994,21 +1171,21 @@ module_eval <<'.,.,', 'grammar.ra', 175 end .,., -module_eval <<'.,.,', 'grammar.ra', 176 +module_eval <<'.,.,', 'grammar.ra', 188 def _reduce_40( val, _values, result ) result = :virtual result end .,., -module_eval <<'.,.,', 'grammar.ra', 177 +module_eval <<'.,.,', 'grammar.ra', 189 def _reduce_41( val, _values, result ) result = :exported result end .,., -module_eval <<'.,.,', 'grammar.ra', 200 +module_eval <<'.,.,', 'grammar.ra', 212 def _reduce_42( val, _values, result ) if val[0] =~ /^[a-z]/ Puppet.warning addcontext("Collection names must now be capitalized") @@ -1031,7 +1208,7 @@ module_eval <<'.,.,', 'grammar.ra', 200 end .,., -module_eval <<'.,.,', 'grammar.ra', 210 +module_eval <<'.,.,', 'grammar.ra', 222 def _reduce_43( val, _values, result ) if val[1] result = val[1] @@ -1043,7 +1220,7 @@ module_eval <<'.,.,', 'grammar.ra', 210 end .,., -module_eval <<'.,.,', 'grammar.ra', 218 +module_eval <<'.,.,', 'grammar.ra', 230 def _reduce_44( val, _values, result ) if val[1] result = val[1] @@ -1059,7 +1236,7 @@ module_eval <<'.,.,', 'grammar.ra', 218 # reduce 46 omitted -module_eval <<'.,.,', 'grammar.ra', 226 +module_eval <<'.,.,', 'grammar.ra', 238 def _reduce_47( val, _values, result ) result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2] result @@ -1068,7 +1245,7 @@ module_eval <<'.,.,', 'grammar.ra', 226 # reduce 48 omitted -module_eval <<'.,.,', 'grammar.ra', 232 +module_eval <<'.,.,', 'grammar.ra', 244 def _reduce_49( val, _values, result ) result = val[1] result.parens = true @@ -1080,7 +1257,7 @@ module_eval <<'.,.,', 'grammar.ra', 232 # reduce 51 omitted -module_eval <<'.,.,', 'grammar.ra', 240 +module_eval <<'.,.,', 'grammar.ra', 252 def _reduce_52( val, _values, result ) result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2] #result = ast AST::CollExpr @@ -1089,7 +1266,7 @@ module_eval <<'.,.,', 'grammar.ra', 240 end .,., -module_eval <<'.,.,', 'grammar.ra', 245 +module_eval <<'.,.,', 'grammar.ra', 257 def _reduce_53( val, _values, result ) result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2] #result = ast AST::CollExpr @@ -1102,7 +1279,7 @@ module_eval <<'.,.,', 'grammar.ra', 245 # reduce 55 omitted -module_eval <<'.,.,', 'grammar.ra', 252 +module_eval <<'.,.,', 'grammar.ra', 264 def _reduce_56( val, _values, result ) result = ast AST::ResourceInstance, :children => [val[0],val[2]] result @@ -1111,7 +1288,7 @@ module_eval <<'.,.,', 'grammar.ra', 252 # reduce 57 omitted -module_eval <<'.,.,', 'grammar.ra', 262 +module_eval <<'.,.,', 'grammar.ra', 274 def _reduce_58( val, _values, result ) if val[0].instance_of?(AST::ResourceInstance) result = ast AST::ASTArray, :children => [val[0],val[2]] @@ -1127,21 +1304,21 @@ module_eval <<'.,.,', 'grammar.ra', 262 # reduce 60 omitted -module_eval <<'.,.,', 'grammar.ra', 269 +module_eval <<'.,.,', 'grammar.ra', 281 def _reduce_61( val, _values, result ) result = ast AST::Undef, :value => :undef result end .,., -module_eval <<'.,.,', 'grammar.ra', 273 +module_eval <<'.,.,', 'grammar.ra', 285 def _reduce_62( val, _values, result ) result = ast AST::Name, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 277 +module_eval <<'.,.,', 'grammar.ra', 289 def _reduce_63( val, _values, result ) result = ast AST::Type, :value => val[0] result @@ -1160,7 +1337,7 @@ module_eval <<'.,.,', 'grammar.ra', 277 # reduce 69 omitted -module_eval <<'.,.,', 'grammar.ra', 293 +module_eval <<'.,.,', 'grammar.ra', 305 def _reduce_70( val, _values, result ) if val[0] =~ /::/ raise Puppet::ParseError, "Cannot assign to variables in other namespaces" @@ -1172,7 +1349,7 @@ module_eval <<'.,.,', 'grammar.ra', 293 end .,., -module_eval <<'.,.,', 'grammar.ra', 298 +module_eval <<'.,.,', 'grammar.ra', 310 def _reduce_71( val, _values, result ) variable = ast AST::Name, :value => val[0] result = ast AST::VarDef, :name => variable, :value => val[2], :append => true @@ -1180,21 +1357,21 @@ module_eval <<'.,.,', 'grammar.ra', 298 end .,., -module_eval <<'.,.,', 'grammar.ra', 303 +module_eval <<'.,.,', 'grammar.ra', 315 def _reduce_72( val, _values, result ) result = ast AST::ASTArray result end .,., -module_eval <<'.,.,', 'grammar.ra', 303 +module_eval <<'.,.,', 'grammar.ra', 315 def _reduce_73( val, _values, result ) result = val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 312 +module_eval <<'.,.,', 'grammar.ra', 324 def _reduce_74( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) @@ -1206,14 +1383,14 @@ module_eval <<'.,.,', 'grammar.ra', 312 end .,., -module_eval <<'.,.,', 'grammar.ra', 316 +module_eval <<'.,.,', 'grammar.ra', 328 def _reduce_75( val, _values, result ) result = ast AST::ResourceParam, :param => val[0], :value => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 321 +module_eval <<'.,.,', 'grammar.ra', 333 def _reduce_76( val, _values, result ) result = ast AST::ResourceParam, :param => val[0], :value => val[2], :add => true @@ -1225,21 +1402,21 @@ module_eval <<'.,.,', 'grammar.ra', 321 # reduce 78 omitted -module_eval <<'.,.,', 'grammar.ra', 329 +module_eval <<'.,.,', 'grammar.ra', 341 def _reduce_79( val, _values, result ) result = ast AST::ASTArray result end .,., -module_eval <<'.,.,', 'grammar.ra', 329 +module_eval <<'.,.,', 'grammar.ra', 341 def _reduce_80( val, _values, result ) result = val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 338 +module_eval <<'.,.,', 'grammar.ra', 350 def _reduce_81( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) @@ -1253,7 +1430,7 @@ module_eval <<'.,.,', 'grammar.ra', 338 # reduce 82 omitted -module_eval <<'.,.,', 'grammar.ra', 347 +module_eval <<'.,.,', 'grammar.ra', 359 def _reduce_83( val, _values, result ) if val[0].instance_of?(AST::ASTArray) result = val[0].push(val[2]) @@ -1296,7 +1473,7 @@ module_eval <<'.,.,', 'grammar.ra', 347 # reduce 99 omitted -module_eval <<'.,.,', 'grammar.ra', 374 +module_eval <<'.,.,', 'grammar.ra', 386 def _reduce_100( val, _values, result ) args = aryfy(val[2]) result = ast AST::Function, @@ -1307,7 +1484,7 @@ module_eval <<'.,.,', 'grammar.ra', 374 end .,., -module_eval <<'.,.,', 'grammar.ra', 379 +module_eval <<'.,.,', 'grammar.ra', 391 def _reduce_101( val, _values, result ) result = ast AST::Function, :name => val[0], @@ -1317,28 +1494,28 @@ module_eval <<'.,.,', 'grammar.ra', 379 end .,., -module_eval <<'.,.,', 'grammar.ra', 383 +module_eval <<'.,.,', 'grammar.ra', 395 def _reduce_102( val, _values, result ) result = ast AST::String, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 385 +module_eval <<'.,.,', 'grammar.ra', 397 def _reduce_103( val, _values, result ) result = ast AST::FlatString, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 389 +module_eval <<'.,.,', 'grammar.ra', 401 def _reduce_104( val, _values, result ) result = ast AST::Boolean, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 394 +module_eval <<'.,.,', 'grammar.ra', 406 def _reduce_105( val, _values, result ) Puppet.warning addcontext("Deprecation notice: Resource references should now be capitalized") result = ast AST::ResourceReference, :type => val[0], :title => val[2] @@ -1346,14 +1523,14 @@ module_eval <<'.,.,', 'grammar.ra', 394 end .,., -module_eval <<'.,.,', 'grammar.ra', 396 +module_eval <<'.,.,', 'grammar.ra', 408 def _reduce_106( val, _values, result ) result = ast AST::ResourceReference, :type => val[0], :title => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 409 +module_eval <<'.,.,', 'grammar.ra', 421 def _reduce_107( val, _values, result ) args = { :test => val[1], @@ -1371,7 +1548,7 @@ module_eval <<'.,.,', 'grammar.ra', 409 # reduce 108 omitted -module_eval <<'.,.,', 'grammar.ra', 414 +module_eval <<'.,.,', 'grammar.ra', 426 def _reduce_109( val, _values, result ) result = ast AST::Else, :statements => val[2] result @@ -1380,8 +1557,127 @@ module_eval <<'.,.,', 'grammar.ra', 414 # reduce 110 omitted -module_eval <<'.,.,', 'grammar.ra', 426 +module_eval <<'.,.,', 'grammar.ra', 443 def _reduce_111( val, _values, result ) + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 446 + def _reduce_112( val, _values, result ) + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 449 + def _reduce_113( val, _values, result ) + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 452 + def _reduce_114( val, _values, result ) + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 455 + def _reduce_115( val, _values, result ) + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 458 + def _reduce_116( val, _values, result ) + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 461 + def _reduce_117( val, _values, result ) + result = ast AST::Minus, :value => val[1] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 464 + def _reduce_118( val, _values, result ) + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 467 + def _reduce_119( val, _values, result ) + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 470 + def _reduce_120( val, _values, result ) + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 473 + def _reduce_121( val, _values, result ) + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 476 + def _reduce_122( val, _values, result ) + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 479 + def _reduce_123( val, _values, result ) + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 482 + def _reduce_124( val, _values, result ) + result = ast AST::Not, :value => val[1] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 485 + def _reduce_125( val, _values, result ) + result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 488 + def _reduce_126( val, _values, result ) + result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 491 + def _reduce_127( val, _values, result ) + result = val[1] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 499 + def _reduce_128( val, _values, result ) options = val[3] unless options.instance_of?(AST::ASTArray) options = ast AST::ASTArray, :children => [val[3]] @@ -1391,10 +1687,10 @@ module_eval <<'.,.,', 'grammar.ra', 426 end .,., - # reduce 112 omitted + # reduce 129 omitted -module_eval <<'.,.,', 'grammar.ra', 436 - def _reduce_113( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 509 + def _reduce_130( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push val[1] result = val[0] @@ -1405,15 +1701,15 @@ module_eval <<'.,.,', 'grammar.ra', 436 end .,., -module_eval <<'.,.,', 'grammar.ra', 440 - def _reduce_114( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 513 + def _reduce_131( val, _values, result ) result = ast AST::CaseOpt, :value => val[0], :statements => val[3] result end .,., -module_eval <<'.,.,', 'grammar.ra', 445 - def _reduce_115( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 518 + def _reduce_132( val, _values, result ) result = ast(AST::CaseOpt, :value => val[0], :statements => ast(AST::ASTArray) @@ -1422,10 +1718,10 @@ module_eval <<'.,.,', 'grammar.ra', 445 end .,., - # reduce 116 omitted + # reduce 133 omitted -module_eval <<'.,.,', 'grammar.ra', 455 - def _reduce_117( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 528 + def _reduce_134( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) result = val[0] @@ -1436,26 +1732,26 @@ module_eval <<'.,.,', 'grammar.ra', 455 end .,., -module_eval <<'.,.,', 'grammar.ra', 459 - def _reduce_118( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 532 + def _reduce_135( val, _values, result ) result = ast AST::Selector, :param => val[0], :values => val[2] result end .,., - # reduce 119 omitted + # reduce 136 omitted -module_eval <<'.,.,', 'grammar.ra', 461 - def _reduce_120( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 534 + def _reduce_137( val, _values, result ) result = val[1] result end .,., - # reduce 121 omitted + # reduce 138 omitted -module_eval <<'.,.,', 'grammar.ra', 472 - def _reduce_122( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 545 + def _reduce_139( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) result = val[0] @@ -1466,50 +1762,50 @@ module_eval <<'.,.,', 'grammar.ra', 472 end .,., -module_eval <<'.,.,', 'grammar.ra', 476 - def _reduce_123( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 549 + def _reduce_140( val, _values, result ) result = ast AST::ResourceParam, :param => val[0], :value => val[2] result end .,., - # reduce 124 omitted + # reduce 141 omitted - # reduce 125 omitted + # reduce 142 omitted - # reduce 126 omitted + # reduce 143 omitted - # reduce 127 omitted + # reduce 144 omitted - # reduce 128 omitted + # reduce 145 omitted - # reduce 129 omitted + # reduce 146 omitted - # reduce 130 omitted + # reduce 147 omitted -module_eval <<'.,.,', 'grammar.ra', 487 - def _reduce_131( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 560 + def _reduce_148( val, _values, result ) result = ast AST::Default, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 489 - def _reduce_132( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 562 + def _reduce_149( val, _values, result ) result = [val[0].value] result end .,., -module_eval <<'.,.,', 'grammar.ra', 493 - def _reduce_133( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 566 + def _reduce_150( val, _values, result ) results = val[0] << val[2].value result end .,., -module_eval <<'.,.,', 'grammar.ra', 501 - def _reduce_134( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 574 + def _reduce_151( val, _values, result ) val[1].each do |file| import(file) end @@ -1519,8 +1815,8 @@ module_eval <<'.,.,', 'grammar.ra', 501 end .,., -module_eval <<'.,.,', 'grammar.ra', 511 - def _reduce_135( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 584 + def _reduce_152( val, _values, result ) newdefine classname(val[1]), :arguments => val[2], :code => val[4] @lexer.indefine = false result = nil @@ -1530,8 +1826,8 @@ module_eval <<'.,.,', 'grammar.ra', 511 end .,., -module_eval <<'.,.,', 'grammar.ra', 515 - def _reduce_136( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 588 + def _reduce_153( val, _values, result ) newdefine classname(val[1]), :arguments => val[2] @lexer.indefine = false result = nil @@ -1539,8 +1835,8 @@ module_eval <<'.,.,', 'grammar.ra', 515 end .,., -module_eval <<'.,.,', 'grammar.ra', 523 - def _reduce_137( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 596 + def _reduce_154( val, _values, result ) # Our class gets defined in the parent namespace, not our own. @lexer.namepop newclass classname(val[1]), :code => val[4], :parent => val[2] @@ -1549,8 +1845,8 @@ module_eval <<'.,.,', 'grammar.ra', 523 end .,., -module_eval <<'.,.,', 'grammar.ra', 528 - def _reduce_138( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 601 + def _reduce_155( val, _values, result ) # Our class gets defined in the parent namespace, not our own. @lexer.namepop newclass classname(val[1]), :parent => val[2] @@ -1559,32 +1855,32 @@ module_eval <<'.,.,', 'grammar.ra', 528 end .,., -module_eval <<'.,.,', 'grammar.ra', 533 - def _reduce_139( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 606 + def _reduce_156( val, _values, result ) newnode val[1], :parent => val[2], :code => val[4] result = nil result end .,., -module_eval <<'.,.,', 'grammar.ra', 536 - def _reduce_140( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 609 + def _reduce_157( val, _values, result ) newnode val[1], :parent => val[2] result = nil result end .,., - # reduce 141 omitted + # reduce 158 omitted - # reduce 142 omitted + # reduce 159 omitted - # reduce 143 omitted + # reduce 160 omitted - # reduce 144 omitted + # reduce 161 omitted -module_eval <<'.,.,', 'grammar.ra', 550 - def _reduce_145( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 623 + def _reduce_162( val, _values, result ) result = val[0] result = [result] unless result.is_a?(Array) result << val[2] @@ -1592,49 +1888,49 @@ module_eval <<'.,.,', 'grammar.ra', 550 end .,., - # reduce 146 omitted + # reduce 163 omitted - # reduce 147 omitted + # reduce 164 omitted - # reduce 148 omitted + # reduce 165 omitted - # reduce 149 omitted + # reduce 166 omitted -module_eval <<'.,.,', 'grammar.ra', 559 - def _reduce_150( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 632 + def _reduce_167( val, _values, result ) result = nil result end .,., -module_eval <<'.,.,', 'grammar.ra', 563 - def _reduce_151( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 636 + def _reduce_168( val, _values, result ) result = ast AST::ASTArray, :children => [] result end .,., - # reduce 152 omitted + # reduce 169 omitted -module_eval <<'.,.,', 'grammar.ra', 568 - def _reduce_153( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 641 + def _reduce_170( val, _values, result ) result = nil result end .,., -module_eval <<'.,.,', 'grammar.ra', 572 - def _reduce_154( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 645 + def _reduce_171( val, _values, result ) result = val[1] result = [result] unless result[0].is_a?(Array) result end .,., - # reduce 155 omitted + # reduce 172 omitted -module_eval <<'.,.,', 'grammar.ra', 579 - def _reduce_156( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 652 + def _reduce_173( val, _values, result ) result = val[0] result = [result] unless result[0].is_a?(Array) result << val[2] @@ -1642,67 +1938,67 @@ module_eval <<'.,.,', 'grammar.ra', 579 end .,., -module_eval <<'.,.,', 'grammar.ra', 584 - def _reduce_157( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 657 + def _reduce_174( val, _values, result ) Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype") result = [val[0], val[2]] result end .,., -module_eval <<'.,.,', 'grammar.ra', 588 - def _reduce_158( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 661 + def _reduce_175( val, _values, result ) Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype") result = [val[0]] result end .,., -module_eval <<'.,.,', 'grammar.ra', 590 - def _reduce_159( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 663 + def _reduce_176( val, _values, result ) result = [val[0], val[2]] result end .,., -module_eval <<'.,.,', 'grammar.ra', 592 - def _reduce_160( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 665 + def _reduce_177( val, _values, result ) result = [val[0]] result end .,., - # reduce 161 omitted + # reduce 178 omitted -module_eval <<'.,.,', 'grammar.ra', 597 - def _reduce_162( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 670 + def _reduce_179( val, _values, result ) result = val[1] result end .,., - # reduce 163 omitted + # reduce 180 omitted -module_eval <<'.,.,', 'grammar.ra', 602 - def _reduce_164( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 675 + def _reduce_181( val, _values, result ) result = val[1] result end .,., - # reduce 165 omitted + # reduce 182 omitted - # reduce 166 omitted + # reduce 183 omitted -module_eval <<'.,.,', 'grammar.ra', 608 - def _reduce_167( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 681 + def _reduce_184( val, _values, result ) result = ast AST::Variable, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 616 - def _reduce_168( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 689 + def _reduce_185( val, _values, result ) if val[1].instance_of?(AST::ASTArray) result = val[1] else @@ -1712,21 +2008,21 @@ module_eval <<'.,.,', 'grammar.ra', 616 end .,., -module_eval <<'.,.,', 'grammar.ra', 618 - def _reduce_169( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 691 + def _reduce_186( val, _values, result ) result = ast AST::ASTArray result end .,., - # reduce 170 omitted + # reduce 187 omitted - # reduce 171 omitted + # reduce 188 omitted - # reduce 172 omitted + # reduce 189 omitted -module_eval <<'.,.,', 'grammar.ra', 623 - def _reduce_173( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 696 + def _reduce_190( val, _values, result ) result = nil result end -- cgit From 99de9208333531d0ad09d266a76d44face71de94 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Wed, 1 Oct 2008 01:42:00 +1000 Subject: Fixed #1620 - Add 'sles' to Puppet confines when 'suse' is used --- lib/puppet/provider/package/rug.rb | 4 ++-- lib/puppet/provider/service/redhat.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/package/rug.rb b/lib/puppet/provider/package/rug.rb index c5451ad71..1e1d6763f 100644 --- a/lib/puppet/provider/package/rug.rb +++ b/lib/puppet/provider/package/rug.rb @@ -5,8 +5,8 @@ Puppet.type(:package).provide :rug, :parent => :rpm do commands :rug => "/usr/bin/rug" commands :rpm => "rpm" - defaultfor :operatingsystem => :suse - confine :operatingsystem => :suse + defaultfor :operatingsystem => [:suse, :sles] + confine :operatingsystem => [:suse, :sles] # Install a package using 'rug'. def install diff --git a/lib/puppet/provider/service/redhat.rb b/lib/puppet/provider/service/redhat.rb index d26f76ebd..faa75476d 100755 --- a/lib/puppet/provider/service/redhat.rb +++ b/lib/puppet/provider/service/redhat.rb @@ -6,7 +6,7 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init do commands :chkconfig => "/sbin/chkconfig", :service => "/sbin/service" - defaultfor :operatingsystem => [:redhat, :fedora, :suse, :centos] + defaultfor :operatingsystem => [:redhat, :fedora, :suse, :centos, :sles] def self.defpath superclass.defpath -- cgit From 4c998fe67d7e82c91d5fefd3c0239cb132e9a16d Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 30 Sep 2008 17:49:18 -0500 Subject: Fixing #1622 - The user type only looks up groups when necessary. Also added a bunch of tests to the user type, and refactored as necessary for this to work. Signed-off-by: Luke Kanies --- lib/puppet/type/user.rb | 71 ++++++++++--------------------------------------- 1 file changed, 14 insertions(+), 57 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index 039bcb7cb..79cd5ff26 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -49,25 +49,6 @@ module Puppet return :absent end end - - # The default 'sync' method only selects among a list of registered - # values. - def sync -# if self.insync? -# self.info "already in sync" -# return nil - #else - #self.info "%s vs %s" % [self.is.inspect, self.should.inspect] -# end - unless self.class.values - self.devfail "No values defined for %s" % - self.class.name - end - - # Set ourselves to whatever our should value is. - self.set(self.should) - end - end newproperty(:uid) do @@ -95,50 +76,26 @@ module Puppet newproperty(:gid) do desc "The user's primary group. Can be specified numerically or by name." - - def found? - defined? @found and @found - end - - munge do |gid| - method = :getgrgid - case gid - when String - if gid =~ /^[-0-9]+$/ - gid = Integer(gid) - else - method = :getgrnam - end - when Symbol - unless gid == :auto or gid == :absent - self.devfail "Invalid GID %s" % gid - end - # these are treated specially by sync() - return gid - end - if group = Puppet::Util.gid(gid) - @found = true - return group + munge do |value| + if value.is_a?(String) and value =~ /^[-0-9]+$/ + Integer(value) else - @found = false - return gid + value end end - # *shudder* Make sure that we've looked up the group and gotten - # an ID for it. Yuck-o. - def should - unless defined? @should - return super - end - unless found? - @should = @should.each { |val| - next unless val - Puppet::Util.gid(val) - } + def sync + found = false + @should.each do |value| + if number = Puppet::Util.gid(value) + provider.gid = number + found = true + break + end end - super + + fail "Could not find group(s) %s" % @should.join(",") unless found end end -- cgit From 2480654aa07dbe6c50777417143a133b1cd94859 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 30 Sep 2008 17:50:31 -0500 Subject: The Netinfo and DirectoryService providers can now create user and group simultaneously. This required selectively using property#sync if a 'should' value is present, so that the user's gid property can do the conversion if necessary. Signed-off-by: Luke Kanies --- lib/puppet/provider/nameservice/directoryservice.rb | 15 ++++++++++++--- lib/puppet/provider/nameservice/netinfo.rb | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/nameservice/directoryservice.rb b/lib/puppet/provider/nameservice/directoryservice.rb index e2e68b2ca..fcc44f9e3 100644 --- a/lib/puppet/provider/nameservice/directoryservice.rb +++ b/lib/puppet/provider/nameservice/directoryservice.rb @@ -206,9 +206,18 @@ class DirectoryService < Puppet::Provider::NameService if ensure_value == :present @resource.class.validproperties.each do |name| next if name == :ensure - next unless val = @resource.should(name) || autogen(name) - # JJM: This calls the method. - self.send(name.to_s + "=", val) + + # LAK: We use property.sync here rather than directly calling + # the settor method because the properties might do some kind + # of conversion. In particular, the user gid property might + # have a string and need to convert it to a number + if @resource.should(name) + @resource.property(name).sync + elsif value = autogen(name) + self.send(name.to_s + "=", value) + else + next + end end end end diff --git a/lib/puppet/provider/nameservice/netinfo.rb b/lib/puppet/provider/nameservice/netinfo.rb index 29600052b..ac7bc94b1 100644 --- a/lib/puppet/provider/nameservice/netinfo.rb +++ b/lib/puppet/provider/nameservice/netinfo.rb @@ -138,8 +138,18 @@ class NetInfo < Puppet::Provider::NameService if arg == :present @resource.class.validproperties.each do |name| next if name == :ensure - next unless val = @resource.should(name) || autogen(name) - self.send(name.to_s + "=", val) + + # LAK: We use property.sync here rather than directly calling + # the settor method because the properties might do some kind + # of conversion. In particular, the user gid property might + # have a string and need to convert it to a number + if @resource.should(name) + @resource.property(name).sync + elsif value = autogen(name) + self.send(name.to_s + "=", value) + else + next + end end end end -- cgit From 679fede620becbe7a9e934718ddf6420e28ec2cc Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 30 Sep 2008 17:51:10 -0500 Subject: Removing commented code from the user type from about 2005 Signed-off-by: Luke Kanies --- lib/puppet/type/user.rb | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index 79cd5ff26..571781d5a 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -191,29 +191,6 @@ module Puppet end end - # these three properties are all implemented differently on each platform, - # so i'm disabling them for now - - # FIXME Puppet::Property::UserLocked is currently non-functional - #newproperty(:locked) do - # desc "The expected return code. An error will be returned if the - # executed command returns something else." - #end - - # FIXME Puppet::Property::UserExpire is currently non-functional - #newproperty(:expire) do - # desc "The expected return code. An error will be returned if the - # executed command returns something else." - # @objectaddflag = "-e" - #end - - # FIXME Puppet::Property::UserInactive is currently non-functional - #newproperty(:inactive) do - # desc "The expected return code. An error will be returned if the - # executed command returns something else." - # @objectaddflag = "-f" - #end - newparam(:name) do desc "User name. While limitations are determined for each operating system, it is generally a good idea to keep to -- cgit From 2afc4f5f159870ae2b8af3fb30037716a659dcf4 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 30 Sep 2008 18:08:55 -0500 Subject: Adding tests for the user retrieve method Signed-off-by: Luke Kanies --- lib/puppet/type/user.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index 571781d5a..bb0a86fd0 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -272,7 +272,7 @@ module Puppet current_value = :absent if absent - prophash[property] = :absent + prophash[property] = :absent else current_value = property.retrieve prophash[property] = current_value @@ -280,7 +280,6 @@ module Puppet if property.name == :ensure and current_value == :absent absent = true -# next end prophash } -- cgit From ee579641f72b399e9e13e989a7779b533004b634 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 30 Sep 2008 22:04:38 -0500 Subject: Modified the behaviour of resource-level 'retrieve' -- it only calls 'retrieve' on each property if the resource exists. Signed-off-by: Luke Kanies --- lib/puppet/type.rb | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index c7a866e2c..1989fc057 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -906,14 +906,24 @@ class Type # get a hash of the current properties. def currentpropvalues(override_value = nil) - # it's important to use the method here, as it follows the order - # in which they're defined in the object + # it's important to use the 'properties' method here, as it follows the order + # in which they're defined in the object. It also guarantees that 'ensure' + # is the first property, which is important for skipping 'retrieve' on + # all the properties if the resource is absent. + ensure_state = false return properties().inject({}) { | prophash, property| - prophash[property] = override_value.nil? ? - property.retrieve : - override_value - prophash - } + if property.name == :ensure + ensure_state = property.retrieve + prophash[property] = ensure_state + else + if ensure_state == :absent + prophash[property] = :absent + else + prophash[property] = property.retrieve + end + end + prophash + } end # Are we running in noop mode? -- cgit From 7da41528e82e5b4d36d4ac33689db0fa92480b3f Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 30 Sep 2008 22:34:05 -0500 Subject: Modified the group and zone resource types to no longer call 'currentpropvalues' as a means of setting all values to absent. There should be no behaviour change from this change. Signed-off-by: Luke Kanies --- lib/puppet/type.rb | 16 +++++++++------- lib/puppet/type/group.rb | 8 -------- lib/puppet/type/zone.rb | 6 +++++- 3 files changed, 14 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 1989fc057..e377a3547 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -901,17 +901,19 @@ class Type # retrieve the current value of all contained properties def retrieve - return currentpropvalues + return currentpropvalues end - # get a hash of the current properties. - def currentpropvalues(override_value = nil) - # it's important to use the 'properties' method here, as it follows the order - # in which they're defined in the object. It also guarantees that 'ensure' + # Get a hash of the current properties. Returns a hash with + # the actual property instance as the key and the current value + # as the, um, value. + def currentpropvalues + # It's important to use the 'properties' method here, as it follows the order + # in which they're defined in the class. It also guarantees that 'ensure' # is the first property, which is important for skipping 'retrieve' on # all the properties if the resource is absent. ensure_state = false - return properties().inject({}) { | prophash, property| + return properties().inject({}) do | prophash, property| if property.name == :ensure ensure_state = property.retrieve prophash[property] = ensure_state @@ -923,7 +925,7 @@ class Type end end prophash - } + end end # Are we running in noop mode? diff --git a/lib/puppet/type/group.rb b/lib/puppet/type/group.rb index 2a5ac30da..cb11a60a4 100755 --- a/lib/puppet/type/group.rb +++ b/lib/puppet/type/group.rb @@ -118,14 +118,6 @@ module Puppet defaultto false end - - def retrieve - if self.provider and @provider.exists? - return super - else - return currentpropvalues(:absent) - end - end end end diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb index 4fd92672c..7601ec47b 100644 --- a/lib/puppet/type/zone.rb +++ b/lib/puppet/type/zone.rb @@ -377,7 +377,11 @@ end result = setstatus(hash) result else - return currentpropvalues(:absent) + # Return all properties as absent. + return properties().inject({}) do | prophash, property| + prophash[property] = :absent + prophash + end end end -- cgit From 63ad84587892e9cab851cf516f7a381c5ea51f90 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 30 Sep 2008 23:19:38 -0500 Subject: Refactoring and adding tests to the file group property. Drastically simplified the class, removing a lot of obsolete code and adding tests for nearly the whole class. Signed-off-by: Luke Kanies --- lib/puppet/type/file/group.rb | 64 ++++++++++++------------------------------- 1 file changed, 18 insertions(+), 46 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/file/group.rb b/lib/puppet/type/file/group.rb index cc482ff31..75beb537a 100755 --- a/lib/puppet/type/file/group.rb +++ b/lib/puppet/type/file/group.rb @@ -1,6 +1,10 @@ +require 'puppet/util/posix' + # Manage file group ownership. module Puppet Puppet.type(:file).newproperty(:group) do + include Puppet::Util::POSIX + require 'etc' desc "Which group should own the file. Argument can be either group name or group ID." @@ -43,31 +47,7 @@ module Puppet end def retrieve - if self.should - @should = @should.collect do |val| - unless val.is_a?(Integer) - if tmp = validgroup?(val) - val = tmp - else - raise "Could not find group %s" % val - end - else - val - end - end - end - stat = @resource.stat(false) - - unless stat - return :absent - end - - # Set our method appropriately, depending on links. - if stat.ftype == "link" and @resource[:links] != :follow - @method = :lchown - else - @method = :chown - end + return :absent unless stat = resource.stat(false) currentvalue = stat.gid @@ -84,12 +64,8 @@ module Puppet # Determine if the group is valid, and if so, return the GID def validgroup?(value) - if value =~ /^\d+$/ - value = value.to_i - end - - if gid = Puppet::Util.gid(value) - return gid + if number = gid(value) + return number else return false end @@ -99,32 +75,28 @@ module Puppet # we'll just let it fail, but we should probably set things up so # that users get warned if they try to change to an unacceptable group. def sync - unless @resource.stat(false) - stat = @resource.stat(true) - currentvalue = self.retrieve - - unless stat - self.debug "File '%s' does not exist; cannot chgrp" % - @resource[:path] - return nil - end + # Set our method appropriately, depending on links. + if resource[:links] == :manage + method = :lchown + else + method = :chown end gid = nil - unless gid = Puppet::Util.gid(self.should) - raise Puppet::Error, "Could not find group %s" % self.should + @should.each do |group| + break if gid = validgroup?(group) end + raise Puppet::Error, "Could not find group(s) %s" % @should.join(",") unless gid + begin # set owner to nil so it's ignored - File.send(@method,nil,gid,@resource[:path]) + File.send(method, nil, gid, resource[:path]) rescue => detail - error = Puppet::Error.new( "failed to chgrp %s to %s: %s" % - [@resource[:path], self.should, detail.message]) + error = Puppet::Error.new( "failed to chgrp %s to %s: %s" % [resource[:path], gid, detail.message]) raise error end return :file_changed end end end - -- cgit From 862077513570c996e9124743369c9af92485151f Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 1 Oct 2008 00:07:24 -0500 Subject: Fixed #791 - You should now be able to create and find a user/group in one transaction. The real problem was that the 'gid' and 'uid' methods didn't handle the case where 'get_posix_field' didn't return a value, and the subsequent 'get_posix_field' calls couldn't handle that. This commit moves the tests for Posix to spec, and fixes the specific bug. Signed-off-by: Luke Kanies --- lib/puppet/util/posix.rb | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/posix.rb b/lib/puppet/util/posix.rb index 9281169ea..b969a041c 100755 --- a/lib/puppet/util/posix.rb +++ b/lib/puppet/util/posix.rb @@ -7,10 +7,8 @@ module Puppet::Util::POSIX # method search_posix_field in the gid and uid methods if a sanity check # fails def get_posix_field(space, field, id) - unless id - raise ArgumentError, "Did not get id" - end - prefix = "get" + space.to_s + raise Puppet::DevError, "Did not get id from caller" unless id + if id.is_a?(Integer) if id > Puppet[:maximum_uid].to_i Puppet.err "Tried to get %s field for silly id %s" % [field, id] @@ -132,16 +130,16 @@ module Puppet::Util::POSIX # Get the GID of a given group, provided either a GID or a name def gid(group) begin - group = Integer(group) + group = Integer(group) rescue ArgumentError - # pass + # pass end if group.is_a?(Integer) - name = get_posix_field(:group, :name, group) + return nil unless name = get_posix_field(:group, :name, group) gid = get_posix_field(:group, :gid, name) check_value = gid else - gid = get_posix_field(:group, :gid, group) + return nil unless gid = get_posix_field(:group, :gid, group) name = get_posix_field(:group, :name, gid) check_value = name end @@ -155,16 +153,16 @@ module Puppet::Util::POSIX # Get the UID of a given user, whether a UID or name is provided def uid(user) begin - user = Integer(user) + user = Integer(user) rescue ArgumentError - # pass + # pass end if user.is_a?(Integer) - name = get_posix_field(:passwd, :name, user) + return nil unless name = get_posix_field(:passwd, :name, user) uid = get_posix_field(:passwd, :uid, name) check_value = uid else - uid = get_posix_field(:passwd, :uid, user) + return nil unless uid = get_posix_field(:passwd, :uid, user) name = get_posix_field(:passwd, :name, uid) check_value = name end -- cgit From 93f952a210ff6099c04f8c0157d79e338b901df5 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 2 Oct 2008 07:40:58 +1000 Subject: Fixed #1586 - Specifying "fully qualified" package names in Gentoo --- lib/puppet/provider/package/portage.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/provider/package/portage.rb b/lib/puppet/provider/package/portage.rb index b382d80da..ae7194f89 100644 --- a/lib/puppet/provider/package/portage.rb +++ b/lib/puppet/provider/package/portage.rb @@ -72,7 +72,7 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa result_format = /(\S+) (\S+) \[(?:([0-9.a-zA-Z]+(?:_(?:alpha|beta|pre|rc|p)[0-9]*)*(?:-r[0-9]*)?)(?:\([^\)]+\))?(?:\[([^\]]+)\])?[ ]*)*\] \[(?:(?:\{M\})?(?:\([~*]+\))?([0-9.a-zA-Z]+(?:_(?:alpha|beta|pre|rc|p)[0-9]*)*(?:-r[0-9]*)?)(?:\(([^\)]+)\))?(?:![mf])*(?:\[([^\]]+)\])?)?\] ([\S]*) (.*)/ result_fields = [:category, :name, :ensure, :ensure_overlay, :version_available, :slot, :overlay, :vendor, :description] - search_field = @resource[:category] ? "--category-name" : "--name" + search_field = package_name.count('/') > 0 ? "--category-name" : "--name" search_value = package_name search_format = " [] [] " -- cgit From 4a863c38ced0e2581454888b15275aa1eb381e56 Mon Sep 17 00:00:00 2001 From: Andrew Shafer Date: Wed, 1 Oct 2008 17:23:14 -0600 Subject: Adding user_attr util to parse attributes on solaris read /etc/user_attr and makes a hash based on the file contents --- lib/puppet/util/user_attr.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/puppet/util/user_attr.rb (limited to 'lib') diff --git a/lib/puppet/util/user_attr.rb b/lib/puppet/util/user_attr.rb new file mode 100644 index 000000000..db8fb81b9 --- /dev/null +++ b/lib/puppet/util/user_attr.rb @@ -0,0 +1,21 @@ +class UserAttr + def self.get_attributes_by_name(name) + attributes = nil + + File.readlines('/etc/user_attr').each do |line| + next if line =~ /^#/ + + token = line.split(':') + + if token[0] == name + attributes = {:name => name} + token[4].split(';').each do |attr| + key_value = attr.split('=') + attributes[key_value[0].intern] = key_value[1].strip + end + break + end + end + return attributes + end +end -- cgit From 2fba85af73f7a5de31cc13de64f0243df99fef1a Mon Sep 17 00:00:00 2001 From: Andrew Shafer Date: Wed, 1 Oct 2008 18:00:17 -0600 Subject: Some small clarifying refactors and change to objectadd to allow subclasses of with a uid not need to be a single class us use modify I don't like logic about subclasses in a parent class, but not in a position to address. --- lib/puppet/provider/nameservice.rb | 63 +++++++++++----------------- lib/puppet/provider/nameservice/objectadd.rb | 11 +---- 2 files changed, 25 insertions(+), 49 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/nameservice.rb b/lib/puppet/provider/nameservice.rb index 9764b5cf8..c1e21af08 100644 --- a/lib/puppet/provider/nameservice.rb +++ b/lib/puppet/provider/nameservice.rb @@ -179,11 +179,33 @@ class Puppet::Provider::NameService < Puppet::Provider end def create - self.ensure = :present + if exists? + info "already exists" + # The object already exists + return nil + end + + begin + execute(self.addcmd) + rescue Puppet::ExecutionFailure => detail + raise Puppet::Error, "Could not create %s %s: %s" % + [@resource.class.name, @resource.name, detail] + end end def delete - self.ensure = :absent + unless exists? + info "already absent" + # the object already doesn't exist + return nil + end + + begin + execute(self.deletecmd) + rescue Puppet::ExecutionFailure => detail + raise Puppet::Error, "Could not delete %s %s: %s" % + [@resource.class.name, @resource.name, detail] + end end def ensure @@ -194,43 +216,6 @@ class Puppet::Provider::NameService < Puppet::Provider end end - # This is only used when creating or destroying the object. - def ensure=(value) - cmd = nil - event = nil - case value - when :absent - # we need to remove the object... - unless exists? - info "already absent" - # the object already doesn't exist - return nil - end - - # again, needs to be set by the ind. property or its - # parent - cmd = self.deletecmd - type = "delete" - when :present - if exists? - info "already exists" - # The object already exists - return nil - end - - # blah blah, define elsewhere, blah blah - cmd = self.addcmd - type = "create" - end - - begin - execute(cmd) - rescue Puppet::ExecutionFailure => detail - raise Puppet::Error, "Could not %s %s %s: %s" % - [type, @resource.class.name, @resource.name, detail] - end - end - # Does our object exist? def exists? if getinfo(true) diff --git a/lib/puppet/provider/nameservice/objectadd.rb b/lib/puppet/provider/nameservice/objectadd.rb index b7efe8388..256368ee1 100644 --- a/lib/puppet/provider/nameservice/objectadd.rb +++ b/lib/puppet/provider/nameservice/objectadd.rb @@ -2,15 +2,6 @@ require 'puppet/provider/nameservice' class Puppet::Provider::NameService class ObjectAdd < Puppet::Provider::NameService - # Does the object already exist? - def self.exists?(obj) - if obj.getinfo(true) - return true - else - return false - end - end - def deletecmd [command(:delete), @resource[:name]] end @@ -23,7 +14,7 @@ class ObjectAdd < Puppet::Provider::NameService def modifycmd(param, value) cmd = [command(:modify), flag(param), value] - if @resource.allowdupe? && ((param == :uid and self.class.name == :useradd) || (param == :gid and self.class.name == :groupadd)) + if @resource.allowdupe? && ((param == :uid) || (param == :gid and self.class.name == :groupadd)) cmd << "-o" end cmd << @resource[:name] -- cgit From d1abb86565b63f98d8fc1395a78c840c45e47238 Mon Sep 17 00:00:00 2001 From: Andrew Shafer Date: Wed, 1 Oct 2008 18:58:09 -0600 Subject: Add role support to user type and an implemention modify user type: add ensure = role logic add roles property add manages_solaris_rbac feature refactored 'list' property to reuse logic for groups in roles --- lib/puppet/property/list.rb | 78 +++++++++++++++++++++++++++ lib/puppet/provider/user/user_role_add.rb | 89 +++++++++++++++++++++++++++++++ lib/puppet/type/user.rb | 88 ++++++++++++++---------------- 3 files changed, 206 insertions(+), 49 deletions(-) create mode 100644 lib/puppet/property/list.rb create mode 100644 lib/puppet/provider/user/user_role_add.rb (limited to 'lib') diff --git a/lib/puppet/property/list.rb b/lib/puppet/property/list.rb new file mode 100644 index 000000000..4e7f6ec90 --- /dev/null +++ b/lib/puppet/property/list.rb @@ -0,0 +1,78 @@ +require 'puppet/property' + +module Puppet + class Property + class List < Property + + def should_to_s(should_value) + #just return the should value + should_value + end + + def is_to_s(currentvalue) + currentvalue.join(delimiter) + end + + def membership + :membership + end + + def add_should_with_current(should, current) + if current.is_a?(Array) + should += current + end + should.uniq + end + + def inclusive? + @resource[membership] == :inclusive + end + + def should + unless defined? @should and @should + return nil + end + + members = @should + #inclusive means we are managing everything so if it isn't in should, its gone + if ! inclusive? + members = add_should_with_current(members, retrieve) + end + + members.sort.join(delimiter) + end + + def delimiter + "," + end + + def retrieve + #ok, some 'convention' if the list property is named groups, provider should implement a groups method + if tmp = provider.send(name) and tmp != :absent + return tmp.split(delimiter) + else + return :absent + end + end + + def prepare_is_for_comparison(is) + if is.is_a? Array + is = is.sort.join(delimiter) + end + is + end + + def insync?(is) + unless defined? @should and @should + return true + end + + unless is + return true + end + + return (prepare_is_for_comparison(is) == self.should) + end + end + end +end diff --git a/lib/puppet/provider/user/user_role_add.rb b/lib/puppet/provider/user/user_role_add.rb new file mode 100644 index 000000000..23581abbb --- /dev/null +++ b/lib/puppet/provider/user/user_role_add.rb @@ -0,0 +1,89 @@ +require 'puppet/util/user_attr' + +Puppet::Type.type(:user).provide :user_role_add, :parent => Puppet::Type::User::ProviderUseradd do + + desc "User management inherits ``useradd`` and adds logic to manage roles on Solaris using roleadd." + + defaultfor :operatingsystem => :solaris + + commands :add => "useradd", :delete => "userdel", :modify => "usermod", :role_add => "roleadd", :role_delete => "roledel", :role_modify => "rolemod" + options :home, :flag => "-d", :method => :dir + options :comment, :method => :gecos + options :groups, :flag => "-G" + options :roles, :flag => "-R" + + verify :gid, "GID must be an integer" do |value| + value.is_a? Integer + end + + verify :groups, "Groups must be comma-separated" do |value| + value !~ /\s/ + end + + has_features :manages_homedir, :allows_duplicates, :manages_solaris_rbac + + if Puppet.features.libshadow? + has_feature :manages_passwords + end + + def user_attributes + @user_attributes ||= UserAttr.get_attributes_by_name(@resource[:name]) + end + + def flush + @user_attributes = nil + end + + def command(cmd) + if is_role? or (!exists? and @resource[:ensure] == :role) + cmd = ("role_" + cmd.to_s).intern + end + super(cmd) + end + + def is_role? + user_attributes and user_attributes[:type] == "role" + end + + def run(cmd, msg) + begin + execute(cmd) + rescue Puppet::ExecutionFailure => detail + raise Puppet::Error, "Could not %s %s %s: %s" % + [msg, @resource.class.name, @resource.name, detail] + end + end + + def transition(type) + cmd = [command(:modify)] + cmd << "-K" << "type=#{type}" + cmd << @resource[:name] + end + + def create + if is_role? + run(transition("normal"), "transition role to") + else + run(addcmd, "create") + end + end + + def destroy + run(deletecmd, "delete "+ (is_role? ? "role" : "user")) + end + + def create_role + if exists? and !is_role? + run(transition("role"), "transition user to") + else + run(addcmd, "create role") + end + end + + def roles + if user_attributes + user_attributes[:roles] + end + end +end + diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index bb0a86fd0..74c4c6a33 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -1,5 +1,6 @@ require 'etc' require 'facter' +require 'puppet/property/list' module Puppet newtype(:user) do @@ -21,6 +22,9 @@ module Puppet "The provider can modify user passwords, by accepting a password hash." + feature :manages_solaris_rbac, + "The provider can manage roles and normal users" + newproperty(:ensure, :parent => Puppet::Property::Ensure) do newvalue(:present, :event => :user_created) do provider.create @@ -30,6 +34,10 @@ module Puppet provider.delete end + newvalue(:role, :event => :role_created, :required_features => :manages_solaris_rbac) do + provider.create_role + end + desc "The basic state that the object should be in." # If they're talking about the thing at all, they generally want to @@ -44,7 +52,11 @@ module Puppet def retrieve if provider.exists? - return :present + if provider.respond_to?(:is_role?) and provider.is_role? + return :role + else + return :present + end else return :absent end @@ -125,68 +137,36 @@ module Puppet end end - newproperty(:groups) do + newproperty(:groups, :parent => Puppet::Property::List) do desc "The groups of which the user is a member. The primary group should not be listed. Multiple groups should be specified as an array." - def should_to_s(newvalue) - self.should - end - - def is_to_s(currentvalue) - currentvalue.join(",") - end - - # We need to override this because the groups need to - # be joined with commas - def should - current_value = retrieve - - unless defined? @should and @should - return nil - end - - if @resource[:membership] == :inclusive - return @should.sort.join(",") - else - members = @should - if current_value.is_a?(Array) - members += current_value - end - return members.uniq.sort.join(",") + validate do |value| + if value =~ /^\d+$/ + raise ArgumentError, "Group names must be provided, not numbers" end - end - - def retrieve - if tmp = provider.groups and tmp != :absent - return tmp.split(",") - else - return :absent + if value.include?(",") + puts value + raise ArgumentError, "Group names must be provided as an array, not a comma-separated list" end end + end - def insync?(is) - unless defined? @should and @should - return true - end - unless defined? is and is - return true - end - tmp = is - if is.is_a? Array - tmp = is.sort.join(",") - end + newproperty(:roles, :parent => Puppet::Property::List, :required_features => :manages_solaris_rbac) do + desc "The roles of which the user the user has. The roles should be + specified as an array." - return tmp == self.should + def membership + :role_membership end validate do |value| if value =~ /^\d+$/ - raise ArgumentError, "Group names must be provided, not numbers" + raise ArgumentError, "Role names must be provided, not numbers" end if value.include?(",") - raise ArgumentError, "Group names must be provided as an array, not a comma-separated list" + raise ArgumentError, "Role names must be provided as an array, not a comma-separated list" end end end @@ -202,7 +182,17 @@ module Puppet desc "Whether specified groups should be treated as the only groups of which the user is a member or whether they should merely be treated as the minimum membership list." - + + newvalues(:inclusive, :minimum) + + defaultto :minimum + end + + newparam(:role_membership) do + desc "Whether specified roles should be treated as the only roles + of which the user is a member or whether they should merely + be treated as the minimum membership list." + newvalues(:inclusive, :minimum) defaultto :minimum -- cgit From e32256af93a9c2c272f12576bdcf7005a83bb90f Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 1 Oct 2008 19:06:10 -0500 Subject: Migrating the apt and dpkg tests to rspec. I left the aptitude and aptrpm tests as an exercise for the reader. Signed-off-by: Luke Kanies --- lib/puppet/provider/package/apt.rb | 33 ++++++--------- lib/puppet/provider/package/dpkg.rb | 82 +++++++++++++++---------------------- 2 files changed, 45 insertions(+), 70 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/package/apt.rb b/lib/puppet/provider/package/apt.rb index d0e520f0a..80465129d 100755 --- a/lib/puppet/provider/package/apt.rb +++ b/lib/puppet/provider/package/apt.rb @@ -45,9 +45,19 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do if @resource[:responsefile] self.run_preseed end - should = @resource.should(:ensure) + should = @resource[:ensure] checkforcdrom() + cmd = %w{-q -y} + + keep = "" + if config = @resource[:configfiles] + if config == :keep + cmd << "-o" << 'DPkg::Options::=--force-confold' + else + cmd << "-o" << 'DPkg::Options::=--force-confnew' + end + end str = @resource[:name] case should @@ -57,19 +67,6 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do # Add the package version str += "=%s" % should end - cmd = %w{-q -y} - - keep = "" - if config = @resource[:configfiles] - case config - when :keep - cmd << "-o" << 'DPkg::Options::=--force-confold' - when :replace - cmd << "-o" << 'DPkg::Options::=--force-confnew' - else - raise Puppet::Error, "Invalid 'configfiles' value %s" % config - end - end cmd << :install << str @@ -92,7 +89,7 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do # preseeds answers to dpkg-set-selection from the "responsefile" # def run_preseed - if response = @resource[:responsefile] and FileTest.exists?(response) + if response = @resource[:responsefile] and FileTest.exist?(response) self.info("Preseeding %s to debconf-set-selections" % response) preseed response @@ -101,16 +98,12 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do end end - def update - self.install - end - def uninstall aptget "-y", "-q", :remove, @resource[:name] end def purge - aptget '-y', '-q', 'remove', '--purge', @resource[:name] + aptget '-y', '-q', :remove, '--purge', @resource[:name] # workaround a "bug" in apt, that already removed packages are not purged super end diff --git a/lib/puppet/provider/package/dpkg.rb b/lib/puppet/provider/package/dpkg.rb index ae79f714c..67d31a592 100755 --- a/lib/puppet/provider/package/dpkg.rb +++ b/lib/puppet/provider/package/dpkg.rb @@ -23,30 +23,39 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package # now turn each returned line into a package object process.each { |line| - if match = regex.match(line) - hash = {} + if hash = parse_line(line) + packages << new(hash) + end + } + end - fields.zip(match.captures) { |field,value| - hash[field] = value - } + return packages + end - hash[:provider] = self.name + REGEX = %r{^(\S+) +(\S+) +(\S+) (\S+) (\S*)$} + FIELDS = [:desired, :error, :status, :name, :ensure] - if hash[:status] == 'not-installed' - hash[:ensure] = :purged - elsif hash[:status] != "installed" - hash[:ensure] = :absent - end + def self.parse_line(line) + if match = REGEX.match(line) + hash = {} - packages << new(hash) - else - Puppet.warning "Failed to match dpkg-query line %s" % - line.inspect - end + FIELDS.zip(match.captures) { |field,value| + hash[field] = value } + + hash[:provider] = self.name + + if hash[:status] == 'not-installed' + hash[:ensure] = :purged + elsif hash[:status] != "installed" + hash[:ensure] = :absent + end + else + Puppet.warning "Failed to match dpkg-query line %s" % line.inspect + return nil end - return packages + return hash end def install @@ -56,15 +65,10 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package args = [] - if config = @resource[:configfiles] - case config - when :keep - args << '--force-confold' - when :replace - args << '--force-confnew' - else - raise Puppet::Error, "Invalid 'configfiles' value %s" % config - end + if @resource[:configfiles] == :keep + args << '--force-confold' + else + args << '--force-confnew' end args << '-i' << file @@ -80,7 +84,7 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package output = dpkg_deb "--show", @resource[:source] matches = /^(\S+)\t(\S+)$/.match(output).captures unless matches[0].match(@resource[:name]) - Puppet.warning "source doesn't contain named package, but %s" % matches[0] + warning "source doesn't contain named package, but %s" % matches[0] end matches[1] end @@ -103,22 +107,8 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package :name => @resource[:name], :error => 'ok'} end - # Our regex for matching dpkg-query output. We could probably just - # use split here, but I'm not positive that dpkg-query will never - # return whitespace. - regex = %r{^(\S+) (\S+) (\S+) (\S+) (\S*)$} - line = output.split("\n").shift.chomp - - if match = regex.match(line) - fields.zip(match.captures) { |field,value| - hash[field] = value - } - else - notice "Failed to handle dpkg-query line %s" % line.inspect - return {:ensure => :absent, :status => 'missing', - :name => @resource[:name], :error => 'ok'} - end + hash = self.class.parse_line(output) || {:ensure => :absent, :status => 'missing', :name => @resource[:name], :error => 'ok'} if hash[:error] != "ok" raise Puppet::Error.new( @@ -127,13 +117,6 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package ) end - # DPKG can discuss packages that are no longer installed, so allow that. - if hash[:status] == "not-installed" - hash[:ensure] = :purged - elsif hash[:status] != "installed" - hash[:ensure] = :absent - end - return hash end @@ -145,4 +128,3 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package dpkg "--purge", @resource[:name] end end - -- cgit From 6a0b3348065bba7438b23ebbada67c552f33597b Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 2 Oct 2008 14:04:38 +1000 Subject: Fixed error message typo --- lib/puppet/network/xmlrpc/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb index e0fb5a0ab..6d77286d3 100644 --- a/lib/puppet/network/xmlrpc/client.rb +++ b/lib/puppet/network/xmlrpc/client.rb @@ -51,7 +51,7 @@ module Puppet::Network end ["certificate verify failed", "hostname was not match", "hostname not match"].each do |str| if detail.message.include?(str) - Puppet.warning "Certificate validation failed; considering using the certname configuration option" + Puppet.warning "Certificate validation failed; consider using the certname configuration option" end end raise XMLRPCClientError, -- cgit From 1a9b5677de01fc1ed5a9a6ebbea99a73def7f689 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 2 Oct 2008 22:56:35 -0500 Subject: Fixing #1614 - Environments no longer have to be listed out. Signed-off-by: Luke Kanies --- lib/puppet/defaults.rb | 7 +------ lib/puppet/node/environment.rb | 18 +----------------- 2 files changed, 2 insertions(+), 23 deletions(-) (limited to 'lib') diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index a2900fd43..e1b6dc423 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -122,16 +122,11 @@ module Puppet namespaces and methods. This can be used as a coarse-grained authorization system for both ``puppetd`` and ``puppetmasterd``." ], - :environments => ["production,development", "The valid environments for Puppet clients. - This is more useful as a server-side setting than client, but any - environment chosen must be in this list. Values should be - separated by a comma."], :environment => {:default => "production", :desc => "The environment Puppet is running in. For clients (e.g., ``puppetd``) this determines the environment itself, which is used to find modules and much more. For servers (i.e., ``puppetmasterd``) this provides the default environment for nodes - we know nothing about.", - :hook => proc { |value| raise(ArgumentError, "Invalid environment %s" % value) unless Puppet::Node::Environment.valid?(value) } + we know nothing about." }, :diff_args => ["", "Which arguments to pass to the diff command when printing differences between files."], :diff => ["diff", "Which diff command to use when printing differences between files."], diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb index 343720a62..b64b9c2c4 100644 --- a/lib/puppet/node/environment.rb +++ b/lib/puppet/node/environment.rb @@ -1,30 +1,14 @@ # Model the environment that a node can operate in. This class just # provides a simple wrapper for the functionality around environments. class Puppet::Node::Environment - # Return the list of valid environments. Just looks them up in - # the settings. - def self.valid - # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] - x = Puppet.settings.value(:environments).split(",").collect { |e| e.to_sym } - end - - # Is the provided environment valid? - def self.valid?(name) - return false if name.to_s == "" - valid.include?(name.to_sym) - end - @seen = {} - # Return an existing environment instance, or create a new one, - # validating the environment name. + # Return an existing environment instance, or create a new one. def self.new(name = nil) name ||= Puppet.settings.value(:environment) raise ArgumentError, "Environment name must be specified" unless name - raise(ArgumentError, "'%s' is not a valid environment" % name) unless valid?(name) - symbol = name.to_sym return @seen[symbol] if @seen[symbol] -- cgit From 7272d49149815e038c67b1ae645b449a1ec2578a Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 2 Oct 2008 23:07:19 -0500 Subject: Fixed #1613 - The client environment will be substituted when looking up settings. This won't be perfect, because it still requires that the caller pass in an environment, but for every case that an environment is passed in, that environment will be substituted into settings when possible. Signed-off-by: Luke Kanies --- lib/puppet/util/settings.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index a8eb09049..1e49a3ada 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -114,12 +114,14 @@ class Puppet::Util::Settings end # Do variable interpolation on the value. - def convert(value) + def convert(value, environment = nil) return value unless value return value unless value.is_a? String newval = value.gsub(/\$(\w+)|\$\{(\w+)\}/) do |value| varname = $2 || $1 - if pval = self.value(varname) + if varname == "environment" and environment + environment + elsif pval = self.value(varname) pval else raise Puppet::DevError, "Could not find value for %s" % value @@ -781,7 +783,7 @@ Generated on #{Time.now}. val = @config[param].default if val.nil? # Convert it if necessary - val = convert(val) + val = convert(val, environment) # And cache it @cache[environment||"none"][param] = val -- cgit From e77ddc16570fd15b161db416e7dd35f95e7fb0ac Mon Sep 17 00:00:00 2001 From: Brett Lentz Date: Thu, 24 Jul 2008 18:13:14 -0700 Subject: Merged fsweetser's selinux patch against HEAD --- lib/puppet/provider/selboolean/getsetsebool.rb | 47 ++++++++ lib/puppet/provider/selmodule/semodule.rb | 143 +++++++++++++++++++++++++ lib/puppet/type/file.rb | 1 + lib/puppet/type/file/selcontext.rb | 96 +++++++++++++++++ lib/puppet/type/selboolean.rb | 29 +++++ lib/puppet/type/selmodule.rb | 50 +++++++++ 6 files changed, 366 insertions(+) create mode 100644 lib/puppet/provider/selboolean/getsetsebool.rb create mode 100644 lib/puppet/provider/selmodule/semodule.rb create mode 100644 lib/puppet/type/file/selcontext.rb create mode 100644 lib/puppet/type/selboolean.rb create mode 100644 lib/puppet/type/selmodule.rb (limited to 'lib') diff --git a/lib/puppet/provider/selboolean/getsetsebool.rb b/lib/puppet/provider/selboolean/getsetsebool.rb new file mode 100644 index 000000000..4614c6c38 --- /dev/null +++ b/lib/puppet/provider/selboolean/getsetsebool.rb @@ -0,0 +1,47 @@ +Puppet::Type.type(:selboolean).provide(:getsetsebool) do + desc "Manage SELinux booleans using the getsebool and setsebool binaries." + + commands :getsebool => "/usr/sbin/getsebool" + commands :setsebool => "/usr/sbin/setsebool" + + def value + self.debug "Retrieving value of selboolean #{@resource[:name]}" + + status = getsebool(@resource[:name]) + + if status =~ / off$/ then + return :off + elsif status =~ / on$/ then + return :on + else + status.chomp! + raise Puppet::Error, "Invalid response '%s' returned from getsebool" % [status] + end + end + + def value=(new) + persist = "" + if @resource[:persistent] == :true + self.debug "Enabling persistence" + persist = "-P" + end + execoutput("#{command(:setsebool)} #{persist} #{@resource[:name]} #{new}") + return :file_changed + end + + # Required workaround, since SELinux policy prevents setsebool + # from writing to any files, even tmp, preventing the standard + # 'setsebool("...")' construct from working. + + def execoutput (cmd) + output = '' + begin + execpipe(cmd) do |out| + output = out.readlines.join('').chomp! + end + rescue Puppet::ExecutionFailure + raise Puppet::ExecutionFailure, output.split("\n")[0] + end + return output + end +end diff --git a/lib/puppet/provider/selmodule/semodule.rb b/lib/puppet/provider/selmodule/semodule.rb new file mode 100644 index 000000000..498136691 --- /dev/null +++ b/lib/puppet/provider/selmodule/semodule.rb @@ -0,0 +1,143 @@ +Puppet::Type.type(:selmodule).provide(:semodule) do + desc "Manage SELinux policy modules using the semodule binary." + + commands :semodule => "/usr/sbin/semodule" + + def create + begin + execoutput("#{command(:semodule)} --install #{selmod_name_to_filename}") + rescue Puppet::ExecutionFailure => detail + raise Puppet::Error, "Could not load policy module: %s" % [detail]; + end + return :true + end + + def destroy + begin + execoutput("#{command(:semodule)} --remove #{@resource[:name]}") + rescue Puppet::ExecutionFailure => detail + raise Puppet::Error, "Could not remove policy module: %s" % [detail]; + end + end + + def exists? + self.debug "Checking for module #{@resource[:name]}" + execpipe("#{command(:semodule)} --list") do |out| + out.each do |line| + if line =~ /#{@resource[:name]}\b/ + return :true + end + end + end + return nil + end + + def syncversion + self.debug "Checking syncversion on #{@resource[:name]}" + + loadver = selmodversion_loaded + + if(loadver) then + filever = selmodversion_file + if (filever == loadver) then + return :true + end + end + return :false + end + + def syncversion= (dosync) + begin + execoutput("#{command(:semodule)} --upgrade #{selmod_name_to_filename}") + rescue Puppet::ExecutionFailure => detail + raise Puppet::Error, "Could not upgrade policy module: %s" % [detail]; + end + end + + # Helper functions + + def execoutput (cmd) + output = '' + begin + execpipe(cmd) do |out| + output = out.readlines.join('').chomp! + end + rescue Puppet::ExecutionFailure + raise Puppet::ExecutionFailure, output.split("\n")[0] + end + return output + end + + def selmod_name_to_filename + if @resource[:selmodulepath] + return @resource[:selmodulepath] + else + return "#{@resource[:selmoduledir]}/#{@resource[:name]}.pp" + end + end + + def selmod_readnext (handle) + len = handle.read(4).unpack('L')[0] + return handle.read(len) + end + + def selmodversion_file + magic = 0xF97CFF8F + + filename = selmod_name_to_filename + mod = File.new(filename, "r") + + (hdr, ver, numsec) = mod.read(12).unpack('LLL') + + if hdr != magic + raise Puppet::Error, "Found #{hdr} instead of magic #{magic} in #{filename}" + end + + if ver != 1 + raise Puppet::Error, "Unknown policy file version #{ver} in #{filename}" + end + + # Read through (and throw away) the file section offsets, and also + # the magic header for the first section. + + mod.read((numsec + 1) * 4) + + ## Section 1 should be "SE Linux Module" + + selmod_readnext(mod) + selmod_readnext(mod) + + # Skip past the section headers + mod.read(14) + + # Module name + selmod_readnext(mod) + + # At last! the version + + v = selmod_readnext(mod) + + self.debug "file version #{v}" + return v + end + + def selmodversion_loaded + lines = () + begin + execpipe("#{command(:semodule)} --list") do |output| + lines = output.readlines + lines.each do |line| + line.chomp! + bits = line.split + if bits[0] == @resource[:name] then + self.debug "load version #{bits[1]}" + return bits[1] + end + end + end + rescue Puppet::ExecutionFailure + raise Puppet::ExecutionFailure, "Could not list policy modules: %s" % [lines.join(' ').chomp!] + end + return nil + end +end diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 2a5e61de8..371571ff3 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -1157,4 +1157,5 @@ module Puppet require 'puppet/type/file/group' require 'puppet/type/file/mode' require 'puppet/type/file/type' + require 'puppet/type/file/selcontext' # SELinux file context end diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb new file mode 100644 index 000000000..f36695075 --- /dev/null +++ b/lib/puppet/type/file/selcontext.rb @@ -0,0 +1,96 @@ +# Manage SELinux context of files. +# +# This code actually manages three pieces of data in the context. +# +# [root@delenn files]# ls -dZ / +# drwxr-xr-x root root system_u:object_r:root_t / +# +# The context of '/' here is 'system_u:object_r:root_t'. This is +# three seperate fields: +# +# system_u is the user context +# object_r is the role context +# root_t is the type context +# +# All three of these fields are returned in a single string by the +# output of the stat command, but set individually with the chcon +# command. This allows the user to specify a subset of the three +# values while leaving the others alone. +# +# See http://www.nsa.gov/selinux/ for complete docs on SELinux. + +module Puppet + class SELFileContext < Puppet::Property + + def retrieve + unless @resource.stat(false) + return :absent + end + context = `stat -c %C #{@resource[:path]}` + context.chomp! + if context == "unlabeled" + return nil + end + unless context =~ /^[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/ + raise Puppet::Error, "Invalid output from stat: #{context}" + end + bits = context.split(':') + ret = { + :seluser => bits[0], + :selrole => bits[1], + :seltype => bits[2] + } + return ret[name] + end + + def sync + unless @resource.stat(false) + stat = @resource.stat(true) + unless stat + return nil + end + end + + flag = '' + + case name + when :seluser + flag = "-u" + when :selrole + flag = "-r" + when :seltype + flag = "-t" + else + raise Puppet::Error, "Invalid SELinux file context component: #{name}" + end + + self.debug "Running chcon #{flag} #{@should} #{@resource[:path]}" + retval = system("chcon #{flag} #{@should} #{@resource[:path]}") + unless retval + error = Puppet::Error.new("failed to chcon %s" % [@resource[:path]]) + raise error + end + return :file_changed + end + end + + Puppet.type(:file).newproperty(:seluser, :parent => Puppet::SELFileContext) do + desc "What the SELinux User context of the file should be." + + @event = :file_changed + end + + Puppet.type(:file).newproperty(:selrole, :parent => Puppet::SELFileContext) do + desc "What the SELinux Role context of the file should be." + + @event = :file_changed + end + + Puppet.type(:file).newproperty(:seltype, :parent => Puppet::SELFileContext) do + desc "What the SELinux Type context of the file should be." + + @event = :file_changed + end + +end + diff --git a/lib/puppet/type/selboolean.rb b/lib/puppet/type/selboolean.rb new file mode 100644 index 000000000..d12dd3bcb --- /dev/null +++ b/lib/puppet/type/selboolean.rb @@ -0,0 +1,29 @@ +# +# Simple module for manageing SELinux booleans +# + +module Puppet + newtype(:selboolean) do + @doc = "Enable or disable SELinux booleans." + + newparam(:name) do + desc "The name of the SELinux boolean to be managed." + isnamevar + end + + newproperty(:value) do + desc "Whether the the SELinux boolean should be enabled or disabled. Possible values are ``on`` or ``off``." + newvalue(:on) + newvalue(:off) + end + + newparam(:persistent) do + desc "If set true, SELinux booleans will be written to disk and persist accross reboots." + + defaultto :false + newvalues(:true, :false) + end + + end +end + diff --git a/lib/puppet/type/selmodule.rb b/lib/puppet/type/selmodule.rb new file mode 100644 index 000000000..1f02912ad --- /dev/null +++ b/lib/puppet/type/selmodule.rb @@ -0,0 +1,50 @@ +# +# Simple module for manageing SELinux policy modules +# + +Puppet::Type.newtype(:selmodule) do + @doc = "Enable or disable SELinux policy modules." + + ensurable + + newparam(:name) do + desc "The name of the SELinux policy to be managed." + isnamevar + end + + newparam(:selmoduledir) do + + desc "The directory to look for the compiled pp module file in. + Currently defaults to /usr/share/selinux/targeted" + + defaultto "/usr/share/selinux/targeted" + end + + newparam(:selmodulepath) do + + desc "The full path in which to look for the compiled pp + module file in. You only need to use this if the module file + is not in the directory pointed at by selmoduledir." + + end + + newproperty(:syncversion) do + + desc "If set to 'true', the policy will be reloaded if the + version found in the on-disk file differs from the loaded + version. If set to 'false' (the default) the the only check + that will be made is if the policy is loaded at all or not." + + newvalue(:true) + newvalue(:false) + end + + autorequire(:file) do + if self[:selmodulepath] + [self[:selmodulepath]] + else + ["#{self[:selmoduledir]}/#{self[:name]}.pp"] + end + end +end + -- cgit From 772e9b217aafb22da3a7572085f631da54274937 Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Tue, 30 Sep 2008 14:18:14 -0400 Subject: Refactor SELinux commands to utility module --- lib/puppet/type/file/selcontext.rb | 45 +++++---------- lib/puppet/util/selinux.rb | 113 +++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 32 deletions(-) create mode 100644 lib/puppet/util/selinux.rb (limited to 'lib') diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb index f36695075..6e36a024a 100644 --- a/lib/puppet/type/file/selcontext.rb +++ b/lib/puppet/type/file/selcontext.rb @@ -20,27 +20,26 @@ # See http://www.nsa.gov/selinux/ for complete docs on SELinux. module Puppet + require 'puppet/util/selinux' + class SELFileContext < Puppet::Property + include Puppet::Util::SELinux def retrieve unless @resource.stat(false) return :absent end - context = `stat -c %C #{@resource[:path]}` - context.chomp! - if context == "unlabeled" + context = self.get_selinux_current_context(@resource[:path]) + return parse_selinux_context(name, context) + end + + def retrieve_default_context(property) + unless context = self.get_selinux_default_context(@resource[:path]) return nil end - unless context =~ /^[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/ - raise Puppet::Error, "Invalid output from stat: #{context}" - end - bits = context.split(':') - ret = { - :seluser => bits[0], - :selrole => bits[1], - :seltype => bits[2] - } - return ret[name] + property_default = self.parse_selinux_context(property, context) + self.debug "Found #{property} default '#{property_default}' for #{@resource[:path]}" + return property_default end def sync @@ -51,25 +50,7 @@ module Puppet end end - flag = '' - - case name - when :seluser - flag = "-u" - when :selrole - flag = "-r" - when :seltype - flag = "-t" - else - raise Puppet::Error, "Invalid SELinux file context component: #{name}" - end - - self.debug "Running chcon #{flag} #{@should} #{@resource[:path]}" - retval = system("chcon #{flag} #{@should} #{@resource[:path]}") - unless retval - error = Puppet::Error.new("failed to chcon %s" % [@resource[:path]]) - raise error - end + self.set_selinux_context(@resource[:path], @should, name) return :file_changed end end diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb new file mode 100644 index 000000000..6a9bcaf79 --- /dev/null +++ b/lib/puppet/util/selinux.rb @@ -0,0 +1,113 @@ +# Provides utility functions to help interfaces Puppet to SELinux. +# +# Currently this is implemented via the command line tools. At some +# point support should be added to use the new SELinux ruby bindings +# as that will be faster and more reliable then shelling out when they +# are available. At this time (2008-09-26) these bindings aren't bundled on +# any SELinux-using distribution I know of. + +module Puppet::Util::SELinux + + def selinux_support? + FileTest.exists?("/selinux/enforce") + end + + # Retrieve and return the full context of the file. If we don't have + # SELinux support or if the stat call fails then return nil. + def get_selinux_current_context(file) + unless selinux_support? + return nil + end + context = `stat -c %C #{file}` + if ($?.to_i >> 8) > 0 + return nil + end + context.chomp! + return context + end + + # Use the matchpathcon command, if present, to return the SELinux context + # which the SELinux policy on the system expects the file to have. We can + # use this to obtain a good default context. If the command does not + # exist or the call fails return nil. + # + # Note: For this command to work a full, non-relative, filesystem path + # should be given. + def get_selinux_default_context(file) + unless FileTest.executable?("/usr/sbin/matchpathcon") + return nil + end + context = %x{/usr/sbin/matchpathcon #{file} 2>&1} + if ($?.to_i >> 8) > 0 + return nil + end + # For a successful match, matchpathcon returns two fields separated by + # a variable amount of whitespace. The second field is the full context. + context = context.split(/\s/)[1] + return context + end + + # Take the full SELinux context returned from the tools and parse it + # out to the three (or four) component parts. Supports :seluser, :selrole, + # :seltype, and on systems with range support, :selrange. + def parse_selinux_context(component, context) + if context == "unlabeled" + return nil + end + unless context =~ /^[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+(:[a-z0-9_])?/ + raise Puppet::Error, "Invalid context to parse: #{context}" + end + bits = context.split(':') + ret = { + :seluser => bits[0], + :selrole => bits[1], + :seltype => bits[2] + } + if bits.length == 4 + ret[:selrange] = bits[3] + end + return ret[component] + end + + # This updates the actual SELinux label on the file. You can update + # only a single component or update the entire context. It is just a + # wrapper around the chcon command. + def set_selinux_context(file, value, component = false) + case component + when :seluser + flag = "-u" + when :selrole + flag = "-r" + when :seltype + flag = "-t" + when :selrange + flag = "-l" + else + flag = "" + end + + Puppet.debug "Running chcon #{flag} #{value} #{file}" + retval = system("chcon #{flag} #{value} #{file}") + unless retval + error = Puppet::Error.new("failed to chcon %s" % [@resource[:path]]) + raise error + end + end + + # Since this call relies on get_selinux_default_context it also needs a + # full non-relative path to the file. Fortunately, that seems to be all + # Puppet uses. This will set the file's SELinux context to the policy's + # default context (if any) if it differs from the context currently on + # the file. + def set_selinux_default_context(file) + new_context = get_selinux_default_context(file) + unless new_context + return nil + end + cur_context = get_selinux_current_context(file) + if new_context != cur_context + set_selinux_context(file, new_context) + end + return new_context + end +end -- cgit From c8314821a2bd0f1bb60397492735d3775836416f Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Tue, 30 Sep 2008 14:34:48 -0400 Subject: Add detected defaults for existing SELinux file properties --- lib/puppet/type/file/selcontext.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb index 6e36a024a..a344f20ac 100644 --- a/lib/puppet/type/file/selcontext.rb +++ b/lib/puppet/type/file/selcontext.rb @@ -59,18 +59,21 @@ module Puppet desc "What the SELinux User context of the file should be." @event = :file_changed + defaultto { self.retrieve_default_context(:seluser) } end Puppet.type(:file).newproperty(:selrole, :parent => Puppet::SELFileContext) do desc "What the SELinux Role context of the file should be." @event = :file_changed + defaultto { self.retrieve_default_context(:selrole) } end Puppet.type(:file).newproperty(:seltype, :parent => Puppet::SELFileContext) do desc "What the SELinux Type context of the file should be." @event = :file_changed + defaultto { self.retrieve_default_context(:seltype) } end end -- cgit From 250239eb7fa93dbacd2e755307a6c115615fe87b Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Tue, 30 Sep 2008 14:38:21 -0400 Subject: Add new support for :selrange SELinux file property --- lib/puppet/type/file/selcontext.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb index a344f20ac..b2c89e6f8 100644 --- a/lib/puppet/type/file/selcontext.rb +++ b/lib/puppet/type/file/selcontext.rb @@ -76,5 +76,12 @@ module Puppet defaultto { self.retrieve_default_context(:seltype) } end + Puppet.type(:file).newproperty(:selrange, :parent => Puppet::SELFileContext) do + desc "What the SELinux Range context of the file should be." + + @event = :file_changed + defaultto { self.retrieve_default_context(:selrange) } + end + end -- cgit From a4110a39f34506507e653c3cb2a8b092bd14de92 Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Tue, 30 Sep 2008 14:43:23 -0400 Subject: Add SELinux context reset after file writes in Puppet::Util::FileType --- lib/puppet/util/filetype.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/puppet/util/filetype.rb b/lib/puppet/util/filetype.rb index 8dcb67286..7e799b613 100755 --- a/lib/puppet/util/filetype.rb +++ b/lib/puppet/util/filetype.rb @@ -1,8 +1,13 @@ # Basic classes for reading, writing, and emptying files. Not much # to see here. + +require 'puppet/util/selinux' + class Puppet::Util::FileType attr_accessor :loaded, :path, :synced + include Puppet::Util::SELinux + class << self attr_accessor :name include Puppet::Util::ClassGen @@ -109,6 +114,8 @@ class Puppet::Util::FileType tf.print text; tf.flush FileUtils.cp(tf.path, @path) tf.close + # If SELinux is present, we need to ensure the file has its expected context + set_selinux_default_context(@path) end end -- cgit From 67136f111c60779a1b87b43a6b949a2357399836 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 3 Oct 2008 12:42:51 -0500 Subject: Fixing the Node class to no longer validate environments since #1614 removed that validation. Signed-off-by: Luke Kanies --- lib/puppet/node.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/puppet/node.rb b/lib/puppet/node.rb index 341ec77ba..e10299d87 100644 --- a/lib/puppet/node.rb +++ b/lib/puppet/node.rb @@ -15,12 +15,7 @@ class Puppet::Node attr_accessor :name, :classes, :parameters, :source, :ipaddress attr_reader :time - - # Set the environment, making sure that it's valid. - def environment=(value) - raise(ArgumentError, "Invalid environment %s" % value) unless Puppet::Node::Environment.valid?(value) - @environment = value - end + attr_writer :environment # Do not return environments that are the empty string, and use # explicitly set environments, then facts, then a central env @@ -28,7 +23,6 @@ class Puppet::Node def environment unless @environment if env = parameters["environment"] - raise(ArgumentError, "Invalid environment %s from parameters" % env) unless Puppet::Node::Environment.valid?(env) @environment = env else @environment = Puppet::Node::Environment.new.name.to_s -- cgit From 6bcfd9f021be13bfd3269eaa72bc289eab37a64f Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 3 Oct 2008 13:11:44 -0500 Subject: Fixing #947 - pluginsync no longer fails poorly when no plugins exist Note that it still fails -- it's just a more reasonable failure. Signed-off-by: Luke Kanies --- lib/puppet/network/handler/fileserver.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index ff9b96f6c..da0a2befe 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -70,7 +70,9 @@ class Puppet::Network::Handler mount.debug("Describing %s for %s" % [url, client]) if client # use the mount to resolve the path for us. - metadata = Puppet::FileServing::Metadata.new(url, :path => mount.file_path(path, client), :links => links) + return "" unless full_path = mount.file_path(path, client) + + metadata = Puppet::FileServing::Metadata.new(url, :path => full_path, :links => links) return "" unless metadata.exist? @@ -710,7 +712,7 @@ class Puppet::Network::Handler end def file_path(relpath, client = nil) - mod = valid_modules.map { |m| mod_path_exists?(m, relpath, client) ? m : nil }.compact.first + return nil unless mod = valid_modules.map { |m| mod_path_exists?(m, relpath, client) ? m : nil }.compact.first mod_file_path(mod, relpath, client) end -- cgit From d2c89985bb356188ac52d00b0799cae655a9c75b Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 3 Oct 2008 16:12:49 -0500 Subject: Fixed #981 - Removed 'Adding aliases' info message Signed-off-by: Luke Kanies --- lib/puppet/type.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index e377a3547..7e8654921 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -1472,8 +1472,6 @@ class Type raise(ArgumentError, "Cannot add aliases without a catalog") unless @resource.catalog - @resource.info "Adding aliases %s" % aliases.collect { |a| a.inspect }.join(", ") - aliases.each do |other| if obj = @resource.catalog.resource(@resource.class.name, other) unless obj.object_id == @resource.object_id -- cgit From db7f108f546db2114f87316c68d33706c9e4142e Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 3 Oct 2008 17:35:45 -0500 Subject: Adding rspec tests for the Puppet::Util::Log class. Also using Puppet::Util::Tagging to handle the tagging, rather than custom methods. Signed-off-by: Luke Kanies --- lib/puppet/util/log.rb | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb index 8824a8b50..f5119bbff 100644 --- a/lib/puppet/util/log.rb +++ b/lib/puppet/util/log.rb @@ -1,10 +1,12 @@ require 'syslog' +require 'puppet/util/tagging' # Pass feedback to the user. Log levels are modeled after syslog's, and it is # expected that that will be the most common log destination. Supports # multiple destinations, one of which is a remote server. class Puppet::Util::Log include Puppet::Util + include Puppet::Util::Tagging @levels = [:debug,:info,:notice,:warning,:err,:alert,:emerg,:crit] @loglevel = 2 @@ -470,12 +472,12 @@ class Puppet::Util::Log @levels.include?(level) end - attr_accessor :level, :message, :time, :tags, :remote + attr_accessor :level, :message, :time, :remote attr_reader :source def initialize(args) unless args.include?(:level) && args.include?(:message) - raise Puppet::DevError, "Puppet::Util::Log called incorrectly" + raise ArgumentError, "Puppet::Util::Log called incorrectly" end if args[:level].class == String @@ -483,8 +485,7 @@ class Puppet::Util::Log elsif args[:level].class == Symbol @level = args[:level] else - raise Puppet::DevError, - "Level is not a string or symbol: #{args[:level].class}" + raise ArgumentError, "Level is not a string or symbol: #{args[:level].class}" end # Just return unless we're actually at a level we should send @@ -495,11 +496,11 @@ class Puppet::Util::Log # this should include the host name, and probly lots of other # stuff, at some point unless self.class.validlevel?(level) - raise Puppet::DevError, "Invalid message level #{level}" + raise ArgumentError, "Invalid message level #{level}" end - if args.include?(:tags) - @tags = args[:tags] + if tags = args[:tags] + tags.each { |t| self.tag(t) } end if args.include?(:source) @@ -511,7 +512,7 @@ class Puppet::Util::Log Log.newmessage(self) end - # Was the source of this log an object? + # Was the source of this log a Puppet resource or parameter? def objectsource? if defined? @objectsource and @objectsource @objectsource @@ -533,17 +534,11 @@ class Puppet::Util::Log @objectsource = false @source = source.to_s end - unless defined? @tags and @tags - if source.respond_to?(:tags) - @tags = source.tags - end + if source.respond_to?(:tags) + source.tags.each { |t| tag(t) } end end - def tagged?(tag) - @tags.detect { |t| t.to_s == tag.to_s } - end - def to_report "%s %s (%s): %s" % [self.time, self.source, self.level, self.to_s] end -- cgit From a7744438f83c97886e81990fb34ddcbab8bc0d9e Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 3 Oct 2008 17:39:18 -0500 Subject: Fixing #1089 - Log messages are now tagged with the log level, making it easier to match messages in the 'tagmail' report. Signed-off-by: Luke Kanies --- lib/puppet/util/log.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb index f5119bbff..35249495d 100644 --- a/lib/puppet/util/log.rb +++ b/lib/puppet/util/log.rb @@ -509,6 +509,9 @@ class Puppet::Util::Log @source = "Puppet" end + # Tag myself with my log level + tag(level) + Log.newmessage(self) end -- cgit From 1c6d57e94196c8238a1609858bad5e5db15d1f0e Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 3 Oct 2008 17:42:16 -0500 Subject: Doing some simple refactorings on Puppet::Log Signed-off-by: Luke Kanies --- lib/puppet/util/log.rb | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb index 35249495d..0dfd36dfa 100644 --- a/lib/puppet/util/log.rb +++ b/lib/puppet/util/log.rb @@ -488,26 +488,16 @@ class Puppet::Util::Log raise ArgumentError, "Level is not a string or symbol: #{args[:level].class}" end - # Just return unless we're actually at a level we should send - #return unless self.class.sendlevel?(@level) - @message = args[:message].to_s @time = Time.now - # this should include the host name, and probly lots of other - # stuff, at some point - unless self.class.validlevel?(level) - raise ArgumentError, "Invalid message level #{level}" - end + + raise ArgumentError, "Invalid log level %s" % level unless self.class.validlevel?(level) if tags = args[:tags] tags.each { |t| self.tag(t) } end - if args.include?(:source) - self.source = args[:source] - else - @source = "Puppet" - end + self.source = args[:source] || "Puppet" # Tag myself with my log level tag(level) @@ -550,5 +540,8 @@ class Puppet::Util::Log return @message end end -Puppet::Log = Puppet::Util::Log +# This is for backward compatibility from when we changed the constant to Puppet::Util::Log +# because the reports include the constant name. Apparently the alias was created in +# March 2007, should could probably be removed soon. +Puppet::Log = Puppet::Util::Log -- cgit From 614326afdbe542c9d4c480df43631c1f3cfc394a Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 3 Oct 2008 18:30:52 -0500 Subject: Fixing #1098 - Multiline strings now correctly increment the line count Signed-off-by: Luke Kanies --- lib/puppet/parser/lexer.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb index 5dd036e52..9226434da 100644 --- a/lib/puppet/parser/lexer.rb +++ b/lib/puppet/parser/lexer.rb @@ -438,6 +438,9 @@ class Puppet::Parser::Lexer str.gsub!(/\\#{quote}/,quote) end + # Add to our line count for every carriage return in multi-line strings. + @line += str.count("\n") + return str end -- cgit From 750e9abc64af58e547e7b1ad5698c71feb071bf6 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sat, 4 Oct 2008 16:27:51 +0200 Subject: Fix #381 - Allow multiple resource overrides or references Allow this syntax: Resource[title1,title2] { param => value } as a compact form of Resource[title1] { param => value } Resource[title2] { param => value } This patch also introduces for free the possibility to group class references by type: exec { test: require => File["file1","file2","File3"] } which is completely equivalent to: exec { test: require => [ File["file1"],File["file2"],File["File3"] ] } --- lib/puppet/parser/ast/resource_override.rb | 39 +- lib/puppet/parser/ast/resource_reference.rb | 16 +- lib/puppet/parser/grammar.ra | 4 +- lib/puppet/parser/parser.rb | 714 ++++++++++++++-------------- 4 files changed, 383 insertions(+), 390 deletions(-) (limited to 'lib') diff --git a/lib/puppet/parser/ast/resource_override.rb b/lib/puppet/parser/ast/resource_override.rb index f9464acda..8380dcd00 100644 --- a/lib/puppet/parser/ast/resource_override.rb +++ b/lib/puppet/parser/ast/resource_override.rb @@ -19,7 +19,7 @@ class Puppet::Parser::AST # in the current scope. def evaluate(scope) # Get our object reference. - object = @object.safeevaluate(scope) + resource = @object.safeevaluate(scope) hash = {} @@ -30,21 +30,28 @@ class Puppet::Parser::AST # Now we just create a normal resource, but we call a very different # method on the scope. - obj = Puppet::Parser::Resource.new( - :type => object.type, - :title => object.title, - :params => params, - :file => @file, - :line => @line, - :source => scope.source, - :scope => scope - ) - - # Now we tell the scope that it's an override, and it behaves as - # necessary. - scope.compiler.add_override(obj) - - obj + resource = [resource] unless resource.is_a?(Array) + + resource = resource.collect do |r| + res = Puppet::Parser::Resource.new( + :type => r.type, + :title => r.title, + :params => params, + :file => @file, + :line => @line, + :source => scope.source, + :scope => scope + ) + + # Now we tell the scope that it's an override, and it behaves as + # necessary. + scope.compiler.add_override(res) + + res + end + # decapsulate array in case of only one item + return resource.pop if resource.length == 1 + return resource end # Create our ResourceDef. Handles type checking for us. diff --git a/lib/puppet/parser/ast/resource_reference.rb b/lib/puppet/parser/ast/resource_reference.rb index 4bb41165a..e5e2dce99 100644 --- a/lib/puppet/parser/ast/resource_reference.rb +++ b/lib/puppet/parser/ast/resource_reference.rb @@ -24,16 +24,20 @@ class Puppet::Parser::AST # and name. def evaluate(scope) title = @title.safeevaluate(scope) + title = [title] unless title.is_a?(Array) + if @type.to_s.downcase == "class" - objtype = "class" - title = qualified_class(scope, title) + resource_type = "class" + title = title.collect { |t| qualified_class(scope, t) } else - objtype = qualified_type(scope) + resource_type = qualified_type(scope) end - return Puppet::Parser::Resource::Reference.new( - :type => objtype, :title => title - ) + title = title.collect { |t| Puppet::Parser::Resource::Reference.new( + :type => resource_type, :title => t + ) } + return title.pop if title.length == 1 + return title end # Look up a fully qualified class name. diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index b44cd0612..affcc006c 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -400,10 +400,10 @@ boolean: BOOLEAN { result = ast AST::Boolean, :value => val[0] } -resourceref: NAME LBRACK rvalue RBRACK { +resourceref: NAME LBRACK rvalues RBRACK { Puppet.warning addcontext("Deprecation notice: Resource references should now be capitalized") result = ast AST::ResourceReference, :type => val[0], :title => val[2] -} | classref LBRACK rvalue RBRACK { +} | classref LBRACK rvalues RBRACK { result = ast AST::ResourceReference, :type => val[0], :title => val[2] } diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index b8aa4b5ed..3858d2136 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -29,7 +29,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..id272fb19b12', 'grammar.ra', 717 +module_eval <<'..end grammar.ra modeval..id9567389388', 'grammar.ra', 717 # It got too annoying having code in a file that needs to be compiled. require 'puppet/parser/parser_support' @@ -41,7 +41,7 @@ require 'puppet/parser/parser_support' # $Id$ -..end grammar.ra modeval..id272fb19b12 +..end grammar.ra modeval..id9567389388 ##### racc 1.4.5 generates ### @@ -244,42 +244,42 @@ racc_shift_n = 314 racc_action_table = [ 75, 54, 57, 270, 178, 39, 40, 283, 88, 237, - 51, 178, 89, 238, 244, 282, 286, 235, 236, 245, - 72, 75, 54, 57, 135, 90, 39, 40, 235, 236, - 135, 45, 39, 40, 129, 56, 59, 235, 236, 66, + 51, 178, 89, 213, 244, 282, 286, 198, 199, 245, + 72, 75, 54, 57, 136, 90, 39, 40, 235, 236, + 136, 45, 39, 40, 129, 56, 59, 235, 236, 66, 41, 72, 154, 44, 52, 76, 177, 162, 62, 92, 146, 84, 45, 75, 54, 57, 56, 59, 45, 126, - 66, 41, 178, 167, 44, 52, 76, 41, 188, 62, - 44, 249, 84, 72, 75, 54, 57, 288, 156, 157, - 158, 144, 145, 147, 45, 198, 54, 57, 56, 59, - 287, 233, 66, 8, 72, 154, -141, 52, 76, 232, - 162, 62, 137, 146, 84, 45, 75, 54, 57, 56, - 59, 45, 252, 66, 37, 105, 167, 37, 52, 76, - 183, 4, 62, 37, 4, 84, 72, 75, 54, 57, - 4, 156, 157, 158, 144, 145, 147, 45, -143, 211, - 256, 56, 59, 212, 213, 66, 136, 72, 154, 258, - 52, 76, 161, 162, 62, 161, 146, 84, 45, 75, - 54, 57, 56, 59, 45, 244, 66, 54, 57, 167, - 245, 52, 76, 33, 34, 62, 212, 296, 84, 72, - 75, 54, 57, -145, 156, 157, 158, 144, 145, 147, - 45, 158, 144, 135, 56, 59, 158, 144, 66, 51, - 72, 154, 263, 52, 76, -146, 162, 62, 266, 146, - 84, 45, 75, 54, 57, 56, 59, 45, -142, 66, - 229, -142, 167, -147, 52, 76, 88, -144, 62, -146, - -141, 84, 72, 75, 54, 57, 134, 156, 157, 158, - 144, 145, 147, 45, -158, -145, 132, 56, 59, -143, - 161, 66, 269, 72, 37, 172, 52, 76, 173, 108, - 62, 4, 8, 84, 45, 89, 105, 174, 56, 59, - 155, 284, 66, 156, 157, 158, 144, 52, 76, 150, - 154, 62, 285, -144, 84, 180, 100, 184, 146, 148, - 151, 153, 188, 186, 75, 54, 57, 156, 157, 158, - 144, 145, 147, 156, 157, 158, 144, 145, 147, -141, - 196, 299, 149, 152, 72, -141, 156, 157, 158, 144, - 145, 147, -144, -142, -146, 45, 75, 54, 57, 56, - 59, -143, 300, 66, 156, 157, 158, 144, 52, 76, - 188, 71, 62, 193, 191, 84, 72, 75, 54, 57, - 38, -143, 307, -190, 308, 35, 189, 45, -142, -144, - nil, 56, 59, nil, nil, 66, nil, 72, nil, nil, + 66, 41, 249, 167, 44, 52, 76, 41, -141, 62, + 44, 138, 84, 72, 75, 54, 57, 288, 156, 157, + 158, 144, 145, 147, 45, 201, 158, 144, 56, 59, + 287, 233, 66, 8, 72, 154, 252, 52, 76, 232, + 162, 62, 105, 146, 84, 45, 75, 54, 57, 56, + 59, 45, -143, 66, 37, 244, 167, 37, 52, 76, + 245, 4, 62, 256, 4, 84, 72, 75, 54, 57, + 137, 156, 157, 158, 144, 145, 147, 45, 258, 197, + 161, 56, 59, 198, 199, 66, 161, 72, 154, -145, + 52, 76, 136, 162, 62, -146, 146, 84, 45, 75, + 54, 57, 56, 59, 45, 51, 66, 37, 264, 167, + 183, 52, 76, -142, 4, 62, 158, 144, 84, 72, + 75, 54, 57, 267, 156, 157, 158, 144, 145, 147, + 45, 178, 238, 188, 56, 59, 235, 236, 66, -142, + 72, 154, 88, 52, 76, -144, 162, 62, -147, 146, + 84, 45, 75, 54, 57, 56, 59, 45, -141, 66, + 33, 34, 167, 135, 52, 76, 54, 57, 62, 198, + 296, 84, 72, 75, 54, 57, -158, 156, 157, 158, + 144, 145, 147, 45, -146, 229, 132, 56, 59, 198, + 199, 66, -145, 72, 37, -143, 52, 76, 54, 57, + 62, 4, 8, 84, 45, 269, 161, 172, 56, 59, + 155, 108, 66, 156, 157, 158, 144, 52, 76, 150, + 154, 62, 173, 105, 84, 89, 284, 285, 146, 148, + 151, 153, -144, 174, 75, 54, 57, 156, 157, 158, + 144, 145, 147, 156, 157, 158, 144, 145, 147, 100, + 180, 188, 149, 152, 72, 184, 156, 157, 158, 144, + 145, 147, 186, -141, 299, 45, 75, 54, 57, 56, + 59, -141, -144, 66, 156, 157, 158, 144, 52, 76, + -142, -146, 62, -143, 300, 84, 72, 75, 54, 57, + 188, 71, 193, 191, 38, -143, 307, 45, -190, 308, + 35, 56, 59, 189, -142, 66, -144, 72, nil, nil, 52, 76, nil, nil, 62, nil, nil, 84, 45, 75, 54, 57, 56, 59, nil, nil, 66, nil, nil, nil, nil, 52, 76, nil, nil, 62, nil, nil, 84, 72, @@ -298,14 +298,14 @@ racc_action_table = [ 56, 59, nil, nil, 66, nil, 72, nil, nil, 52, 76, nil, nil, 62, nil, nil, 84, 45, 75, 54, 57, 56, 59, nil, nil, 66, nil, nil, 45, nil, - 52, 76, 56, 116, 62, nil, 66, 84, 72, nil, - nil, 111, 75, 54, 57, 62, nil, nil, nil, 45, + 52, 76, 56, 59, 62, nil, 66, 84, 72, nil, + nil, 52, 75, 54, 57, 62, nil, nil, nil, 45, nil, nil, nil, 56, 59, nil, nil, 66, 75, 54, - 57, 141, 52, 76, nil, nil, 62, nil, nil, 84, - nil, nil, nil, 45, 75, 54, 57, 56, 59, nil, - nil, 66, nil, nil, nil, nil, 52, nil, nil, 45, + 57, nil, 52, 76, nil, nil, 62, nil, nil, 84, + nil, nil, nil, 45, 75, 54, 57, 56, 116, nil, + nil, 66, nil, nil, nil, nil, 111, nil, nil, 45, 62, nil, nil, 56, 59, nil, nil, 66, 75, 54, - 57, nil, 52, nil, nil, 45, 62, nil, nil, 56, + 57, 141, 52, nil, nil, 45, 62, nil, nil, 56, 59, nil, nil, 66, 75, 54, 57, nil, 52, nil, nil, nil, 62, nil, 75, 54, 57, nil, nil, 45, 75, 54, 57, 56, 59, nil, nil, 66, nil, nil, @@ -313,63 +313,55 @@ racc_action_table = [ 59, nil, nil, 66, nil, 45, nil, nil, 52, 56, 59, 45, 62, 66, nil, 56, 59, nil, 52, 66, nil, nil, 62, nil, 52, 75, 54, 57, 62, nil, - nil, 51, 54, 57, nil, nil, nil, nil, nil, nil, - nil, 75, 54, 57, nil, nil, nil, 75, 54, 57, - nil, 48, nil, nil, nil, nil, 45, 75, 54, 57, - 56, 59, 45, nil, 66, nil, 56, 59, nil, 52, - 66, nil, 45, 62, 49, 52, 56, 59, 45, 62, - 66, nil, 56, 195, nil, 52, 66, nil, 45, 62, - nil, 111, 56, 59, nil, 62, 66, 54, 57, 54, - 57, 52, nil, nil, nil, 62, nil, nil, nil, nil, - nil, nil, nil, 54, 57, 54, 57, nil, nil, 281, - nil, nil, nil, nil, nil, nil, nil, 45, nil, 45, - nil, 56, 195, 56, 195, 66, nil, 66, 54, 57, - 111, nil, 111, 45, 62, 45, 62, 56, 195, 56, - 195, 66, nil, 66, nil, 49, 111, nil, 111, nil, - 62, nil, 62, 54, 57, 54, 57, nil, 45, nil, - nil, nil, 56, 195, nil, nil, 66, nil, nil, 54, - 57, 111, nil, nil, nil, 62, 54, 57, nil, 205, - nil, nil, nil, 45, nil, 45, nil, 56, 195, 56, - 195, 66, nil, 66, nil, nil, 111, nil, 111, 45, - 62, nil, 62, 56, 195, nil, 45, 66, 54, 57, - 56, 195, 111, nil, 66, nil, 62, nil, nil, 111, - nil, nil, nil, 62, 54, 57, nil, nil, 131, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 45, nil, - nil, nil, 56, 59, 200, nil, 66, nil, nil, nil, - 49, 52, nil, nil, 45, 62, nil, nil, 56, 59, - nil, nil, 66, 150, 154, nil, 49, 52, nil, nil, - nil, 62, 146, 148, 151, 153, 150, 154, nil, nil, - nil, nil, nil, nil, 209, 146, 148, 151, 153, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 156, 157, 158, 144, 145, 147, nil, nil, nil, 149, - 152, 150, 154, 156, 157, 158, 144, 145, 147, nil, + nil, 75, 54, 57, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, 51, 54, 57, nil, nil, + nil, 75, 54, 57, nil, nil, 45, nil, nil, nil, + 56, 59, 45, nil, 66, 48, 56, 59, nil, 52, + 66, 54, 57, 62, nil, 52, 45, 54, 57, 62, + 56, 59, 45, nil, 66, nil, 56, 195, 49, 52, + 66, 54, 57, 62, nil, 111, 75, 54, 57, 62, + nil, 45, nil, nil, nil, 56, 195, 45, nil, 66, + nil, 56, 195, nil, 111, 66, 54, 57, 62, nil, + 111, 45, 54, 57, 62, 56, 195, 45, nil, 66, + nil, 56, 59, nil, 111, 66, nil, nil, 62, nil, + 52, 54, 57, nil, 62, 281, 45, 54, 57, nil, + 56, 195, 45, nil, 66, nil, 56, 195, 49, 111, + 66, 54, 57, 62, nil, 111, nil, 54, 57, 62, + 208, 45, nil, nil, nil, 56, 195, 45, nil, 66, + nil, 56, 195, nil, 111, 66, 54, 57, 62, nil, + 111, 45, 54, 57, 62, 56, 195, 45, nil, 66, + nil, 56, 195, nil, 111, 66, 131, nil, 62, nil, + 111, nil, 203, nil, 62, nil, 45, nil, nil, nil, + 56, 59, 45, nil, 66, nil, 56, 59, 49, 52, + 66, 150, 154, 62, 49, 52, nil, nil, nil, 62, 146, 148, 151, 153, 150, 154, nil, nil, nil, nil, - nil, nil, nil, 146, 148, 151, 153, nil, nil, nil, - nil, nil, nil, nil, 149, 152, nil, nil, 156, 157, - 158, 144, 145, 147, nil, nil, 293, nil, 152, 150, + nil, nil, 212, 146, 148, 151, 153, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 156, 157, + 158, 144, 145, 147, nil, nil, nil, 149, 152, 150, 154, 156, 157, 158, 144, 145, 147, nil, 146, 148, - 151, 153, nil, nil, nil, nil, nil, 16, nil, 23, - 27, 291, 1, 5, nil, 10, nil, 13, nil, 20, - nil, 28, 149, 152, 4, 8, 156, 157, 158, 144, - 145, 147, 16, 290, 23, 27, nil, 1, 5, nil, + 151, 153, 150, 154, nil, nil, nil, nil, nil, nil, + nil, 146, 148, 151, 153, nil, nil, nil, nil, nil, + nil, nil, 149, 152, nil, nil, 156, 157, 158, 144, + 145, 147, nil, nil, 293, nil, 152, 150, 154, 156, + 157, 158, 144, 145, 147, nil, 146, 148, 151, 153, + nil, nil, nil, nil, nil, 16, nil, 23, 27, 291, + 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, + 149, 152, 4, 8, 156, 157, 158, 144, 145, 147, + 16, 290, 23, 27, nil, 1, 5, nil, 10, nil, + 13, nil, 20, nil, 28, nil, nil, 4, 8, nil, + 268, nil, 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, - 8, nil, 268, nil, 16, nil, 23, 27, nil, 1, - 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, - nil, 4, 8, 16, 305, 23, 27, nil, 1, 5, + 8, 16, 305, 23, 27, nil, 1, 5, nil, 10, + nil, 13, nil, 20, nil, 28, nil, nil, 4, 8, + nil, 310, nil, 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, - 4, 8, nil, 310, nil, 16, nil, 23, 27, nil, - 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, - nil, nil, 4, 8, 16, 262, 23, 27, nil, 1, + 4, 8, 16, 262, 23, 27, nil, 1, 5, nil, + 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, + 8, nil, 312, nil, 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, - nil, 4, 8, nil, 312, nil, 16, nil, 23, 27, - nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, - 28, nil, nil, 4, 8, 16, 255, 23, 27, nil, - 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, - nil, nil, 4, 8, nil, 313, nil, 16, nil, 23, - 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, - nil, 28, nil, nil, 4, 8, 16, nil, 23, 27, - nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, - 28, nil, nil, 4, 8, 16, nil, 23, 27, nil, + nil, 4, 8, 16, 255, 23, 27, nil, 1, 5, + nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, + 4, 8, nil, 313, nil, 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, 8, 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, @@ -377,46 +369,49 @@ racc_action_table = [ nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, 8, 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, - 8 ] + 8, 16, nil, 23, 27, nil, 1, 5, nil, 10, + nil, 13, nil, 20, nil, 28, nil, nil, 4, 8, + 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, + 13, nil, 20, nil, 28, nil, nil, 4, 8 ] racc_action_check = [ 33, 33, 33, 231, 105, 129, 129, 241, 17, 170, - 59, 116, 17, 171, 288, 241, 246, 171, 171, 288, + 59, 116, 17, 140, 174, 241, 246, 140, 140, 174, 33, 158, 158, 158, 116, 17, 10, 10, 231, 231, 59, 33, 126, 126, 42, 33, 33, 170, 170, 33, - 129, 158, 220, 129, 33, 33, 105, 92, 33, 17, - 220, 33, 158, 144, 144, 144, 158, 158, 92, 42, - 158, 10, 161, 92, 10, 158, 158, 126, 160, 158, - 126, 175, 158, 144, 76, 76, 76, 247, 220, 220, - 220, 220, 220, 220, 144, 134, 23, 23, 144, 144, - 247, 165, 144, 134, 76, 223, 77, 144, 144, 165, - 162, 144, 71, 223, 144, 76, 145, 145, 145, 76, - 76, 162, 179, 76, 27, 180, 162, 108, 76, 76, - 108, 27, 76, 5, 108, 76, 145, 72, 72, 72, - 5, 223, 223, 223, 223, 223, 223, 145, 70, 140, - 185, 145, 145, 140, 140, 145, 68, 72, 221, 187, - 145, 145, 188, 90, 145, 189, 221, 145, 72, 154, - 154, 154, 72, 72, 90, 174, 72, 173, 173, 90, - 174, 72, 72, 1, 1, 72, 265, 265, 72, 154, - 84, 84, 84, 67, 221, 221, 221, 221, 221, 221, - 154, 227, 227, 195, 154, 154, 226, 226, 154, 198, - 84, 218, 199, 154, 154, 65, 234, 154, 206, 218, - 154, 84, 16, 16, 16, 84, 84, 234, 63, 84, - 159, 79, 234, 80, 84, 84, 61, 60, 84, 81, - 58, 84, 16, 146, 146, 146, 53, 218, 218, 218, - 218, 218, 218, 16, 52, 82, 50, 16, 16, 87, - 89, 16, 230, 146, 24, 94, 16, 16, 95, 36, - 16, 24, 24, 16, 146, 97, 35, 99, 146, 146, - 85, 244, 146, 217, 217, 217, 217, 146, 146, 85, - 85, 146, 245, 78, 146, 106, 28, 109, 85, 85, - 85, 85, 260, 112, 153, 153, 153, 224, 224, 224, - 224, 224, 224, 216, 216, 216, 216, 216, 216, 113, - 133, 268, 85, 85, 153, 271, 85, 85, 85, 85, - 85, 85, 273, 274, 275, 153, 152, 152, 152, 153, - 153, 277, 282, 153, 215, 215, 215, 215, 153, 153, - 114, 15, 153, 130, 127, 153, 152, 147, 147, 147, - 6, 125, 295, 296, 299, 2, 119, 152, 118, 115, - nil, 152, 152, nil, nil, 152, nil, 147, nil, nil, + 129, 158, 220, 129, 33, 33, 105, 90, 33, 17, + 220, 33, 158, 144, 144, 144, 158, 158, 90, 42, + 158, 10, 175, 90, 10, 158, 158, 126, 77, 158, + 126, 71, 158, 144, 76, 76, 76, 247, 220, 220, + 220, 220, 220, 220, 144, 135, 227, 227, 144, 144, + 247, 165, 144, 135, 76, 223, 179, 144, 144, 165, + 92, 144, 180, 223, 144, 76, 145, 145, 145, 76, + 76, 92, 70, 76, 5, 288, 92, 27, 76, 76, + 288, 5, 76, 185, 27, 76, 145, 72, 72, 72, + 68, 223, 223, 223, 223, 223, 223, 145, 187, 134, + 188, 145, 145, 134, 134, 145, 189, 72, 221, 67, + 145, 145, 195, 162, 145, 65, 221, 145, 72, 154, + 154, 154, 72, 72, 162, 201, 72, 108, 202, 162, + 108, 72, 72, 63, 108, 72, 226, 226, 72, 154, + 84, 84, 84, 209, 221, 221, 221, 221, 221, 221, + 154, 161, 171, 160, 154, 154, 171, 171, 154, 79, + 84, 218, 61, 154, 154, 60, 234, 154, 80, 218, + 154, 84, 16, 16, 16, 84, 84, 234, 58, 84, + 1, 1, 234, 53, 84, 84, 23, 23, 84, 266, + 266, 84, 16, 146, 146, 146, 52, 218, 218, 218, + 218, 218, 218, 16, 81, 159, 50, 16, 16, 159, + 159, 16, 82, 146, 24, 87, 16, 16, 173, 173, + 16, 24, 24, 16, 146, 230, 89, 94, 146, 146, + 85, 36, 146, 217, 217, 217, 217, 146, 146, 85, + 85, 146, 95, 35, 146, 97, 244, 245, 85, 85, + 85, 85, 78, 99, 153, 153, 153, 224, 224, 224, + 224, 224, 224, 216, 216, 216, 216, 216, 216, 28, + 106, 260, 85, 85, 153, 109, 85, 85, 85, 85, + 85, 85, 112, 113, 268, 153, 152, 152, 152, 153, + 153, 271, 273, 153, 215, 215, 215, 215, 153, 153, + 274, 275, 153, 277, 282, 153, 152, 147, 147, 147, + 114, 15, 130, 127, 6, 125, 295, 152, 296, 299, + 2, 152, 152, 119, 118, 152, 115, 147, nil, nil, 152, 152, nil, nil, 152, nil, nil, 152, 147, 148, 148, 148, 147, 147, nil, nil, 147, nil, nil, nil, nil, 147, 147, nil, nil, 147, nil, nil, 147, 148, @@ -431,124 +426,119 @@ racc_action_check = [ 156, nil, nil, 156, 34, 151, 151, 151, 34, 34, nil, nil, 34, nil, nil, nil, nil, 34, 34, nil, nil, 34, nil, nil, 34, 151, 150, 150, 150, nil, - nil, nil, nil, nil, nil, nil, 151, 38, 38, 38, + nil, nil, nil, nil, nil, nil, 151, 196, 196, 196, 151, 151, nil, nil, 151, nil, 150, nil, nil, 151, 151, nil, nil, 151, nil, nil, 151, 150, 157, 157, - 157, 150, 150, nil, nil, 150, nil, nil, 38, nil, - 150, 150, 38, 38, 150, nil, 38, 150, 157, nil, - nil, 38, 177, 177, 177, 38, nil, nil, nil, 157, - nil, nil, nil, 157, 157, nil, nil, 157, 75, 75, - 75, 75, 157, 157, nil, nil, 157, nil, nil, 157, - nil, nil, nil, 177, 51, 51, 51, 177, 177, nil, - nil, 177, nil, nil, nil, nil, 177, nil, nil, 75, - 177, nil, nil, 75, 75, nil, nil, 75, 285, 285, - 285, nil, 75, nil, nil, 51, 75, nil, nil, 51, - 51, nil, nil, 51, 266, 266, 266, nil, 51, nil, - nil, nil, 51, nil, 88, 88, 88, nil, nil, 285, - 178, 178, 178, 285, 285, nil, nil, 285, nil, nil, - nil, nil, 285, nil, nil, 266, 285, nil, nil, 266, - 266, nil, nil, 266, nil, 88, nil, nil, 266, 88, - 88, 178, 266, 88, nil, 178, 178, nil, 88, 178, - nil, nil, 88, nil, 178, 20, 20, 20, 178, nil, - nil, 13, 13, 13, nil, nil, nil, nil, nil, nil, - nil, 210, 210, 210, nil, nil, nil, 186, 186, 186, - nil, 13, nil, nil, nil, nil, 20, 284, 284, 284, - 20, 20, 13, nil, 20, nil, 13, 13, nil, 20, - 13, nil, 210, 20, 13, 13, 210, 210, 186, 13, - 210, nil, 186, 186, nil, 210, 186, nil, 284, 210, - nil, 186, 284, 284, nil, 186, 284, 205, 205, 283, - 283, 284, nil, nil, nil, 284, nil, nil, nil, nil, - nil, nil, nil, 132, 132, 239, 239, nil, nil, 239, - nil, nil, nil, nil, nil, nil, nil, 205, nil, 283, - nil, 205, 205, 283, 283, 205, nil, 283, 233, 233, - 205, nil, 283, 132, 205, 239, 283, 132, 132, 239, - 239, 132, nil, 239, nil, 132, 132, nil, 239, nil, - 132, nil, 239, 294, 294, 232, 232, nil, 233, nil, - nil, nil, 233, 233, nil, nil, 233, nil, nil, 172, - 172, 233, nil, nil, nil, 233, 136, 136, nil, 136, - nil, nil, nil, 294, nil, 232, nil, 294, 294, 232, - 232, 294, nil, 232, nil, nil, 294, nil, 232, 172, - 294, nil, 232, 172, 172, nil, 136, 172, 48, 48, - 136, 136, 172, nil, 136, nil, 172, nil, nil, 136, - nil, nil, nil, 136, 135, 135, nil, nil, 48, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 48, nil, - nil, nil, 48, 48, 135, nil, 48, nil, nil, nil, - 48, 48, nil, nil, 135, 48, nil, nil, 135, 135, - nil, nil, 135, 222, 222, nil, 135, 135, nil, nil, - nil, 135, 222, 222, 222, 222, 138, 138, nil, nil, - nil, nil, nil, nil, 138, 138, 138, 138, 138, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 222, 222, 222, 222, 222, 222, nil, nil, nil, 138, - 138, 101, 101, 138, 138, 138, 138, 138, 138, nil, - 101, 101, 101, 101, 219, 219, nil, nil, nil, nil, - nil, nil, nil, 219, 219, 219, 219, nil, nil, nil, - nil, nil, nil, nil, 101, 101, nil, nil, 101, 101, - 101, 101, 101, 101, nil, nil, 261, nil, 219, 102, - 102, 219, 219, 219, 219, 219, 219, nil, 102, 102, - 102, 102, nil, nil, nil, nil, nil, 261, nil, 261, - 261, 254, 261, 261, nil, 261, nil, 261, nil, 261, - nil, 261, 102, 102, 261, 261, 102, 102, 102, 102, - 102, 102, 254, 249, 254, 254, nil, 254, 254, nil, - 254, nil, 254, nil, 254, nil, 254, nil, nil, 254, - 254, nil, 225, nil, 249, nil, 249, 249, nil, 249, - 249, nil, 249, nil, 249, nil, 249, nil, 249, nil, - nil, 249, 249, 225, 289, 225, 225, nil, 225, 225, - nil, 225, nil, 225, nil, 225, nil, 225, nil, nil, - 225, 225, nil, 300, nil, 289, nil, 289, 289, nil, - 289, 289, nil, 289, nil, 289, nil, 289, nil, 289, - nil, nil, 289, 289, 300, 191, 300, 300, nil, 300, - 300, nil, 300, nil, 300, nil, 300, nil, 300, nil, - nil, 300, 300, nil, 309, nil, 191, nil, 191, 191, - nil, 191, 191, nil, 191, nil, 191, nil, 191, nil, - 191, nil, nil, 191, 191, 309, 184, 309, 309, nil, - 309, 309, nil, 309, nil, 309, nil, 309, nil, 309, - nil, nil, 309, 309, nil, 311, nil, 184, nil, 184, - 184, nil, 184, 184, nil, 184, nil, 184, nil, 184, - nil, 184, nil, nil, 184, 184, 311, nil, 311, 311, - nil, 311, 311, nil, 311, nil, 311, nil, 311, nil, - 311, nil, nil, 311, 311, 308, nil, 308, 308, nil, - 308, 308, nil, 308, nil, 308, nil, 308, nil, 308, - nil, nil, 308, 308, 155, nil, 155, 155, nil, 155, - 155, nil, 155, nil, 155, nil, 155, nil, 155, nil, - nil, 155, 155, 19, nil, 19, 19, nil, 19, 19, - nil, 19, nil, 19, nil, 19, nil, 19, nil, nil, - 19, 19, 0, nil, 0, 0, nil, 0, 0, nil, - 0, nil, 0, nil, 0, nil, 0, nil, nil, 0, - 0 ] + 157, 150, 150, nil, nil, 150, nil, nil, 196, nil, + 150, 150, 196, 196, 150, nil, 196, 150, 157, nil, + nil, 196, 38, 38, 38, 196, nil, nil, nil, 157, + nil, nil, nil, 157, 157, nil, nil, 157, 177, 177, + 177, nil, 157, 157, nil, nil, 157, nil, nil, 157, + nil, nil, nil, 38, 51, 51, 51, 38, 38, nil, + nil, 38, nil, nil, nil, nil, 38, nil, nil, 177, + 38, nil, nil, 177, 177, nil, nil, 177, 75, 75, + 75, 75, 177, nil, nil, 51, 177, nil, nil, 51, + 51, nil, nil, 51, 267, 267, 267, nil, 51, nil, + nil, nil, 51, nil, 88, 88, 88, nil, nil, 75, + 285, 285, 285, 75, 75, nil, nil, 75, nil, nil, + nil, nil, 75, nil, nil, 267, 75, nil, nil, 267, + 267, nil, nil, 267, nil, 88, nil, nil, 267, 88, + 88, 285, 267, 88, nil, 285, 285, nil, 88, 285, + nil, nil, 88, nil, 285, 20, 20, 20, 285, nil, + nil, 178, 178, 178, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, 13, 13, 13, nil, nil, + nil, 186, 186, 186, nil, nil, 20, nil, nil, nil, + 20, 20, 178, nil, 20, 13, 178, 178, nil, 20, + 178, 232, 232, 20, nil, 178, 13, 208, 208, 178, + 13, 13, 186, nil, 13, nil, 186, 186, 13, 13, + 186, 283, 283, 13, nil, 186, 284, 284, 284, 186, + nil, 232, nil, nil, nil, 232, 232, 208, nil, 232, + nil, 208, 208, nil, 232, 208, 132, 132, 232, nil, + 208, 283, 294, 294, 208, 283, 283, 284, nil, 283, + nil, 284, 284, nil, 283, 284, nil, nil, 283, nil, + 284, 239, 239, nil, 284, 239, 132, 233, 233, nil, + 132, 132, 294, nil, 132, nil, 294, 294, 132, 132, + 294, 172, 172, 132, nil, 294, nil, 137, 137, 294, + 137, 239, nil, nil, nil, 239, 239, 233, nil, 239, + nil, 233, 233, nil, 239, 233, 48, 48, 239, nil, + 233, 172, 136, 136, 233, 172, 172, 137, nil, 172, + nil, 137, 137, nil, 172, 137, 48, nil, 172, nil, + 137, nil, 136, nil, 137, nil, 48, nil, nil, nil, + 48, 48, 136, nil, 48, nil, 136, 136, 48, 48, + 136, 222, 222, 48, 136, 136, nil, nil, nil, 136, + 222, 222, 222, 222, 139, 139, nil, nil, nil, nil, + nil, nil, 139, 139, 139, 139, 139, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 222, 222, + 222, 222, 222, 222, nil, nil, nil, 139, 139, 101, + 101, 139, 139, 139, 139, 139, 139, nil, 101, 101, + 101, 101, 219, 219, nil, nil, nil, nil, nil, nil, + nil, 219, 219, 219, 219, nil, nil, nil, nil, nil, + nil, nil, 101, 101, nil, nil, 101, 101, 101, 101, + 101, 101, nil, nil, 261, nil, 219, 102, 102, 219, + 219, 219, 219, 219, 219, nil, 102, 102, 102, 102, + nil, nil, nil, nil, nil, 261, nil, 261, 261, 254, + 261, 261, nil, 261, nil, 261, nil, 261, nil, 261, + 102, 102, 261, 261, 102, 102, 102, 102, 102, 102, + 254, 249, 254, 254, nil, 254, 254, nil, 254, nil, + 254, nil, 254, nil, 254, nil, nil, 254, 254, nil, + 225, nil, 249, nil, 249, 249, nil, 249, 249, nil, + 249, nil, 249, nil, 249, nil, 249, nil, nil, 249, + 249, 225, 289, 225, 225, nil, 225, 225, nil, 225, + nil, 225, nil, 225, nil, 225, nil, nil, 225, 225, + nil, 300, nil, 289, nil, 289, 289, nil, 289, 289, + nil, 289, nil, 289, nil, 289, nil, 289, nil, nil, + 289, 289, 300, 191, 300, 300, nil, 300, 300, nil, + 300, nil, 300, nil, 300, nil, 300, nil, nil, 300, + 300, nil, 309, nil, 191, nil, 191, 191, nil, 191, + 191, nil, 191, nil, 191, nil, 191, nil, 191, nil, + nil, 191, 191, 309, 184, 309, 309, nil, 309, 309, + nil, 309, nil, 309, nil, 309, nil, 309, nil, nil, + 309, 309, nil, 311, nil, 184, nil, 184, 184, nil, + 184, 184, nil, 184, nil, 184, nil, 184, nil, 184, + nil, nil, 184, 184, 311, nil, 311, 311, nil, 311, + 311, nil, 311, nil, 311, nil, 311, nil, 311, nil, + nil, 311, 311, 308, nil, 308, 308, nil, 308, 308, + nil, 308, nil, 308, nil, 308, nil, 308, nil, nil, + 308, 308, 155, nil, 155, 155, nil, 155, 155, nil, + 155, nil, 155, nil, 155, nil, 155, nil, nil, 155, + 155, 19, nil, 19, 19, nil, 19, 19, nil, 19, + nil, 19, nil, 19, nil, 19, nil, nil, 19, 19, + 0, nil, 0, 0, nil, 0, 0, nil, 0, nil, + 0, nil, 0, nil, 0, nil, nil, 0, 0 ] racc_action_pointer = [ - 1294, 160, 349, nil, nil, 85, 344, nil, nil, nil, - 23, nil, nil, 699, nil, 341, 210, 6, nil, 1275, - 693, nil, nil, 83, 216, nil, nil, 76, 244, nil, - nil, nil, nil, -2, 451, 228, 224, nil, 515, nil, - nil, nil, 24, nil, nil, nil, nil, nil, 885, nil, - 236, 592, 242, 226, nil, nil, nil, nil, 209, 8, - 206, 224, nil, 197, nil, 184, nil, 162, 125, nil, - 117, 102, 125, nil, nil, 576, 72, 75, 262, 200, - 202, 208, 224, nil, 178, 264, nil, 228, 642, 212, - 131, nil, 25, nil, 249, 248, nil, 259, nil, 245, - nil, 976, 1024, nil, nil, -5, 275, nil, 79, 281, - nil, nil, 254, 288, 330, 338, 2, nil, 337, 338, - nil, nil, nil, nil, nil, 330, 29, 338, nil, 2, - 320, nil, 780, 305, 47, 901, 853, nil, 941, nil, - 134, nil, nil, nil, 51, 104, 231, 345, 377, 398, - 504, 483, 324, 292, 157, 1256, 430, 536, 19, 215, - 58, 53, 78, nil, nil, 75, nil, nil, nil, nil, - -11, -31, 846, 164, 132, 65, nil, 560, 648, 105, - 77, nil, nil, nil, 1199, 133, 715, 142, 114, 117, - nil, 1158, nil, nil, nil, 171, nil, nil, 197, 179, - nil, nil, nil, nil, nil, 764, 199, nil, nil, nil, - 709, nil, nil, nil, nil, 282, 251, 221, 185, 989, - 26, 132, 928, 79, 245, 1095, 142, 137, nil, nil, - 245, -20, 832, 805, 184, nil, nil, nil, nil, 782, - nil, -3, nil, nil, 258, 269, -7, 67, nil, 1076, - nil, nil, nil, nil, 1054, nil, nil, nil, nil, nil, - 282, 1029, nil, nil, nil, 167, 632, nil, 282, nil, - nil, 294, nil, 301, 302, 303, nil, 310, nil, nil, - nil, nil, 326, 766, 725, 616, nil, nil, -19, 1117, - nil, nil, nil, nil, 830, 345, 346, nil, nil, 348, - 1136, nil, nil, nil, nil, nil, nil, nil, 1237, 1177, - nil, 1218, nil, nil ] + 1252, 207, 354, nil, nil, 76, 348, nil, nil, nil, + 23, nil, nil, 713, nil, 351, 210, 6, nil, 1233, + 693, nil, nil, 223, 216, nil, nil, 79, 267, nil, + nil, nil, nil, -2, 451, 245, 236, nil, 560, nil, + nil, nil, 24, nil, nil, nil, nil, nil, 853, nil, + 236, 592, 234, 213, nil, nil, nil, nil, 197, 8, + 184, 200, nil, 152, nil, 134, nil, 128, 109, nil, + 91, 71, 125, nil, nil, 616, 72, 47, 271, 178, + 187, 223, 231, nil, 178, 264, nil, 234, 642, 228, + 25, nil, 78, nil, 261, 272, nil, 279, nil, 271, + nil, 934, 982, nil, nil, -5, 300, nil, 129, 309, + nil, nil, 283, 302, 340, 345, 2, nil, 343, 345, + nil, nil, nil, nil, nil, 334, 29, 347, nil, 2, + 329, nil, 783, nil, 134, 47, 859, 834, nil, 899, + 8, nil, nil, nil, 51, 104, 231, 345, 377, 398, + 504, 483, 324, 292, 157, 1214, 430, 536, 19, 240, + 183, 182, 131, nil, nil, 75, nil, nil, nil, nil, + -11, 148, 828, 255, -19, 56, nil, 576, 699, 89, + 64, nil, nil, nil, 1157, 116, 719, 131, 102, 108, + nil, 1116, nil, nil, nil, 130, 515, nil, nil, nil, + nil, 163, 145, nil, nil, nil, nil, nil, 744, 174, + nil, nil, nil, nil, nil, 282, 251, 221, 185, 947, + 26, 132, 886, 79, 245, 1053, 122, 32, nil, nil, + 258, -20, 738, 814, 184, nil, nil, nil, nil, 808, + nil, -3, nil, nil, 273, 274, -7, 67, nil, 1034, + nil, nil, nil, nil, 1012, nil, nil, nil, nil, nil, + 301, 987, nil, nil, nil, nil, 220, 632, 295, nil, + nil, 310, nil, 311, 319, 320, nil, 322, nil, nil, + nil, nil, 338, 758, 764, 648, nil, nil, 82, 1075, + nil, nil, nil, nil, 789, 349, 351, nil, nil, 353, + 1094, nil, nil, nil, nil, nil, nil, nil, 1195, 1135, + nil, 1176, nil, nil ] racc_action_default = [ -167, -191, -191, -7, -160, -191, -191, -8, -158, -9, @@ -564,20 +554,20 @@ racc_action_default = [ -41, -70, -71, -78, -80, -191, -189, -77, -191, -191, -180, -63, -59, -65, -189, -68, -62, -57, -66, -191, -146, -145, -69, -67, -73, -64, -191, -191, -178, -191, - -191, -19, -191, -191, -191, -191, -191, 314, -191, -82, + -191, -19, -191, -82, -191, -191, -191, -191, 314, -191, -191, -186, -124, -117, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, -189, -191, -167, -46, -48, -191, -55, -62, -54, -45, -191, -191, -191, -191, -168, -191, -169, -191, -191, -191, -190, -181, -182, -183, -191, -191, -60, -191, -190, -72, - -179, -191, -162, -18, -24, -62, -105, -34, -191, -191, - -101, -136, -141, -144, -142, -191, -191, -143, -135, -127, - -191, -185, -187, -188, -113, -115, -119, -116, -121, -126, + -179, -191, -162, -18, -24, -62, -191, -105, -187, -188, + -34, -191, -191, -101, -136, -141, -144, -142, -191, -191, + -143, -135, -127, -185, -113, -115, -119, -116, -121, -126, -123, -120, -125, -122, -118, -191, -111, -112, -114, -106, -191, -191, -191, -191, -191, -51, -50, -44, -43, -191, -129, -191, -133, -150, -177, -175, -191, -191, -172, -191, -76, -75, -38, -81, -191, -155, -35, -58, -36, -74, - -189, -191, -157, -100, -138, -189, -191, -83, -108, -37, + -189, -191, -157, -83, -100, -138, -189, -191, -108, -37, -49, -85, -52, -89, -86, -87, -88, -84, -53, -47, -130, -128, -191, -191, -191, -191, -170, -171, -191, -191, -153, -154, -56, -156, -191, -191, -188, -140, -107, -191, @@ -585,134 +575,126 @@ racc_action_default = [ -132, -191, -131, -109 ] racc_goto_table = [ - 2, 69, 19, 206, 17, 93, 179, 70, 122, 107, - 47, 210, 201, 46, 187, 117, 36, 96, 15, 2, - 114, 43, 22, 17, 64, 248, 123, 170, 97, 171, - 104, 240, 125, 272, 278, 279, 69, 140, 99, 242, - 91, 298, 70, 239, 106, 130, 185, 208, 46, 64, - 63, 112, 265, 95, 175, 109, 42, 127, 110, 64, - 230, 194, 246, 247, 128, 98, 181, nil, nil, nil, - nil, 160, 206, 94, nil, 118, nil, nil, nil, nil, - nil, 264, nil, nil, nil, 63, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 280, 231, - nil, nil, nil, nil, 133, nil, 242, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 182, - 69, 176, nil, 69, nil, nil, 70, nil, 139, 70, - 207, nil, 199, 58, 197, 46, 294, 190, nil, 304, - 192, 159, nil, 64, nil, nil, 64, 64, nil, nil, - 301, nil, nil, nil, 107, 2, 122, 225, 113, 17, - 292, 206, 259, 257, nil, 295, 207, 243, 58, 63, - 306, 260, 63, 204, 123, 253, nil, nil, nil, nil, - 125, nil, nil, 64, 2, nil, 254, nil, 17, nil, - nil, 2, nil, 261, nil, 17, nil, 64, nil, 207, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 204, - 166, 93, 166, 65, nil, nil, 64, nil, nil, nil, - 276, 276, nil, 118, nil, 2, 277, 277, nil, 17, - 250, 251, nil, 207, nil, nil, nil, nil, 120, 67, - 93, nil, 204, 64, 64, nil, nil, 93, 65, 2, - 64, 289, 58, 17, 2, 58, 202, nil, 17, nil, - nil, 2, nil, 267, 121, 17, nil, nil, nil, 274, - 274, nil, nil, nil, 67, 93, 204, 207, nil, nil, - nil, nil, 166, nil, nil, nil, nil, nil, 207, 2, - nil, nil, 202, 17, 64, 93, nil, 93, 60, nil, - 2, nil, 309, nil, 17, 64, 113, nil, 2, 2, - 311, 2, 17, 17, nil, 17, nil, nil, nil, 297, - 204, nil, nil, 115, nil, 202, nil, nil, nil, nil, - nil, 204, 65, 60, nil, 65, 120, 302, 303, nil, + 2, 70, 19, 122, 17, 93, 47, 104, 117, 107, + 179, 96, 209, 46, 204, 43, 36, 240, 187, 2, + 15, 134, 114, 17, 64, 248, 125, 279, 97, 22, + 170, 91, 171, 272, 278, 294, 70, 298, 99, 239, + 106, 130, 185, 211, 63, 140, 112, 242, 46, 64, + 266, 95, 175, 58, 109, 42, 127, 194, 159, 64, + 246, 247, 98, 181, 230, 110, nil, nil, nil, 118, + nil, 128, nil, 160, nil, nil, nil, nil, 113, 63, + nil, nil, nil, 209, 280, 265, nil, 69, 58, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 271, 271, 166, nil, nil, nil, 67, 202, - nil, 67, 121, nil, nil, nil, nil, nil, nil, nil, - 85, nil, 120, nil, nil, 168, nil, 168, nil, nil, - nil, nil, nil, nil, nil, nil, 120, 101, 102, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 121, nil, - nil, nil, nil, 202, nil, 120, nil, nil, nil, nil, - nil, nil, 121, nil, 202, nil, nil, 60, nil, nil, - 60, 203, nil, nil, nil, nil, 138, nil, nil, nil, - 142, 121, 275, 275, nil, nil, nil, nil, 143, 120, - nil, nil, nil, nil, nil, nil, nil, 168, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 203, 121, 121, - nil, nil, nil, nil, nil, 121, nil, nil, nil, nil, - nil, 115, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, 120, nil, nil, nil, nil, nil, nil, - 203, nil, nil, nil, 120, nil, nil, nil, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 121, - 226, 227, 228, nil, nil, nil, nil, 273, 273, 168, - 121, nil, nil, nil, 203, nil, nil, nil, nil, nil, + nil, nil, 231, nil, nil, nil, nil, nil, nil, nil, + nil, 94, 123, nil, 242, nil, nil, nil, nil, 182, + 70, nil, 69, nil, 70, 210, nil, nil, 176, 202, + 166, 190, 166, nil, 192, 200, 46, nil, nil, 304, + nil, nil, 133, 64, nil, nil, nil, 64, 64, nil, + nil, 122, 253, nil, 107, 2, 257, 225, 301, 17, + 210, 243, 259, 63, 292, nil, 133, 63, 207, 209, + 295, 306, 58, 260, 125, nil, 58, 205, nil, 133, + nil, nil, nil, 64, 2, nil, 254, nil, 17, nil, + nil, 2, nil, 261, nil, 17, 210, 64, 65, nil, + nil, nil, 166, 207, nil, nil, 69, 67, nil, nil, + 69, 93, 205, nil, nil, nil, nil, 118, nil, 64, + 277, 277, nil, 120, nil, 2, 113, 210, nil, 17, + nil, nil, 121, 65, nil, nil, nil, nil, nil, 207, + 93, 60, 67, 64, 64, nil, nil, 93, 205, 2, + 64, 289, nil, 17, 2, nil, nil, nil, 17, nil, + 123, 2, nil, 274, 274, 17, 115, nil, 250, 251, + 207, 210, 271, 271, 166, 93, 60, nil, nil, 205, + nil, nil, 210, nil, nil, nil, nil, 263, nil, 2, + nil, nil, nil, 17, 64, 93, nil, 93, nil, nil, + 2, nil, 309, nil, 17, 64, 276, 276, 2, 2, + 311, 2, 17, 17, 207, 17, nil, 65, 168, nil, + 168, 65, 120, 205, nil, 207, 67, nil, nil, nil, + 67, 121, nil, nil, 205, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, 120, 297, nil, + 60, nil, nil, nil, 60, 206, 121, nil, nil, nil, + nil, 120, nil, nil, nil, 302, 303, nil, nil, nil, + 121, nil, nil, nil, nil, nil, nil, nil, nil, nil, + 168, nil, nil, 120, nil, 85, nil, nil, nil, nil, + 206, nil, 121, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 101, 102, 115, nil, nil, 275, 275, nil, + nil, nil, nil, nil, 120, nil, 121, 121, nil, nil, + nil, nil, nil, 121, nil, nil, 206, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 139, nil, nil, nil, 142, nil, nil, nil, nil, + 273, 273, 168, 143, nil, nil, nil, 206, 120, nil, + nil, nil, nil, nil, nil, nil, nil, 121, nil, 120, + nil, nil, nil, nil, nil, nil, nil, nil, 121, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 203, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 203 ] + nil, 206, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 206, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, nil, 226, 227, 228 ] racc_goto_check = [ - 29, 27, 2, 60, 35, 4, 34, 28, 48, 50, - 18, 55, 62, 29, 34, 45, 30, 28, 1, 29, - 33, 69, 3, 35, 47, 72, 27, 39, 35, 39, - 53, 58, 28, 44, 44, 40, 27, 54, 30, 60, - 38, 56, 28, 57, 36, 18, 32, 61, 29, 47, - 24, 31, 63, 64, 65, 66, 67, 68, 3, 47, - 34, 21, 70, 71, 3, 5, 73, nil, nil, nil, - nil, 33, 60, 51, nil, 24, nil, nil, nil, nil, - nil, 62, nil, nil, nil, 24, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 58, 39, - nil, nil, nil, nil, 51, nil, 60, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 30, - 27, 3, nil, 27, nil, nil, 28, nil, 51, 28, - 28, nil, 18, 22, 29, 29, 55, 69, nil, 72, - 69, 51, nil, 47, nil, nil, 47, 47, nil, nil, - 60, nil, nil, nil, 50, 29, 48, 2, 22, 35, - 34, 60, 50, 45, nil, 34, 28, 28, 22, 24, - 62, 33, 24, 24, 27, 53, nil, nil, nil, nil, - 28, nil, nil, 47, 29, nil, 2, nil, 35, nil, - nil, 29, nil, 2, nil, 35, nil, 47, nil, 28, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 24, - 22, 4, 22, 25, nil, nil, 47, nil, nil, nil, - 27, 27, nil, 24, nil, 29, 28, 28, nil, 35, - 51, 51, nil, 28, nil, nil, nil, nil, 25, 26, - 4, nil, 24, 47, 47, nil, nil, 4, 25, 29, - 47, 2, 22, 35, 29, 22, 22, nil, 35, nil, - nil, 29, nil, 51, 26, 35, nil, nil, nil, 24, - 24, nil, nil, nil, 26, 4, 24, 28, nil, nil, - nil, nil, 22, nil, nil, nil, nil, nil, 28, 29, - nil, nil, 22, 35, 47, 4, nil, 4, 23, nil, - 29, nil, 2, nil, 35, 47, 22, nil, 29, 29, - 2, 29, 35, 35, nil, 35, nil, nil, nil, 51, - 24, nil, nil, 23, nil, 22, nil, nil, nil, nil, - nil, 24, 25, 23, nil, 25, 25, 51, 51, nil, + 29, 28, 2, 48, 35, 4, 18, 53, 45, 50, + 34, 28, 60, 29, 62, 69, 30, 58, 34, 29, + 1, 54, 33, 35, 47, 72, 28, 40, 35, 3, + 39, 38, 39, 44, 44, 55, 28, 56, 30, 57, + 36, 18, 32, 61, 24, 54, 31, 60, 29, 47, + 63, 64, 65, 22, 66, 67, 68, 21, 54, 47, + 70, 71, 5, 73, 34, 3, nil, nil, nil, 24, + nil, 3, nil, 33, nil, nil, nil, nil, 22, 24, + nil, nil, nil, 60, 58, 62, nil, 27, 22, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 22, 22, 22, nil, nil, nil, 26, 22, - nil, 26, 26, nil, nil, nil, nil, nil, nil, nil, - 49, nil, 25, nil, nil, 23, nil, 23, nil, nil, - nil, nil, nil, nil, nil, nil, 25, 49, 49, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 26, nil, - nil, nil, nil, 22, nil, 25, nil, nil, nil, nil, - nil, nil, 26, nil, 22, nil, nil, 23, nil, nil, - 23, 23, nil, nil, nil, nil, 49, nil, nil, nil, - 49, 26, 25, 25, nil, nil, nil, nil, 49, 25, - nil, nil, nil, nil, nil, nil, nil, 23, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 23, 26, 26, - nil, nil, nil, nil, nil, 26, nil, nil, nil, nil, - nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, 25, nil, nil, nil, nil, nil, nil, - 23, nil, nil, nil, 25, nil, nil, nil, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 26, - 49, 49, 49, nil, nil, nil, nil, 23, 23, 23, - 26, nil, nil, nil, 23, nil, nil, nil, nil, nil, + nil, nil, 39, nil, nil, nil, nil, nil, nil, nil, + nil, 51, 27, nil, 60, nil, nil, nil, nil, 30, + 28, nil, 27, nil, 28, 28, nil, nil, 3, 18, + 22, 69, 22, nil, 69, 29, 29, nil, nil, 72, + nil, nil, 51, 47, nil, nil, nil, 47, 47, nil, + nil, 48, 53, nil, 50, 29, 45, 2, 60, 35, + 28, 28, 50, 24, 34, nil, 51, 24, 24, 60, + 34, 62, 22, 33, 28, nil, 22, 22, nil, 51, + nil, nil, nil, 47, 29, nil, 2, nil, 35, nil, + nil, 29, nil, 2, nil, 35, 28, 47, 25, nil, + nil, nil, 22, 24, nil, nil, 27, 26, nil, nil, + 27, 4, 22, nil, nil, nil, nil, 24, nil, 47, + 28, 28, nil, 25, nil, 29, 22, 28, nil, 35, + nil, nil, 26, 25, nil, nil, nil, nil, nil, 24, + 4, 23, 26, 47, 47, nil, nil, 4, 22, 29, + 47, 2, nil, 35, 29, nil, nil, nil, 35, nil, + 27, 29, nil, 24, 24, 35, 23, nil, 51, 51, + 24, 28, 22, 22, 22, 4, 23, nil, nil, 22, + nil, nil, 28, nil, nil, nil, nil, 51, nil, 29, + nil, nil, nil, 35, 47, 4, nil, 4, nil, nil, + 29, nil, 2, nil, 35, 47, 27, 27, 29, 29, + 2, 29, 35, 35, 24, 35, nil, 25, 23, nil, + 23, 25, 25, 22, nil, 24, 26, nil, nil, nil, + 26, 26, nil, nil, 22, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, 25, 51, nil, + 23, nil, nil, nil, 23, 23, 26, nil, nil, nil, + nil, 25, nil, nil, nil, 51, 51, nil, nil, nil, + 26, nil, nil, nil, nil, nil, nil, nil, nil, nil, + 23, nil, nil, 25, nil, 49, nil, nil, nil, nil, + 23, nil, 26, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 49, 49, 23, nil, nil, 25, 25, nil, + nil, nil, nil, nil, 25, nil, 26, 26, nil, nil, + nil, nil, nil, 26, nil, nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 49, nil, nil, nil, 49, nil, nil, nil, nil, + 23, 23, 23, 49, nil, nil, nil, 23, 25, nil, + nil, nil, nil, nil, nil, nil, nil, 26, nil, 25, + nil, nil, nil, nil, nil, nil, nil, nil, 26, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 23, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 23 ] + nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 23, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, nil, 49, 49, 49 ] racc_goto_pointer = [ - nil, 18, 2, 22, -14, 41, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, -3, nil, - nil, -71, 120, 285, 37, 200, 226, -12, -6, 0, - 11, 13, -66, -18, -100, 4, 9, nil, 23, -63, - -199, nil, nil, nil, -199, -23, nil, 11, -30, 354, - -26, 53, nil, -5, -38, -129, -227, -129, -141, nil, - -133, -89, -124, -153, 30, -45, 19, 46, 15, 11, - -112, -111, -149, -42 ] + nil, 20, 2, 29, -14, 38, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, -7, nil, + nil, -75, 40, 228, 31, 185, 194, 74, -12, 0, + 11, 8, -70, -16, -96, 4, 5, nil, 14, -60, + -207, nil, nil, nil, -199, -30, nil, 11, -35, 379, + -26, 91, nil, -28, -30, -231, -231, -133, -155, nil, + -125, -94, -123, -158, 28, -47, 18, 45, 14, 5, + -114, -113, -149, -45 ] racc_goto_default = [ nil, nil, nil, 169, 26, 30, 32, 3, 7, 9, @@ -720,7 +702,7 @@ racc_goto_default = [ 53, 55, 77, 78, 79, 81, 82, 86, 87, 74, 6, nil, nil, nil, nil, 61, nil, 24, nil, nil, 163, 234, 164, 165, nil, nil, 119, 80, 83, nil, - 124, 73, 103, nil, nil, nil, nil, nil, nil, 241, + 124, 73, 103, nil, nil, 196, nil, nil, nil, 241, 68, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ] @@ -940,7 +922,7 @@ Racc_token_to_s_table = [ 'argument', 'classnameordefault'] -Racc_debug_parser = true +Racc_debug_parser = false ##### racc system variables end ##### -- cgit From 990e8e3caadf488b5dd1d6b3bcb30df492f99647 Mon Sep 17 00:00:00 2001 From: Francois Deppierraz Date: Sat, 27 Sep 2008 18:44:13 +0200 Subject: Fix #1530: Correctly parse ssh type 1 keys This doesn't implies that puppet can managed SSH type 1 keys, it only ignores them. --- lib/puppet/provider/ssh_authorized_key/parsed.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/puppet/provider/ssh_authorized_key/parsed.rb b/lib/puppet/provider/ssh_authorized_key/parsed.rb index 602e6dd1b..5411a1fb8 100644 --- a/lib/puppet/provider/ssh_authorized_key/parsed.rb +++ b/lib/puppet/provider/ssh_authorized_key/parsed.rb @@ -30,6 +30,12 @@ Puppet::Type.type(:ssh_authorized_key).provide(:parsed, end } + record_line :key_v1, + :fields => %w{options bits exponent modulus name}, + :optional => %w{options}, + :rts => /^\s+/, + :match => /^(?:(.+) )?(\d+) (\d+) (\d+)(?: (.+))?$/ + def prefetch # This was done in the type class but path expansion was failing for # not yet existing users, the only workaround I found was to move that -- cgit From 5268487ac862eec6381d315800d6f56c51dc57b5 Mon Sep 17 00:00:00 2001 From: Francois Deppierraz Date: Sat, 27 Sep 2008 18:52:58 +0200 Subject: Fixed documentation, typo and added CHANGELOG entry --- lib/puppet/type/ssh_authorized_key.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb index 1db4a0ac3..4afca1cca 100644 --- a/lib/puppet/type/ssh_authorized_key.rb +++ b/lib/puppet/type/ssh_authorized_key.rb @@ -1,6 +1,7 @@ module Puppet newtype(:ssh_authorized_key) do - @doc = "Manages ssh authorized keys." + @doc = "Manages SSH authorized keys. Currently only type 2 keys are + supported." ensurable @@ -11,8 +12,7 @@ module Puppet end newproperty(:type) do - desc "The encryption type used. Usually ssh-dss or ssh-rsa for - SSH version 2. Not used for SSH version 1." + desc "The encryption type used: ssh-dss or ssh-rsa." newvalue("ssh-dss") newvalue("ssh-rsa") -- cgit From 0c297be5dad784e305ef194cee29b11a92d31b6b Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sat, 4 Oct 2008 16:11:03 +0200 Subject: Fix #1109 - allow empty if or else branches This changesets allow empty if or else branches: if true { } else { } It works by emitting on the parser stack an AST node that doesn't do anything (a no-op). This allows the less intrusive code as no part of the if evaluation code has been touched. --- lib/puppet/parser/ast.rb | 1 + lib/puppet/parser/ast/nop.rb | 11 + lib/puppet/parser/grammar.ra | 15 + lib/puppet/parser/parser.rb | 1173 ++++++++++++++++++++++-------------------- 4 files changed, 637 insertions(+), 563 deletions(-) create mode 100644 lib/puppet/parser/ast/nop.rb (limited to 'lib') diff --git a/lib/puppet/parser/ast.rb b/lib/puppet/parser/ast.rb index 5aa9f528a..ddf88521c 100644 --- a/lib/puppet/parser/ast.rb +++ b/lib/puppet/parser/ast.rb @@ -91,6 +91,7 @@ require 'puppet/parser/ast/ifstatement' require 'puppet/parser/ast/leaf' require 'puppet/parser/ast/minus' require 'puppet/parser/ast/node' +require 'puppet/parser/ast/nop' require 'puppet/parser/ast/not' require 'puppet/parser/ast/resource' require 'puppet/parser/ast/resource_defaults' diff --git a/lib/puppet/parser/ast/nop.rb b/lib/puppet/parser/ast/nop.rb new file mode 100644 index 000000000..ea5232043 --- /dev/null +++ b/lib/puppet/parser/ast/nop.rb @@ -0,0 +1,11 @@ +require 'puppet/parser/ast/branch' + +class Puppet::Parser::AST + # This class is a no-op, it doesn't produce anything + # when evaluated, hence it's name :-) + class Nop < AST::Leaf + def evaluate(scope) + # nothing to do + end + end +end diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index affcc006c..7f07cc322 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -417,6 +417,18 @@ ifstatement: IF expression LBRACE statements RBRACE else { args[:else] = val[5] end + result = ast AST::IfStatement, args +} + | IF expression LBRACE RBRACE else { + args = { + :test => val[1], + :statements => ast(AST::Nop) + } + + if val[4] + args[:else] = val[4] + end + result = ast AST::IfStatement, args } @@ -424,6 +436,9 @@ else: # nothing | ELSE LBRACE statements RBRACE { result = ast AST::Else, :statements => val[2] } + | ELSE LBRACE RBRACE { + result = ast AST::Else, :statements => ast(AST::Nop) +} # Unlike yacc/bison, it seems racc # gives tons of shift/reduce warnings diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index 3858d2136..b025d52c5 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -29,7 +29,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..id9567389388', 'grammar.ra', 717 +module_eval <<'..end grammar.ra modeval..idf5ced460e1', 'grammar.ra', 732 # It got too annoying having code in a file that needs to be compiled. require 'puppet/parser/parser_support' @@ -41,7 +41,7 @@ require 'puppet/parser/parser_support' # $Id$ -..end grammar.ra modeval..id9567389388 +..end grammar.ra modeval..idf5ced460e1 ##### racc 1.4.5 generates ### @@ -154,39 +154,41 @@ racc_reduce_table = [ 4, 88, :_reduce_105, 4, 88, :_reduce_106, 6, 69, :_reduce_107, + 5, 69, :_reduce_108, 0, 115, :_reduce_none, - 4, 115, :_reduce_109, + 4, 115, :_reduce_110, + 3, 115, :_reduce_111, 1, 108, :_reduce_none, - 3, 108, :_reduce_111, - 3, 108, :_reduce_112, 3, 108, :_reduce_113, 3, 108, :_reduce_114, 3, 108, :_reduce_115, 3, 108, :_reduce_116, - 2, 108, :_reduce_117, + 3, 108, :_reduce_117, 3, 108, :_reduce_118, - 3, 108, :_reduce_119, + 2, 108, :_reduce_119, 3, 108, :_reduce_120, 3, 108, :_reduce_121, 3, 108, :_reduce_122, 3, 108, :_reduce_123, - 2, 108, :_reduce_124, + 3, 108, :_reduce_124, 3, 108, :_reduce_125, - 3, 108, :_reduce_126, + 2, 108, :_reduce_126, 3, 108, :_reduce_127, - 5, 68, :_reduce_128, + 3, 108, :_reduce_128, + 3, 108, :_reduce_129, + 5, 68, :_reduce_130, 1, 116, :_reduce_none, - 2, 116, :_reduce_130, - 5, 117, :_reduce_131, - 4, 117, :_reduce_132, + 2, 116, :_reduce_132, + 5, 117, :_reduce_133, + 4, 117, :_reduce_134, 1, 118, :_reduce_none, - 3, 118, :_reduce_134, - 3, 86, :_reduce_135, + 3, 118, :_reduce_136, + 3, 86, :_reduce_137, 1, 120, :_reduce_none, - 4, 120, :_reduce_137, + 4, 120, :_reduce_139, 1, 122, :_reduce_none, - 3, 122, :_reduce_139, - 3, 121, :_reduce_140, + 3, 122, :_reduce_141, + 3, 121, :_reduce_142, 1, 119, :_reduce_none, 1, 119, :_reduce_none, 1, 119, :_reduce_none, @@ -194,92 +196,92 @@ racc_reduce_table = [ 1, 119, :_reduce_none, 1, 119, :_reduce_none, 1, 119, :_reduce_none, - 1, 119, :_reduce_148, - 1, 123, :_reduce_149, - 3, 123, :_reduce_150, - 2, 70, :_reduce_151, - 6, 72, :_reduce_152, - 5, 72, :_reduce_153, - 6, 73, :_reduce_154, - 5, 73, :_reduce_155, - 6, 74, :_reduce_156, - 5, 74, :_reduce_157, + 1, 119, :_reduce_150, + 1, 123, :_reduce_151, + 3, 123, :_reduce_152, + 2, 70, :_reduce_153, + 6, 72, :_reduce_154, + 5, 72, :_reduce_155, + 6, 73, :_reduce_156, + 5, 73, :_reduce_157, + 6, 74, :_reduce_158, + 5, 74, :_reduce_159, 1, 94, :_reduce_none, 1, 89, :_reduce_none, 1, 89, :_reduce_none, 1, 126, :_reduce_none, - 3, 126, :_reduce_162, + 3, 126, :_reduce_164, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, 1, 128, :_reduce_none, - 0, 62, :_reduce_167, - 0, 129, :_reduce_168, + 0, 62, :_reduce_169, + 0, 129, :_reduce_170, 1, 124, :_reduce_none, - 3, 124, :_reduce_170, - 3, 124, :_reduce_171, + 3, 124, :_reduce_172, + 3, 124, :_reduce_173, 1, 130, :_reduce_none, - 3, 130, :_reduce_173, - 3, 131, :_reduce_174, - 1, 131, :_reduce_175, + 3, 130, :_reduce_175, 3, 131, :_reduce_176, 1, 131, :_reduce_177, + 3, 131, :_reduce_178, + 1, 131, :_reduce_179, 1, 127, :_reduce_none, - 2, 127, :_reduce_179, + 2, 127, :_reduce_181, 1, 125, :_reduce_none, - 2, 125, :_reduce_181, + 2, 125, :_reduce_183, 1, 132, :_reduce_none, 1, 132, :_reduce_none, - 1, 82, :_reduce_184, - 3, 107, :_reduce_185, - 2, 107, :_reduce_186, + 1, 82, :_reduce_186, + 3, 107, :_reduce_187, + 2, 107, :_reduce_188, 1, 114, :_reduce_none, 1, 114, :_reduce_none, 0, 93, :_reduce_none, - 1, 93, :_reduce_190 ] + 1, 93, :_reduce_192 ] -racc_reduce_n = 191 +racc_reduce_n = 193 -racc_shift_n = 314 +racc_shift_n = 317 racc_action_table = [ - 75, 54, 57, 270, 178, 39, 40, 283, 88, 237, - 51, 178, 89, 213, 244, 282, 286, 198, 199, 245, - 72, 75, 54, 57, 136, 90, 39, 40, 235, 236, - 136, 45, 39, 40, 129, 56, 59, 235, 236, 66, + 75, 54, 57, 273, 178, 39, 40, 201, 88, 238, + 51, 178, 89, 213, 245, 8, 265, 198, 199, 246, + 72, 75, 54, 57, 136, 90, 39, 40, 236, 237, + 136, 45, 39, 40, 129, 56, 59, 236, 237, 66, 41, 72, 154, 44, 52, 76, 177, 162, 62, 92, 146, 84, 45, 75, 54, 57, 56, 59, 45, 126, - 66, 41, 249, 167, 44, 52, 76, 41, -141, 62, - 44, 138, 84, 72, 75, 54, 57, 288, 156, 157, - 158, 144, 145, 147, 45, 201, 158, 144, 56, 59, - 287, 233, 66, 8, 72, 154, 252, 52, 76, 232, - 162, 62, 105, 146, 84, 45, 75, 54, 57, 56, - 59, 45, -143, 66, 37, 244, 167, 37, 52, 76, - 245, 4, 62, 256, 4, 84, 72, 75, 54, 57, - 137, 156, 157, 158, 144, 145, 147, 45, 258, 197, - 161, 56, 59, 198, 199, 66, 161, 72, 154, -145, - 52, 76, 136, 162, 62, -146, 146, 84, 45, 75, - 54, 57, 56, 59, 45, 51, 66, 37, 264, 167, - 183, 52, 76, -142, 4, 62, 158, 144, 84, 72, - 75, 54, 57, 267, 156, 157, 158, 144, 145, 147, - 45, 178, 238, 188, 56, 59, 235, 236, 66, -142, - 72, 154, 88, 52, 76, -144, 162, 62, -147, 146, - 84, 45, 75, 54, 57, 56, 59, 45, -141, 66, - 33, 34, 167, 135, 52, 76, 54, 57, 62, 198, - 296, 84, 72, 75, 54, 57, -158, 156, 157, 158, - 144, 145, 147, 45, -146, 229, 132, 56, 59, 198, - 199, 66, -145, 72, 37, -143, 52, 76, 54, 57, - 62, 4, 8, 84, 45, 269, 161, 172, 56, 59, - 155, 108, 66, 156, 157, 158, 144, 52, 76, 150, - 154, 62, 173, 105, 84, 89, 284, 285, 146, 148, - 151, 153, -144, 174, 75, 54, 57, 156, 157, 158, - 144, 145, 147, 156, 157, 158, 144, 145, 147, 100, - 180, 188, 149, 152, 72, 184, 156, 157, 158, 144, - 145, 147, 186, -141, 299, 45, 75, 54, 57, 56, - 59, -141, -144, 66, 156, 157, 158, 144, 52, 76, - -142, -146, 62, -143, 300, 84, 72, 75, 54, 57, - 188, 71, 193, 191, 38, -143, 307, 45, -190, 308, - 35, 56, 59, 189, -142, 66, -144, 72, nil, nil, + 66, 41, 250, 167, 44, 52, 76, 41, -146, 62, + 44, -143, 84, 72, 75, 54, 57, 291, 156, 157, + 158, 144, 145, 147, 45, 234, 253, 286, 56, 59, + 290, 162, 66, 233, 72, 285, 37, 52, 76, 158, + 144, 62, 45, 4, 84, 45, 154, 167, 37, 56, + 59, 155, 162, 66, 146, 4, 8, 37, 52, 76, + 150, 154, 62, 45, 4, 84, 158, 144, 167, 146, + 148, 151, 153, 105, 230, 75, 54, 57, 198, 199, + 33, 34, 156, 157, 158, 144, 145, 147, 156, 157, + 158, 144, 138, 149, 152, 72, 154, 156, 157, 158, + 144, 145, 147, 257, 146, 162, 45, 75, 54, 57, + 56, 59, 245, -145, 66, 37, 45, 246, 183, 52, + 76, 167, 4, 62, 54, 57, 84, 72, 75, 54, + 57, 259, 156, 157, 158, 144, 145, 147, 45, 161, + 239, 161, 56, 59, 236, 237, 66, 137, 72, 154, + 136, 52, 76, 198, 299, 62, -147, 146, 84, 45, + 75, 54, 57, 56, 59, 197, 51, 66, -144, 198, + 199, -148, 52, 76, 54, 57, 62, 268, 178, 84, + 72, 75, 54, 57, 188, 156, 157, 158, 144, 145, + 147, 45, -149, -144, 88, 56, 59, -146, -148, 66, + -143, 72, 135, -147, 52, 76, -160, 271, 62, -145, + 161, 84, 45, 75, 54, 57, 56, 59, 272, 172, + 66, 156, 157, 158, 144, 52, 76, 132, 173, 62, + 89, 108, 84, 72, 75, 54, 57, 156, 157, 158, + 144, 145, 147, 174, 45, 287, 288, 289, 56, 59, + 180, 105, 66, 100, 72, 188, 184, 52, 76, 186, + -143, 62, 271, 302, 84, 45, 75, 54, 57, 56, + 59, -143, -146, 66, -144, -148, -145, 303, 52, 76, + 188, -146, 62, 71, 193, 84, 72, 75, 54, 57, + 156, 157, 158, 144, 145, 147, 191, 45, 38, 310, + -192, 56, 59, -145, 35, 66, 189, 72, -144, nil, 52, 76, nil, nil, 62, nil, nil, 84, 45, 75, 54, 57, 56, 59, nil, nil, 66, nil, nil, nil, nil, 52, 76, nil, nil, 62, nil, nil, 84, 72, @@ -298,411 +300,433 @@ racc_action_table = [ 56, 59, nil, nil, 66, nil, 72, nil, nil, 52, 76, nil, nil, 62, nil, nil, 84, 45, 75, 54, 57, 56, 59, nil, nil, 66, nil, nil, 45, nil, - 52, 76, 56, 59, 62, nil, 66, 84, 72, nil, - nil, 52, 75, 54, 57, 62, nil, nil, nil, 45, + 52, 76, 56, 116, 62, nil, 66, 84, 72, nil, + nil, 111, 75, 54, 57, 62, nil, nil, nil, 45, nil, nil, nil, 56, 59, nil, nil, 66, 75, 54, - 57, nil, 52, 76, nil, nil, 62, nil, nil, 84, - nil, nil, nil, 45, 75, 54, 57, 56, 116, nil, - nil, 66, nil, nil, nil, nil, 111, nil, nil, 45, + 57, 141, 52, 76, nil, nil, 62, nil, nil, 84, + nil, nil, nil, 45, 75, 54, 57, 56, 59, nil, + nil, 66, nil, nil, nil, nil, 52, nil, nil, 45, 62, nil, nil, 56, 59, nil, nil, 66, 75, 54, - 57, 141, 52, nil, nil, 45, 62, nil, nil, 56, + 57, nil, 52, nil, nil, 45, 62, nil, nil, 56, 59, nil, nil, 66, 75, 54, 57, nil, 52, nil, nil, nil, 62, nil, 75, 54, 57, nil, nil, 45, 75, 54, 57, 56, 59, nil, nil, 66, nil, nil, nil, nil, 52, nil, nil, 45, 62, nil, nil, 56, 59, nil, nil, 66, nil, 45, nil, nil, 52, 56, - 59, 45, 62, 66, nil, 56, 59, nil, 52, 66, + 195, 45, 62, 66, nil, 56, 59, nil, 111, 66, nil, nil, 62, nil, 52, 75, 54, 57, 62, nil, - nil, 75, 54, 57, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 51, 54, 57, nil, nil, - nil, 75, 54, 57, nil, nil, 45, nil, nil, nil, - 56, 59, 45, nil, 66, 48, 56, 59, nil, 52, - 66, 54, 57, 62, nil, 52, 45, 54, 57, 62, - 56, 59, 45, nil, 66, nil, 56, 195, 49, 52, - 66, 54, 57, 62, nil, 111, 75, 54, 57, 62, - nil, 45, nil, nil, nil, 56, 195, 45, nil, 66, - nil, 56, 195, nil, 111, 66, 54, 57, 62, nil, - 111, 45, 54, 57, 62, 56, 195, 45, nil, 66, - nil, 56, 59, nil, 111, 66, nil, nil, 62, nil, - 52, 54, 57, nil, 62, 281, 45, 54, 57, nil, - 56, 195, 45, nil, 66, nil, 56, 195, 49, 111, - 66, 54, 57, 62, nil, 111, nil, 54, 57, 62, - 208, 45, nil, nil, nil, 56, 195, 45, nil, 66, - nil, 56, 195, nil, 111, 66, 54, 57, 62, nil, - 111, 45, 54, 57, 62, 56, 195, 45, nil, 66, - nil, 56, 195, nil, 111, 66, 131, nil, 62, nil, - 111, nil, 203, nil, 62, nil, 45, nil, nil, nil, - 56, 59, 45, nil, 66, nil, 56, 59, 49, 52, - 66, 150, 154, 62, 49, 52, nil, nil, nil, 62, + nil, 51, 54, 57, nil, nil, nil, nil, nil, nil, + nil, 75, 54, 57, nil, nil, nil, 75, 54, 57, + nil, 48, nil, nil, nil, nil, 45, 75, 54, 57, + 56, 59, 45, nil, 66, nil, 56, 59, nil, 52, + 66, nil, 45, 62, 49, 52, 56, 59, 45, 62, + 66, nil, 56, 59, nil, 52, 66, nil, 45, 62, + nil, 52, 56, 59, nil, 62, 66, 54, 57, 54, + 57, 52, nil, nil, nil, 62, nil, nil, nil, nil, + nil, nil, nil, 54, 57, 54, 57, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, 45, nil, 45, + nil, 56, 195, 56, 195, 66, nil, 66, 54, 57, + 111, 49, 111, 45, 62, 45, 62, 56, 195, 56, + 195, 66, nil, 66, nil, nil, 111, nil, 111, nil, + 62, nil, 62, 54, 57, 54, 57, 284, 45, nil, + nil, nil, 56, 195, nil, nil, 66, nil, nil, 54, + 57, 111, 208, nil, nil, 62, 54, 57, nil, nil, + nil, nil, nil, 45, nil, 45, nil, 56, 195, 56, + 195, 66, nil, 66, nil, nil, 111, nil, 111, 45, + 62, nil, 62, 56, 195, nil, 45, 66, 54, 57, + 56, 195, 111, nil, 66, nil, 62, nil, nil, 111, + nil, nil, nil, 62, 54, 57, nil, nil, 131, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 45, nil, + nil, nil, 56, 59, 203, nil, 66, nil, nil, nil, + 49, 52, nil, nil, 45, 62, nil, nil, 56, 59, + nil, nil, 66, 150, 154, nil, 49, 52, nil, nil, + nil, 62, 146, 148, 151, 153, 150, 154, nil, nil, + nil, nil, nil, nil, 212, 146, 148, 151, 153, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + 156, 157, 158, 144, 145, 147, nil, nil, nil, 149, + 152, 150, 154, 156, 157, 158, 144, 145, 147, nil, 146, 148, 151, 153, 150, 154, nil, nil, nil, nil, - nil, nil, 212, 146, 148, 151, 153, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 156, 157, - 158, 144, 145, 147, nil, nil, nil, 149, 152, 150, + nil, nil, nil, 146, 148, 151, 153, nil, nil, nil, + nil, nil, nil, nil, 149, 152, nil, nil, 156, 157, + 158, 144, 145, 147, nil, nil, 296, nil, 152, 150, 154, 156, 157, 158, 144, 145, 147, nil, 146, 148, - 151, 153, 150, 154, nil, nil, nil, nil, nil, nil, - nil, 146, 148, 151, 153, nil, nil, nil, nil, nil, - nil, nil, 149, 152, nil, nil, 156, 157, 158, 144, - 145, 147, nil, nil, 293, nil, 152, 150, 154, 156, - 157, 158, 144, 145, 147, nil, 146, 148, 151, 153, - nil, nil, nil, nil, nil, 16, nil, 23, 27, 291, - 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, - 149, 152, 4, 8, 156, 157, 158, 144, 145, 147, - 16, 290, 23, 27, nil, 1, 5, nil, 10, nil, - 13, nil, 20, nil, 28, nil, nil, 4, 8, nil, - 268, nil, 16, nil, 23, 27, nil, 1, 5, nil, + 151, 153, nil, nil, nil, nil, nil, 16, nil, 23, + 27, 294, 1, 5, nil, 10, nil, 13, nil, 20, + nil, 28, 149, 152, 4, 8, 156, 157, 158, 144, + 145, 147, 16, 293, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, - 8, 16, 305, 23, 27, nil, 1, 5, nil, 10, - nil, 13, nil, 20, nil, 28, nil, nil, 4, 8, - nil, 310, nil, 16, nil, 23, 27, nil, 1, 5, - nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, - 4, 8, 16, 262, 23, 27, nil, 1, 5, nil, - 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, - 8, nil, 312, nil, 16, nil, 23, 27, nil, 1, + 8, nil, 269, nil, 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, - nil, 4, 8, 16, 255, 23, 27, nil, 1, 5, + nil, 4, 8, 16, 226, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, - 4, 8, nil, 313, nil, 16, nil, 23, 27, nil, + 4, 8, nil, 308, nil, 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, - nil, nil, 4, 8, 16, nil, 23, 27, nil, 1, + nil, nil, 4, 8, 16, 312, 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, nil, - nil, 4, 8, 16, nil, 23, 27, nil, 1, 5, - nil, 10, nil, 13, nil, 20, nil, 28, nil, nil, - 4, 8, 16, nil, 23, 27, nil, 1, 5, nil, - 10, nil, 13, nil, 20, nil, 28, nil, nil, 4, - 8, 16, nil, 23, 27, nil, 1, 5, nil, 10, - nil, 13, nil, 20, nil, 28, nil, nil, 4, 8, - 16, nil, 23, 27, nil, 1, 5, nil, 10, nil, - 13, nil, 20, nil, 28, nil, nil, 4, 8 ] + nil, 4, 8, nil, 314, nil, 16, nil, 23, 27, + nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, + 28, nil, nil, 4, 8, 16, 263, 23, 27, nil, + 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, + nil, nil, 4, 8, nil, 315, nil, 16, nil, 23, + 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, + nil, 28, nil, nil, 4, 8, 16, 256, 23, 27, + nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, + 28, nil, nil, 4, 8, nil, 316, nil, 16, nil, + 23, 27, nil, 1, 5, nil, 10, nil, 13, nil, + 20, nil, 28, nil, nil, 4, 8, 16, nil, 23, + 27, nil, 1, 5, nil, 10, nil, 13, nil, 20, + nil, 28, nil, nil, 4, 8, 16, nil, 23, 27, + nil, 1, 5, nil, 10, nil, 13, nil, 20, nil, + 28, nil, nil, 4, 8, 16, nil, 23, 27, nil, + 1, 5, nil, 10, nil, 13, nil, 20, nil, 28, + nil, nil, 4, 8 ] racc_action_check = [ - 33, 33, 33, 231, 105, 129, 129, 241, 17, 170, - 59, 116, 17, 140, 174, 241, 246, 140, 140, 174, - 33, 158, 158, 158, 116, 17, 10, 10, 231, 231, - 59, 33, 126, 126, 42, 33, 33, 170, 170, 33, - 129, 158, 220, 129, 33, 33, 105, 90, 33, 17, - 220, 33, 158, 144, 144, 144, 158, 158, 90, 42, - 158, 10, 175, 90, 10, 158, 158, 126, 77, 158, - 126, 71, 158, 144, 76, 76, 76, 247, 220, 220, - 220, 220, 220, 220, 144, 135, 227, 227, 144, 144, - 247, 165, 144, 135, 76, 223, 179, 144, 144, 165, - 92, 144, 180, 223, 144, 76, 145, 145, 145, 76, - 76, 92, 70, 76, 5, 288, 92, 27, 76, 76, - 288, 5, 76, 185, 27, 76, 145, 72, 72, 72, - 68, 223, 223, 223, 223, 223, 223, 145, 187, 134, - 188, 145, 145, 134, 134, 145, 189, 72, 221, 67, - 145, 145, 195, 162, 145, 65, 221, 145, 72, 154, - 154, 154, 72, 72, 162, 201, 72, 108, 202, 162, - 108, 72, 72, 63, 108, 72, 226, 226, 72, 154, - 84, 84, 84, 209, 221, 221, 221, 221, 221, 221, - 154, 161, 171, 160, 154, 154, 171, 171, 154, 79, - 84, 218, 61, 154, 154, 60, 234, 154, 80, 218, - 154, 84, 16, 16, 16, 84, 84, 234, 58, 84, - 1, 1, 234, 53, 84, 84, 23, 23, 84, 266, - 266, 84, 16, 146, 146, 146, 52, 218, 218, 218, - 218, 218, 218, 16, 81, 159, 50, 16, 16, 159, - 159, 16, 82, 146, 24, 87, 16, 16, 173, 173, - 16, 24, 24, 16, 146, 230, 89, 94, 146, 146, - 85, 36, 146, 217, 217, 217, 217, 146, 146, 85, - 85, 146, 95, 35, 146, 97, 244, 245, 85, 85, - 85, 85, 78, 99, 153, 153, 153, 224, 224, 224, - 224, 224, 224, 216, 216, 216, 216, 216, 216, 28, - 106, 260, 85, 85, 153, 109, 85, 85, 85, 85, - 85, 85, 112, 113, 268, 153, 152, 152, 152, 153, - 153, 271, 273, 153, 215, 215, 215, 215, 153, 153, - 274, 275, 153, 277, 282, 153, 152, 147, 147, 147, - 114, 15, 130, 127, 6, 125, 295, 152, 296, 299, - 2, 152, 152, 119, 118, 152, 115, 147, nil, nil, - 152, 152, nil, nil, 152, nil, nil, 152, 147, 148, - 148, 148, 147, 147, nil, nil, 147, nil, nil, nil, - nil, 147, 147, nil, nil, 147, nil, nil, 147, 148, + 158, 158, 158, 232, 105, 129, 129, 135, 17, 170, + 59, 116, 17, 140, 174, 135, 202, 140, 140, 174, + 158, 84, 84, 84, 116, 17, 10, 10, 232, 232, + 59, 158, 126, 126, 42, 158, 158, 170, 170, 158, + 129, 84, 221, 129, 158, 158, 105, 162, 158, 17, + 221, 158, 84, 144, 144, 144, 84, 84, 162, 42, + 84, 10, 175, 162, 10, 84, 84, 126, 78, 84, + 126, 77, 84, 144, 145, 145, 145, 248, 221, 221, + 221, 221, 221, 221, 144, 165, 179, 242, 144, 144, + 248, 92, 144, 165, 145, 242, 5, 144, 144, 227, + 227, 144, 92, 5, 144, 145, 223, 92, 24, 145, + 145, 85, 90, 145, 223, 24, 24, 27, 145, 145, + 85, 85, 145, 90, 27, 145, 228, 228, 90, 85, + 85, 85, 85, 180, 159, 146, 146, 146, 159, 159, + 1, 1, 223, 223, 223, 223, 223, 223, 217, 217, + 217, 217, 71, 85, 85, 146, 218, 85, 85, 85, + 85, 85, 85, 185, 218, 235, 146, 157, 157, 157, + 146, 146, 291, 70, 146, 108, 235, 291, 108, 146, + 146, 235, 108, 146, 23, 23, 146, 157, 154, 154, + 154, 187, 218, 218, 218, 218, 218, 218, 157, 188, + 171, 189, 157, 157, 171, 171, 157, 68, 154, 220, + 195, 157, 157, 267, 267, 157, 67, 220, 157, 154, + 16, 16, 16, 154, 154, 134, 201, 154, 79, 134, + 134, 65, 154, 154, 173, 173, 154, 209, 161, 154, + 16, 147, 147, 147, 160, 220, 220, 220, 220, 220, + 220, 16, 80, 63, 61, 16, 16, 60, 81, 16, + 58, 147, 53, 82, 16, 16, 52, 226, 16, 87, + 89, 16, 147, 153, 153, 153, 147, 147, 231, 94, + 147, 215, 215, 215, 215, 147, 147, 50, 95, 147, + 97, 36, 147, 153, 152, 152, 152, 224, 224, 224, + 224, 224, 224, 99, 153, 245, 246, 247, 153, 153, + 106, 35, 153, 28, 152, 261, 109, 153, 153, 112, + 113, 153, 269, 271, 153, 152, 76, 76, 76, 152, + 152, 274, 276, 152, 277, 278, 280, 285, 152, 152, + 114, 115, 152, 15, 130, 152, 76, 151, 151, 151, + 216, 216, 216, 216, 216, 216, 127, 76, 6, 298, + 299, 76, 76, 125, 2, 76, 119, 151, 118, nil, + 76, 76, nil, nil, 76, nil, nil, 76, 151, 148, + 148, 148, 151, 151, nil, nil, 151, nil, nil, nil, + nil, 151, 151, nil, nil, 151, nil, nil, 151, 148, 149, 149, 149, nil, nil, nil, nil, nil, nil, nil, 148, nil, nil, nil, 148, 148, nil, nil, 148, nil, 149, nil, nil, 148, 148, nil, nil, 148, nil, nil, - 148, 149, 156, 156, 156, 149, 149, nil, nil, 149, + 148, 149, 72, 72, 72, 149, 149, nil, nil, 149, nil, nil, nil, nil, 149, 149, nil, nil, 149, nil, - nil, 149, 156, 34, 34, 34, nil, nil, nil, nil, - nil, nil, nil, 156, nil, nil, nil, 156, 156, nil, - nil, 156, nil, 34, nil, nil, 156, 156, nil, nil, - 156, nil, nil, 156, 34, 151, 151, 151, 34, 34, + nil, 149, 72, 34, 34, 34, nil, nil, nil, nil, + nil, nil, nil, 72, nil, nil, nil, 72, 72, nil, + nil, 72, nil, 34, nil, nil, 72, 72, nil, nil, + 72, nil, nil, 72, 34, 150, 150, 150, 34, 34, nil, nil, 34, nil, nil, nil, nil, 34, 34, nil, - nil, 34, nil, nil, 34, 151, 150, 150, 150, nil, - nil, nil, nil, nil, nil, nil, 151, 196, 196, 196, - 151, 151, nil, nil, 151, nil, 150, nil, nil, 151, - 151, nil, nil, 151, nil, nil, 151, 150, 157, 157, - 157, 150, 150, nil, nil, 150, nil, nil, 196, nil, - 150, 150, 196, 196, 150, nil, 196, 150, 157, nil, - nil, 196, 38, 38, 38, 196, nil, nil, nil, 157, - nil, nil, nil, 157, 157, nil, nil, 157, 177, 177, - 177, nil, 157, 157, nil, nil, 157, nil, nil, 157, - nil, nil, nil, 38, 51, 51, 51, 38, 38, nil, - nil, 38, nil, nil, nil, nil, 38, nil, nil, 177, - 38, nil, nil, 177, 177, nil, nil, 177, 75, 75, - 75, 75, 177, nil, nil, 51, 177, nil, nil, 51, - 51, nil, nil, 51, 267, 267, 267, nil, 51, nil, - nil, nil, 51, nil, 88, 88, 88, nil, nil, 75, - 285, 285, 285, 75, 75, nil, nil, 75, nil, nil, - nil, nil, 75, nil, nil, 267, 75, nil, nil, 267, - 267, nil, nil, 267, nil, 88, nil, nil, 267, 88, - 88, 285, 267, 88, nil, 285, 285, nil, 88, 285, - nil, nil, 88, nil, 285, 20, 20, 20, 285, nil, - nil, 178, 178, 178, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 13, 13, 13, nil, nil, - nil, 186, 186, 186, nil, nil, 20, nil, nil, nil, - 20, 20, 178, nil, 20, 13, 178, 178, nil, 20, - 178, 232, 232, 20, nil, 178, 13, 208, 208, 178, - 13, 13, 186, nil, 13, nil, 186, 186, 13, 13, - 186, 283, 283, 13, nil, 186, 284, 284, 284, 186, - nil, 232, nil, nil, nil, 232, 232, 208, nil, 232, - nil, 208, 208, nil, 232, 208, 132, 132, 232, nil, - 208, 283, 294, 294, 208, 283, 283, 284, nil, 283, - nil, 284, 284, nil, 283, 284, nil, nil, 283, nil, - 284, 239, 239, nil, 284, 239, 132, 233, 233, nil, - 132, 132, 294, nil, 132, nil, 294, 294, 132, 132, - 294, 172, 172, 132, nil, 294, nil, 137, 137, 294, - 137, 239, nil, nil, nil, 239, 239, 233, nil, 239, - nil, 233, 233, nil, 239, 233, 48, 48, 239, nil, - 233, 172, 136, 136, 233, 172, 172, 137, nil, 172, - nil, 137, 137, nil, 172, 137, 48, nil, 172, nil, - 137, nil, 136, nil, 137, nil, 48, nil, nil, nil, - 48, 48, 136, nil, 48, nil, 136, 136, 48, 48, - 136, 222, 222, 48, 136, 136, nil, nil, nil, 136, - 222, 222, 222, 222, 139, 139, nil, nil, nil, nil, - nil, nil, 139, 139, 139, 139, 139, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 222, 222, - 222, 222, 222, 222, nil, nil, nil, 139, 139, 101, - 101, 139, 139, 139, 139, 139, 139, nil, 101, 101, - 101, 101, 219, 219, nil, nil, nil, nil, nil, nil, - nil, 219, 219, 219, 219, nil, nil, nil, nil, nil, - nil, nil, 101, 101, nil, nil, 101, 101, 101, 101, - 101, 101, nil, nil, 261, nil, 219, 102, 102, 219, - 219, 219, 219, 219, 219, nil, 102, 102, 102, 102, - nil, nil, nil, nil, nil, 261, nil, 261, 261, 254, - 261, 261, nil, 261, nil, 261, nil, 261, nil, 261, - 102, 102, 261, 261, 102, 102, 102, 102, 102, 102, - 254, 249, 254, 254, nil, 254, 254, nil, 254, nil, - 254, nil, 254, nil, 254, nil, nil, 254, 254, nil, - 225, nil, 249, nil, 249, 249, nil, 249, 249, nil, - 249, nil, 249, nil, 249, nil, 249, nil, nil, 249, - 249, 225, 289, 225, 225, nil, 225, 225, nil, 225, - nil, 225, nil, 225, nil, 225, nil, nil, 225, 225, - nil, 300, nil, 289, nil, 289, 289, nil, 289, 289, - nil, 289, nil, 289, nil, 289, nil, 289, nil, nil, - 289, 289, 300, 191, 300, 300, nil, 300, 300, nil, - 300, nil, 300, nil, 300, nil, 300, nil, nil, 300, - 300, nil, 309, nil, 191, nil, 191, 191, nil, 191, - 191, nil, 191, nil, 191, nil, 191, nil, 191, nil, - nil, 191, 191, 309, 184, 309, 309, nil, 309, 309, - nil, 309, nil, 309, nil, 309, nil, 309, nil, nil, - 309, 309, nil, 311, nil, 184, nil, 184, 184, nil, - 184, 184, nil, 184, nil, 184, nil, 184, nil, 184, - nil, nil, 184, 184, 311, nil, 311, 311, nil, 311, - 311, nil, 311, nil, 311, nil, 311, nil, 311, nil, - nil, 311, 311, 308, nil, 308, 308, nil, 308, 308, - nil, 308, nil, 308, nil, 308, nil, 308, nil, nil, - 308, 308, 155, nil, 155, 155, nil, 155, 155, nil, - 155, nil, 155, nil, 155, nil, 155, nil, nil, 155, - 155, 19, nil, 19, 19, nil, 19, 19, nil, 19, - nil, 19, nil, 19, nil, 19, nil, nil, 19, 19, - 0, nil, 0, 0, nil, 0, 0, nil, 0, nil, - 0, nil, 0, nil, 0, nil, nil, 0, 0 ] + nil, 34, nil, nil, 34, 150, 156, 156, 156, nil, + nil, nil, nil, nil, nil, nil, 150, 38, 38, 38, + 150, 150, nil, nil, 150, nil, 156, nil, nil, 150, + 150, nil, nil, 150, nil, nil, 150, 156, 33, 33, + 33, 156, 156, nil, nil, 156, nil, nil, 38, nil, + 156, 156, 38, 38, 156, nil, 38, 156, 33, nil, + nil, 38, 196, 196, 196, 38, nil, nil, nil, 33, + nil, nil, nil, 33, 33, nil, nil, 33, 75, 75, + 75, 75, 33, 33, nil, nil, 33, nil, nil, 33, + nil, nil, nil, 196, 51, 51, 51, 196, 196, nil, + nil, 196, nil, nil, nil, nil, 196, nil, nil, 75, + 196, nil, nil, 75, 75, nil, nil, 75, 268, 268, + 268, nil, 75, nil, nil, 51, 75, nil, nil, 51, + 51, nil, nil, 51, 20, 20, 20, nil, 51, nil, + nil, nil, 51, nil, 186, 186, 186, nil, nil, 268, + 287, 287, 287, 268, 268, nil, nil, 268, nil, nil, + nil, nil, 268, nil, nil, 20, 268, nil, nil, 20, + 20, nil, nil, 20, nil, 186, nil, nil, 20, 186, + 186, 287, 20, 186, nil, 287, 287, nil, 186, 287, + nil, nil, 186, nil, 287, 288, 288, 288, 287, nil, + nil, 13, 13, 13, nil, nil, nil, nil, nil, nil, + nil, 178, 178, 178, nil, nil, nil, 177, 177, 177, + nil, 13, nil, nil, nil, nil, 288, 88, 88, 88, + 288, 288, 13, nil, 288, nil, 13, 13, nil, 288, + 13, nil, 178, 288, 13, 13, 178, 178, 177, 13, + 178, nil, 177, 177, nil, 178, 177, nil, 88, 178, + nil, 177, 88, 88, nil, 177, 88, 208, 208, 132, + 132, 88, nil, nil, nil, 88, nil, nil, nil, nil, + nil, nil, nil, 233, 233, 234, 234, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, 208, nil, 132, + nil, 208, 208, 132, 132, 208, nil, 132, 286, 286, + 208, 132, 132, 233, 208, 234, 132, 233, 233, 234, + 234, 233, nil, 234, nil, nil, 233, nil, 234, nil, + 233, nil, 234, 240, 240, 297, 297, 240, 286, nil, + nil, nil, 286, 286, nil, nil, 286, nil, nil, 137, + 137, 286, 137, nil, nil, 286, 172, 172, nil, nil, + nil, nil, nil, 240, nil, 297, nil, 240, 240, 297, + 297, 240, nil, 297, nil, nil, 240, nil, 297, 137, + 240, nil, 297, 137, 137, nil, 172, 137, 48, 48, + 172, 172, 137, nil, 172, nil, 137, nil, nil, 172, + nil, nil, nil, 172, 136, 136, nil, nil, 48, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 48, nil, + nil, nil, 48, 48, 136, nil, 48, nil, nil, nil, + 48, 48, nil, nil, 136, 48, nil, nil, 136, 136, + nil, nil, 136, 222, 222, nil, 136, 136, nil, nil, + nil, 136, 222, 222, 222, 222, 139, 139, nil, nil, + nil, nil, nil, nil, 139, 139, 139, 139, 139, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + 222, 222, 222, 222, 222, 222, nil, nil, nil, 139, + 139, 102, 102, 139, 139, 139, 139, 139, 139, nil, + 102, 102, 102, 102, 219, 219, nil, nil, nil, nil, + nil, nil, nil, 219, 219, 219, 219, nil, nil, nil, + nil, nil, nil, nil, 102, 102, nil, nil, 102, 102, + 102, 102, 102, 102, nil, nil, 262, nil, 219, 101, + 101, 219, 219, 219, 219, 219, 219, nil, 101, 101, + 101, 101, nil, nil, nil, nil, nil, 262, nil, 262, + 262, 255, 262, 262, nil, 262, nil, 262, nil, 262, + nil, 262, 101, 101, 262, 262, 101, 101, 101, 101, + 101, 101, 255, 250, 255, 255, nil, 255, 255, nil, + 255, nil, 255, nil, 255, nil, 255, nil, nil, 255, + 255, nil, 225, nil, 250, nil, 250, 250, nil, 250, + 250, nil, 250, nil, 250, nil, 250, nil, 250, nil, + nil, 250, 250, 225, 155, 225, 225, nil, 225, 225, + nil, 225, nil, 225, nil, 225, nil, 225, nil, nil, + 225, 225, nil, 292, nil, 155, nil, 155, 155, nil, + 155, 155, nil, 155, nil, 155, nil, 155, nil, 155, + nil, nil, 155, 155, 292, 302, 292, 292, nil, 292, + 292, nil, 292, nil, 292, nil, 292, nil, 292, nil, + nil, 292, 292, nil, 303, nil, 302, nil, 302, 302, + nil, 302, 302, nil, 302, nil, 302, nil, 302, nil, + 302, nil, nil, 302, 302, 303, 191, 303, 303, nil, + 303, 303, nil, 303, nil, 303, nil, 303, nil, 303, + nil, nil, 303, 303, nil, 311, nil, 191, nil, 191, + 191, nil, 191, 191, nil, 191, nil, 191, nil, 191, + nil, 191, nil, nil, 191, 191, 311, 184, 311, 311, + nil, 311, 311, nil, 311, nil, 311, nil, 311, nil, + 311, nil, nil, 311, 311, nil, 313, nil, 184, nil, + 184, 184, nil, 184, 184, nil, 184, nil, 184, nil, + 184, nil, 184, nil, nil, 184, 184, 313, nil, 313, + 313, nil, 313, 313, nil, 313, nil, 313, nil, 313, + nil, 313, nil, nil, 313, 313, 0, nil, 0, 0, + nil, 0, 0, nil, 0, nil, 0, nil, 0, nil, + 0, nil, nil, 0, 0, 19, nil, 19, 19, nil, + 19, 19, nil, 19, nil, 19, nil, 19, nil, 19, + nil, nil, 19, 19 ] racc_action_pointer = [ - 1252, 207, 354, nil, nil, 76, 348, nil, nil, nil, - 23, nil, nil, 713, nil, 351, 210, 6, nil, 1233, - 693, nil, nil, 223, 216, nil, nil, 79, 267, nil, - nil, nil, nil, -2, 451, 245, 236, nil, 560, nil, - nil, nil, 24, nil, nil, nil, nil, nil, 853, nil, - 236, 592, 234, 213, nil, nil, nil, nil, 197, 8, - 184, 200, nil, 152, nil, 134, nil, 128, 109, nil, - 91, 71, 125, nil, nil, 616, 72, 47, 271, 178, - 187, 223, 231, nil, 178, 264, nil, 234, 642, 228, - 25, nil, 78, nil, 261, 272, nil, 279, nil, 271, - nil, 934, 982, nil, nil, -5, 300, nil, 129, 309, - nil, nil, 283, 302, 340, 345, 2, nil, 343, 345, - nil, nil, nil, nil, nil, 334, 29, 347, nil, 2, - 329, nil, 783, nil, 134, 47, 859, 834, nil, 899, - 8, nil, nil, nil, 51, 104, 231, 345, 377, 398, - 504, 483, 324, 292, 157, 1214, 430, 536, 19, 240, - 183, 182, 131, nil, nil, 75, nil, nil, nil, nil, - -11, 148, 828, 255, -19, 56, nil, 576, 699, 89, - 64, nil, nil, nil, 1157, 116, 719, 131, 102, 108, - nil, 1116, nil, nil, nil, 130, 515, nil, nil, nil, - nil, 163, 145, nil, nil, nil, nil, nil, 744, 174, - nil, nil, nil, nil, nil, 282, 251, 221, 185, 947, - 26, 132, 886, 79, 245, 1053, 122, 32, nil, nil, - 258, -20, 738, 814, 184, nil, nil, nil, nil, 808, - nil, -3, nil, nil, 273, 274, -7, 67, nil, 1034, - nil, nil, nil, nil, 1012, nil, nil, nil, nil, nil, - 301, 987, nil, nil, nil, nil, 220, 632, 295, nil, - nil, 310, nil, 311, 319, 320, nil, 322, nil, nil, - nil, nil, 338, 758, 764, 648, nil, nil, 82, 1075, - nil, nil, nil, nil, 789, 349, 351, nil, nil, 353, - 1094, nil, nil, nil, nil, nil, nil, nil, 1195, 1135, - nil, 1176, nil, nil ] + 1278, 127, 358, nil, nil, 58, 352, nil, nil, nil, + 23, nil, nil, 699, nil, 343, 218, 6, nil, 1297, + 632, nil, nil, 181, 70, nil, nil, 79, 271, nil, + nil, nil, nil, 536, 451, 273, 256, nil, 515, nil, + nil, nil, 24, nil, nil, nil, nil, nil, 885, nil, + 277, 592, 264, 252, nil, nil, nil, nil, 239, 8, + 236, 252, nil, 232, nil, 210, nil, 195, 186, nil, + 152, 152, 430, nil, nil, 576, 324, 50, 47, 207, + 231, 237, 242, nil, 19, 105, nil, 248, 725, 232, + 90, nil, 69, nil, 273, 278, nil, 284, nil, 281, + nil, 1024, 976, nil, nil, -5, 300, nil, 137, 310, + nil, nil, 280, 299, 330, 320, 2, nil, 347, 348, + nil, nil, nil, nil, nil, 342, 29, 350, nil, 2, + 321, nil, 766, nil, 220, -31, 901, 846, nil, 941, + 8, nil, nil, nil, 51, 72, 133, 239, 377, 398, + 483, 345, 292, 271, 186, 1117, 504, 165, -2, 129, + 234, 229, 25, nil, nil, 69, nil, nil, nil, nil, + -11, 156, 853, 231, -19, 56, nil, 715, 709, 79, + 95, nil, nil, nil, 1240, 156, 642, 184, 161, 163, + nil, 1199, nil, nil, nil, 188, 560, nil, nil, nil, + nil, 224, -7, nil, nil, nil, nil, nil, 764, 228, + nil, nil, nil, nil, nil, 229, 298, 96, 140, 989, + 193, 26, 928, 90, 245, 1095, 238, 45, 72, nil, + nil, 271, -20, 780, 782, 143, nil, nil, nil, nil, + 830, nil, 77, nil, nil, 292, 293, 284, 67, nil, + 1076, nil, nil, nil, nil, 1054, nil, nil, nil, nil, + nil, 305, 1029, nil, nil, nil, nil, 204, 616, 293, + nil, 317, nil, nil, 310, nil, 311, 313, 314, nil, + 315, nil, nil, nil, nil, 331, 805, 648, 693, nil, + nil, 139, 1136, nil, nil, nil, nil, 832, 352, 353, + nil, nil, 1158, 1177, nil, nil, nil, nil, nil, nil, + nil, 1218, nil, 1259, nil, nil, nil ] racc_action_default = [ - -167, -191, -191, -7, -160, -191, -191, -8, -158, -9, - -191, -10, -11, -159, -12, -191, -191, -191, -13, -1, - -191, -14, -2, -191, -191, -15, -3, -191, -40, -16, - -5, -17, -6, -191, -191, -79, -167, -159, -72, -165, - -164, -163, -167, -161, -166, -184, -33, -20, -191, -32, - -21, -191, -63, -22, -102, -23, -104, -103, -25, -62, - -26, -191, -61, -27, -147, -28, -148, -29, -191, -30, - -31, -191, -191, -110, -97, -191, -191, -91, -95, -92, - -99, -93, -98, -96, -191, -191, -94, -90, -191, -72, - -167, -42, -167, -4, -191, -151, -149, -191, -39, -167, - -41, -70, -71, -78, -80, -191, -189, -77, -191, -191, - -180, -63, -59, -65, -189, -68, -62, -57, -66, -191, - -146, -145, -69, -67, -73, -64, -191, -191, -178, -191, - -191, -19, -191, -82, -191, -191, -191, -191, 314, -191, - -191, -186, -124, -117, -191, -191, -191, -191, -191, -191, - -191, -191, -191, -191, -191, -191, -191, -191, -191, -191, - -189, -191, -167, -46, -48, -191, -55, -62, -54, -45, - -191, -191, -191, -191, -168, -191, -169, -191, -191, -191, - -190, -181, -182, -183, -191, -191, -60, -191, -190, -72, - -179, -191, -162, -18, -24, -62, -191, -105, -187, -188, - -34, -191, -191, -101, -136, -141, -144, -142, -191, -191, - -143, -135, -127, -185, -113, -115, -119, -116, -121, -126, - -123, -120, -125, -122, -118, -191, -111, -112, -114, -106, - -191, -191, -191, -191, -191, -51, -50, -44, -43, -191, - -129, -191, -133, -150, -177, -175, -191, -191, -172, -191, - -76, -75, -38, -81, -191, -155, -35, -58, -36, -74, - -189, -191, -157, -83, -100, -138, -189, -191, -108, -37, - -49, -85, -52, -89, -86, -87, -88, -84, -53, -47, - -130, -128, -191, -191, -191, -191, -170, -171, -191, -191, - -153, -154, -56, -156, -191, -191, -188, -140, -107, -191, - -191, -134, -176, -174, -173, -152, -139, -137, -191, -191, - -132, -191, -131, -109 ] + -169, -193, -193, -7, -162, -193, -193, -8, -160, -9, + -193, -10, -11, -161, -12, -193, -193, -193, -13, -1, + -193, -14, -2, -193, -193, -15, -3, -193, -40, -16, + -5, -17, -6, -193, -193, -79, -169, -161, -72, -167, + -166, -165, -169, -163, -168, -186, -33, -20, -193, -32, + -21, -193, -63, -22, -102, -23, -104, -103, -25, -62, + -26, -193, -61, -27, -149, -28, -150, -29, -193, -30, + -31, -193, -193, -112, -97, -193, -193, -91, -95, -92, + -99, -93, -98, -96, -193, -193, -94, -90, -193, -72, + -169, -42, -169, -4, -193, -153, -151, -193, -39, -169, + -41, -70, -71, -78, -80, -193, -191, -77, -193, -193, + -182, -63, -59, -65, -191, -68, -62, -57, -66, -193, + -148, -147, -69, -67, -73, -64, -193, -193, -180, -193, + -193, -19, -193, -82, -193, -193, -193, -193, 317, -193, + -193, -188, -126, -119, -193, -193, -193, -193, -193, -193, + -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, + -191, -193, -169, -46, -48, -193, -55, -62, -54, -45, + -193, -193, -193, -193, -170, -193, -171, -193, -193, -193, + -192, -183, -184, -185, -193, -193, -60, -193, -192, -72, + -181, -193, -164, -18, -24, -62, -193, -105, -189, -190, + -34, -193, -193, -101, -138, -143, -146, -144, -193, -193, + -145, -137, -129, -187, -115, -117, -121, -118, -123, -128, + -125, -122, -127, -124, -120, -193, -109, -113, -114, -116, + -106, -193, -193, -193, -193, -193, -51, -50, -44, -43, + -193, -131, -193, -135, -152, -179, -177, -193, -193, -174, + -193, -76, -75, -38, -81, -193, -157, -35, -58, -36, + -74, -191, -193, -159, -83, -100, -140, -191, -193, -109, + -108, -193, -37, -49, -85, -52, -89, -86, -87, -88, + -84, -53, -47, -132, -130, -193, -193, -193, -193, -172, + -173, -193, -193, -155, -156, -56, -158, -193, -193, -190, + -142, -107, -193, -193, -136, -178, -176, -175, -154, -141, + -139, -193, -111, -193, -134, -110, -133 ] racc_goto_table = [ - 2, 70, 19, 122, 17, 93, 47, 104, 117, 107, - 179, 96, 209, 46, 204, 43, 36, 240, 187, 2, - 15, 134, 114, 17, 64, 248, 125, 279, 97, 22, - 170, 91, 171, 272, 278, 294, 70, 298, 99, 239, - 106, 130, 185, 211, 63, 140, 112, 242, 46, 64, - 266, 95, 175, 58, 109, 42, 127, 194, 159, 64, - 246, 247, 98, 181, 230, 110, nil, nil, nil, 118, - nil, 128, nil, 160, nil, nil, nil, nil, 113, 63, - nil, nil, nil, 209, 280, 265, nil, 69, 58, nil, + 2, 179, 93, 17, 209, 43, 19, 204, 47, 187, + 249, 122, 104, 46, 36, 70, 22, 114, 107, 2, + 241, 170, 17, 171, 117, 96, 270, 97, 15, 134, + 275, 281, 282, 297, 91, 240, 99, 106, 185, 243, + 125, 211, 112, 130, 267, 95, 64, 175, 46, 109, + 70, 42, 110, 140, 127, 231, 194, 247, 128, 67, + 248, 98, 181, nil, nil, nil, 159, nil, 160, 301, + 69, 64, nil, nil, nil, 209, nil, nil, 266, nil, + nil, 64, nil, nil, 121, nil, nil, nil, 283, nil, + nil, nil, nil, 232, 67, 123, nil, nil, nil, nil, + nil, nil, nil, nil, nil, 69, nil, 243, nil, nil, + nil, 94, nil, nil, nil, 176, nil, 182, nil, nil, + nil, 190, nil, nil, 192, 65, nil, 307, nil, nil, + nil, 202, nil, nil, 70, 200, 46, nil, 70, 210, + nil, nil, 133, nil, nil, nil, nil, nil, nil, nil, + 120, nil, nil, 304, nil, 2, 295, 254, 17, 122, + 65, 225, 298, 107, 209, 64, 133, 309, 261, 64, + 64, 260, 258, nil, 210, 244, nil, nil, 67, 133, + nil, nil, 67, 121, 2, nil, nil, 17, 125, 69, + 255, 2, nil, 69, 17, nil, nil, 262, nil, 60, + nil, nil, 63, nil, nil, 64, nil, nil, 93, nil, + 210, nil, nil, nil, nil, nil, nil, nil, 121, 64, + nil, nil, nil, nil, 115, 2, nil, 118, 17, nil, + nil, nil, 121, nil, 60, 280, 280, 63, 93, nil, + nil, 64, 210, 123, 65, 93, nil, nil, 65, 120, + 2, nil, nil, 17, 121, 2, 292, nil, 17, nil, + nil, nil, 2, nil, nil, 17, 64, 64, 251, 252, + nil, nil, nil, 64, nil, 93, 168, nil, 168, 121, + 121, nil, nil, nil, 120, nil, 121, 264, 210, nil, + 279, 279, 2, nil, 93, 17, 93, nil, 120, 210, + nil, nil, 2, 2, nil, 17, 17, nil, 311, 313, + nil, 2, 58, 2, 17, nil, 17, 85, 60, 64, + 120, 63, 60, 206, nil, 63, 207, nil, nil, nil, + 64, nil, 121, nil, 101, 102, nil, 113, nil, nil, + nil, nil, nil, 121, nil, 278, 278, 58, 168, nil, + nil, nil, 120, nil, nil, nil, nil, nil, 206, 300, + nil, 207, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 115, 139, nil, 118, nil, 142, 305, 306, + nil, nil, nil, nil, nil, 143, nil, nil, nil, 166, + nil, 166, nil, nil, 206, nil, nil, 207, 120, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 120, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 276, + 276, 168, 277, 277, nil, nil, 206, nil, nil, 207, + nil, 58, nil, nil, nil, 58, 205, nil, nil, nil, + nil, nil, nil, nil, nil, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, nil, 227, 228, 229, + nil, 166, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 205, 206, nil, nil, 207, nil, nil, nil, nil, + nil, nil, nil, 206, nil, 113, 207, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, 205, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 231, nil, nil, nil, nil, nil, nil, nil, - nil, 94, 123, nil, 242, nil, nil, nil, nil, 182, - 70, nil, 69, nil, 70, 210, nil, nil, 176, 202, - 166, 190, 166, nil, 192, 200, 46, nil, nil, 304, - nil, nil, 133, 64, nil, nil, nil, 64, 64, nil, - nil, 122, 253, nil, 107, 2, 257, 225, 301, 17, - 210, 243, 259, 63, 292, nil, 133, 63, 207, 209, - 295, 306, 58, 260, 125, nil, 58, 205, nil, 133, - nil, nil, nil, 64, 2, nil, 254, nil, 17, nil, - nil, 2, nil, 261, nil, 17, 210, 64, 65, nil, - nil, nil, 166, 207, nil, nil, 69, 67, nil, nil, - 69, 93, 205, nil, nil, nil, nil, 118, nil, 64, - 277, 277, nil, 120, nil, 2, 113, 210, nil, 17, - nil, nil, 121, 65, nil, nil, nil, nil, nil, 207, - 93, 60, 67, 64, 64, nil, nil, 93, 205, 2, - 64, 289, nil, 17, 2, nil, nil, nil, 17, nil, - 123, 2, nil, 274, 274, 17, 115, nil, 250, 251, - 207, 210, 271, 271, 166, 93, 60, nil, nil, 205, - nil, nil, 210, nil, nil, nil, nil, 263, nil, 2, - nil, nil, nil, 17, 64, 93, nil, 93, nil, nil, - 2, nil, 309, nil, 17, 64, 276, 276, 2, 2, - 311, 2, 17, 17, 207, 17, nil, 65, 168, nil, - 168, 65, 120, 205, nil, 207, 67, nil, nil, nil, - 67, 121, nil, nil, 205, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 120, 297, nil, - 60, nil, nil, nil, 60, 206, 121, nil, nil, nil, - nil, 120, nil, nil, nil, 302, 303, nil, nil, nil, - 121, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 168, nil, nil, 120, nil, 85, nil, nil, nil, nil, - 206, nil, 121, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 101, 102, 115, nil, nil, 275, 275, nil, - nil, nil, nil, nil, 120, nil, 121, 121, nil, nil, - nil, nil, nil, 121, nil, nil, 206, nil, nil, nil, + nil, nil, 274, 274, 166, nil, nil, nil, nil, 205, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 139, nil, nil, nil, 142, nil, nil, nil, nil, - 273, 273, 168, 143, nil, nil, nil, 206, 120, nil, - nil, nil, nil, nil, nil, nil, nil, 121, nil, 120, - nil, nil, nil, nil, nil, nil, nil, nil, 121, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 206, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 206, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, nil, 226, 227, 228 ] + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, 205, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, 205 ] racc_goto_check = [ - 29, 28, 2, 48, 35, 4, 18, 53, 45, 50, - 34, 28, 60, 29, 62, 69, 30, 58, 34, 29, - 1, 54, 33, 35, 47, 72, 28, 40, 35, 3, - 39, 38, 39, 44, 44, 55, 28, 56, 30, 57, - 36, 18, 32, 61, 24, 54, 31, 60, 29, 47, - 63, 64, 65, 22, 66, 67, 68, 21, 54, 47, - 70, 71, 5, 73, 34, 3, nil, nil, nil, 24, - nil, 3, nil, 33, nil, nil, nil, nil, 22, 24, - nil, nil, nil, 60, 58, 62, nil, 27, 22, nil, + 29, 34, 4, 35, 60, 69, 2, 62, 18, 34, + 72, 48, 53, 29, 30, 28, 3, 33, 50, 29, + 58, 39, 35, 39, 45, 28, 56, 35, 1, 54, + 44, 44, 40, 55, 38, 57, 30, 36, 32, 60, + 28, 61, 31, 18, 63, 64, 47, 65, 29, 66, + 28, 67, 3, 54, 68, 34, 21, 70, 3, 26, + 71, 5, 73, nil, nil, nil, 54, nil, 33, 56, + 27, 47, nil, nil, nil, 60, nil, nil, 62, nil, + nil, 47, nil, nil, 26, nil, nil, nil, 58, nil, + nil, nil, nil, 39, 26, 27, nil, nil, nil, nil, + nil, nil, nil, nil, nil, 27, nil, 60, nil, nil, + nil, 51, nil, nil, nil, 3, nil, 30, nil, nil, + nil, 69, nil, nil, 69, 25, nil, 72, nil, nil, + nil, 18, nil, nil, 28, 29, 29, nil, 28, 28, + nil, nil, 51, nil, nil, nil, nil, nil, nil, nil, + 25, nil, nil, 60, nil, 29, 34, 53, 35, 48, + 25, 2, 34, 50, 60, 47, 51, 62, 33, 47, + 47, 50, 45, nil, 28, 28, nil, nil, 26, 51, + nil, nil, 26, 26, 29, nil, nil, 35, 28, 27, + 2, 29, nil, 27, 35, nil, nil, 2, nil, 23, + nil, nil, 24, nil, nil, 47, nil, nil, 4, nil, + 28, nil, nil, nil, nil, nil, nil, nil, 26, 47, + nil, nil, nil, nil, 23, 29, nil, 24, 35, nil, + nil, nil, 26, nil, 23, 28, 28, 24, 4, nil, + nil, 47, 28, 27, 25, 4, nil, nil, 25, 25, + 29, nil, nil, 35, 26, 29, 2, nil, 35, nil, + nil, nil, 29, nil, nil, 35, 47, 47, 51, 51, + nil, nil, nil, 47, nil, 4, 23, nil, 23, 26, + 26, nil, nil, nil, 25, nil, 26, 51, 28, nil, + 27, 27, 29, nil, 4, 35, 4, nil, 25, 28, + nil, nil, 29, 29, nil, 35, 35, nil, 2, 2, + nil, 29, 22, 29, 35, nil, 35, 49, 23, 47, + 25, 24, 23, 23, nil, 24, 24, nil, nil, nil, + 47, nil, 26, nil, 49, 49, nil, 22, nil, nil, + nil, nil, nil, 26, nil, 25, 25, 22, 23, nil, + nil, nil, 25, nil, nil, nil, nil, nil, 23, 51, + nil, 24, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 23, 49, nil, 24, nil, 49, 51, 51, + nil, nil, nil, nil, nil, 49, nil, nil, nil, 22, + nil, 22, nil, nil, 23, nil, nil, 24, 25, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 25, + nil, nil, nil, nil, nil, nil, nil, nil, nil, 23, + 23, 23, 24, 24, nil, nil, 23, nil, nil, 24, + nil, 22, nil, nil, nil, 22, 22, nil, nil, nil, + nil, nil, nil, nil, nil, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, nil, 49, 49, 49, + nil, 22, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 22, 23, nil, nil, 24, nil, nil, nil, nil, + nil, nil, nil, 23, nil, 22, 24, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, 22, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 39, nil, nil, nil, nil, nil, nil, nil, - nil, 51, 27, nil, 60, nil, nil, nil, nil, 30, - 28, nil, 27, nil, 28, 28, nil, nil, 3, 18, - 22, 69, 22, nil, 69, 29, 29, nil, nil, 72, - nil, nil, 51, 47, nil, nil, nil, 47, 47, nil, - nil, 48, 53, nil, 50, 29, 45, 2, 60, 35, - 28, 28, 50, 24, 34, nil, 51, 24, 24, 60, - 34, 62, 22, 33, 28, nil, 22, 22, nil, 51, - nil, nil, nil, 47, 29, nil, 2, nil, 35, nil, - nil, 29, nil, 2, nil, 35, 28, 47, 25, nil, - nil, nil, 22, 24, nil, nil, 27, 26, nil, nil, - 27, 4, 22, nil, nil, nil, nil, 24, nil, 47, - 28, 28, nil, 25, nil, 29, 22, 28, nil, 35, - nil, nil, 26, 25, nil, nil, nil, nil, nil, 24, - 4, 23, 26, 47, 47, nil, nil, 4, 22, 29, - 47, 2, nil, 35, 29, nil, nil, nil, 35, nil, - 27, 29, nil, 24, 24, 35, 23, nil, 51, 51, - 24, 28, 22, 22, 22, 4, 23, nil, nil, 22, - nil, nil, 28, nil, nil, nil, nil, 51, nil, 29, - nil, nil, nil, 35, 47, 4, nil, 4, nil, nil, - 29, nil, 2, nil, 35, 47, 27, 27, 29, 29, - 2, 29, 35, 35, 24, 35, nil, 25, 23, nil, - 23, 25, 25, 22, nil, 24, 26, nil, nil, nil, - 26, 26, nil, nil, 22, nil, nil, nil, nil, nil, + nil, nil, 22, 22, 22, nil, nil, nil, nil, 22, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 25, 51, nil, - 23, nil, nil, nil, 23, 23, 26, nil, nil, nil, - nil, 25, nil, nil, nil, 51, 51, nil, nil, nil, - 26, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 23, nil, nil, 25, nil, 49, nil, nil, nil, nil, - 23, nil, 26, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 49, 49, 23, nil, nil, 25, 25, nil, - nil, nil, nil, nil, 25, nil, 26, 26, nil, nil, - nil, nil, nil, 26, nil, nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 49, nil, nil, nil, 49, nil, nil, nil, nil, - 23, 23, 23, 49, nil, nil, nil, 23, 25, nil, - nil, nil, nil, nil, nil, nil, nil, 26, nil, 25, - nil, nil, nil, nil, nil, nil, nil, nil, 26, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 23, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, nil, 49, 49, 49 ] + nil, nil, nil, nil, nil, 22, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, 22 ] racc_goto_pointer = [ - nil, 20, 2, 29, -14, 38, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, -7, nil, - nil, -75, 40, 228, 31, 185, 194, 74, -12, 0, - 11, 8, -70, -16, -96, 4, 5, nil, 14, -60, - -207, nil, nil, nil, -199, -30, nil, 11, -35, 379, - -26, 91, nil, -28, -30, -231, -231, -133, -155, nil, - -125, -94, -123, -158, 28, -47, 18, 45, 14, 5, - -114, -113, -149, -45 ] + nil, 28, 6, 16, -17, 37, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, -5, nil, + nil, -76, 299, 186, 189, 112, 46, 57, 2, 0, + 9, 4, -74, -21, -105, 3, 2, nil, 17, -69, + -203, nil, nil, nil, -203, -14, nil, 33, -27, 301, + -17, 91, nil, -23, -22, -234, -200, -137, -152, nil, + -133, -96, -130, -164, 22, -52, 13, 41, 12, -5, + -117, -114, -164, -46 ] racc_goto_default = [ nil, nil, nil, 169, 26, 30, 32, 3, 7, 9, 11, 12, 14, 18, 21, 25, 29, 31, nil, 50, 53, 55, 77, 78, 79, 81, 82, 86, 87, 74, 6, nil, nil, nil, nil, 61, nil, 24, nil, nil, - 163, 234, 164, 165, nil, nil, 119, 80, 83, nil, - 124, 73, 103, nil, nil, 196, nil, nil, nil, 241, + 163, 235, 164, 165, nil, nil, 119, 80, 83, nil, + 124, 73, 103, nil, nil, 196, nil, nil, nil, 242, 68, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ] @@ -1528,138 +1552,161 @@ module_eval <<'.,.,', 'grammar.ra', 421 end .,., - # reduce 108 omitted +module_eval <<'.,.,', 'grammar.ra', 433 + def _reduce_108( val, _values, result ) + args = { + :test => val[1], + :statements => ast(AST::Nop) + } -module_eval <<'.,.,', 'grammar.ra', 426 - def _reduce_109( val, _values, result ) - result = ast AST::Else, :statements => val[2] + if val[4] + args[:else] = val[4] + end + + result = ast AST::IfStatement, args result end .,., - # reduce 110 omitted + # reduce 109 omitted -module_eval <<'.,.,', 'grammar.ra', 443 - def _reduce_111( val, _values, result ) - result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] +module_eval <<'.,.,', 'grammar.ra', 438 + def _reduce_110( val, _values, result ) + result = ast AST::Else, :statements => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 446 - def _reduce_112( val, _values, result ) - result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] +module_eval <<'.,.,', 'grammar.ra', 441 + def _reduce_111( val, _values, result ) + result = ast AST::Else, :statements => ast(AST::Nop) result end .,., -module_eval <<'.,.,', 'grammar.ra', 449 + # reduce 112 omitted + +module_eval <<'.,.,', 'grammar.ra', 458 def _reduce_113( val, _values, result ) result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 452 +module_eval <<'.,.,', 'grammar.ra', 461 def _reduce_114( val, _values, result ) result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 455 +module_eval <<'.,.,', 'grammar.ra', 464 def _reduce_115( val, _values, result ) result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 458 +module_eval <<'.,.,', 'grammar.ra', 467 def _reduce_116( val, _values, result ) result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 461 +module_eval <<'.,.,', 'grammar.ra', 470 def _reduce_117( val, _values, result ) - result = ast AST::Minus, :value => val[1] + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 464 +module_eval <<'.,.,', 'grammar.ra', 473 def _reduce_118( val, _values, result ) - result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result = ast AST::ArithmeticOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 467 +module_eval <<'.,.,', 'grammar.ra', 476 def _reduce_119( val, _values, result ) - result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result = ast AST::Minus, :value => val[1] result end .,., -module_eval <<'.,.,', 'grammar.ra', 470 +module_eval <<'.,.,', 'grammar.ra', 479 def _reduce_120( val, _values, result ) result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 473 +module_eval <<'.,.,', 'grammar.ra', 482 def _reduce_121( val, _values, result ) result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 476 +module_eval <<'.,.,', 'grammar.ra', 485 def _reduce_122( val, _values, result ) result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 479 +module_eval <<'.,.,', 'grammar.ra', 488 def _reduce_123( val, _values, result ) result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 482 +module_eval <<'.,.,', 'grammar.ra', 491 def _reduce_124( val, _values, result ) - result = ast AST::Not, :value => val[1] + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 485 +module_eval <<'.,.,', 'grammar.ra', 494 def _reduce_125( val, _values, result ) - result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result = ast AST::ComparisonOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 488 +module_eval <<'.,.,', 'grammar.ra', 497 def _reduce_126( val, _values, result ) - result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result = ast AST::Not, :value => val[1] result end .,., -module_eval <<'.,.,', 'grammar.ra', 491 +module_eval <<'.,.,', 'grammar.ra', 500 def _reduce_127( val, _values, result ) - result = val[1] + result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2] result end .,., -module_eval <<'.,.,', 'grammar.ra', 499 +module_eval <<'.,.,', 'grammar.ra', 503 def _reduce_128( val, _values, result ) + result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 506 + def _reduce_129( val, _values, result ) + result = val[1] + result + end +.,., + +module_eval <<'.,.,', 'grammar.ra', 514 + def _reduce_130( val, _values, result ) options = val[3] unless options.instance_of?(AST::ASTArray) options = ast AST::ASTArray, :children => [val[3]] @@ -1669,10 +1716,10 @@ module_eval <<'.,.,', 'grammar.ra', 499 end .,., - # reduce 129 omitted + # reduce 131 omitted -module_eval <<'.,.,', 'grammar.ra', 509 - def _reduce_130( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 524 + def _reduce_132( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push val[1] result = val[0] @@ -1683,15 +1730,15 @@ module_eval <<'.,.,', 'grammar.ra', 509 end .,., -module_eval <<'.,.,', 'grammar.ra', 513 - def _reduce_131( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 528 + def _reduce_133( val, _values, result ) result = ast AST::CaseOpt, :value => val[0], :statements => val[3] result end .,., -module_eval <<'.,.,', 'grammar.ra', 518 - def _reduce_132( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 533 + def _reduce_134( val, _values, result ) result = ast(AST::CaseOpt, :value => val[0], :statements => ast(AST::ASTArray) @@ -1700,10 +1747,10 @@ module_eval <<'.,.,', 'grammar.ra', 518 end .,., - # reduce 133 omitted + # reduce 135 omitted -module_eval <<'.,.,', 'grammar.ra', 528 - def _reduce_134( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 543 + def _reduce_136( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) result = val[0] @@ -1714,26 +1761,26 @@ module_eval <<'.,.,', 'grammar.ra', 528 end .,., -module_eval <<'.,.,', 'grammar.ra', 532 - def _reduce_135( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 547 + def _reduce_137( val, _values, result ) result = ast AST::Selector, :param => val[0], :values => val[2] result end .,., - # reduce 136 omitted + # reduce 138 omitted -module_eval <<'.,.,', 'grammar.ra', 534 - def _reduce_137( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 549 + def _reduce_139( val, _values, result ) result = val[1] result end .,., - # reduce 138 omitted + # reduce 140 omitted -module_eval <<'.,.,', 'grammar.ra', 545 - def _reduce_139( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 560 + def _reduce_141( val, _values, result ) if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) result = val[0] @@ -1744,17 +1791,13 @@ module_eval <<'.,.,', 'grammar.ra', 545 end .,., -module_eval <<'.,.,', 'grammar.ra', 549 - def _reduce_140( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 564 + def _reduce_142( val, _values, result ) result = ast AST::ResourceParam, :param => val[0], :value => val[2] result end .,., - # reduce 141 omitted - - # reduce 142 omitted - # reduce 143 omitted # reduce 144 omitted @@ -1765,29 +1808,33 @@ module_eval <<'.,.,', 'grammar.ra', 549 # reduce 147 omitted -module_eval <<'.,.,', 'grammar.ra', 560 - def _reduce_148( val, _values, result ) + # reduce 148 omitted + + # reduce 149 omitted + +module_eval <<'.,.,', 'grammar.ra', 575 + def _reduce_150( val, _values, result ) result = ast AST::Default, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 562 - def _reduce_149( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 577 + def _reduce_151( val, _values, result ) result = [val[0].value] result end .,., -module_eval <<'.,.,', 'grammar.ra', 566 - def _reduce_150( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 581 + def _reduce_152( val, _values, result ) results = val[0] << val[2].value result end .,., -module_eval <<'.,.,', 'grammar.ra', 574 - def _reduce_151( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 589 + def _reduce_153( val, _values, result ) val[1].each do |file| import(file) end @@ -1797,8 +1844,8 @@ module_eval <<'.,.,', 'grammar.ra', 574 end .,., -module_eval <<'.,.,', 'grammar.ra', 584 - def _reduce_152( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 599 + def _reduce_154( val, _values, result ) newdefine classname(val[1]), :arguments => val[2], :code => val[4] @lexer.indefine = false result = nil @@ -1808,8 +1855,8 @@ module_eval <<'.,.,', 'grammar.ra', 584 end .,., -module_eval <<'.,.,', 'grammar.ra', 588 - def _reduce_153( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 603 + def _reduce_155( val, _values, result ) newdefine classname(val[1]), :arguments => val[2] @lexer.indefine = false result = nil @@ -1817,8 +1864,8 @@ module_eval <<'.,.,', 'grammar.ra', 588 end .,., -module_eval <<'.,.,', 'grammar.ra', 596 - def _reduce_154( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 611 + def _reduce_156( val, _values, result ) # Our class gets defined in the parent namespace, not our own. @lexer.namepop newclass classname(val[1]), :code => val[4], :parent => val[2] @@ -1827,8 +1874,8 @@ module_eval <<'.,.,', 'grammar.ra', 596 end .,., -module_eval <<'.,.,', 'grammar.ra', 601 - def _reduce_155( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 616 + def _reduce_157( val, _values, result ) # Our class gets defined in the parent namespace, not our own. @lexer.namepop newclass classname(val[1]), :parent => val[2] @@ -1837,32 +1884,32 @@ module_eval <<'.,.,', 'grammar.ra', 601 end .,., -module_eval <<'.,.,', 'grammar.ra', 606 - def _reduce_156( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 621 + def _reduce_158( val, _values, result ) newnode val[1], :parent => val[2], :code => val[4] result = nil result end .,., -module_eval <<'.,.,', 'grammar.ra', 609 - def _reduce_157( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 624 + def _reduce_159( val, _values, result ) newnode val[1], :parent => val[2] result = nil result end .,., - # reduce 158 omitted - - # reduce 159 omitted - # reduce 160 omitted # reduce 161 omitted -module_eval <<'.,.,', 'grammar.ra', 623 - def _reduce_162( val, _values, result ) + # reduce 162 omitted + + # reduce 163 omitted + +module_eval <<'.,.,', 'grammar.ra', 638 + def _reduce_164( val, _values, result ) result = val[0] result = [result] unless result.is_a?(Array) result << val[2] @@ -1870,49 +1917,49 @@ module_eval <<'.,.,', 'grammar.ra', 623 end .,., - # reduce 163 omitted - - # reduce 164 omitted - # reduce 165 omitted # reduce 166 omitted -module_eval <<'.,.,', 'grammar.ra', 632 - def _reduce_167( val, _values, result ) + # reduce 167 omitted + + # reduce 168 omitted + +module_eval <<'.,.,', 'grammar.ra', 647 + def _reduce_169( val, _values, result ) result = nil result end .,., -module_eval <<'.,.,', 'grammar.ra', 636 - def _reduce_168( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 651 + def _reduce_170( val, _values, result ) result = ast AST::ASTArray, :children => [] result end .,., - # reduce 169 omitted + # reduce 171 omitted -module_eval <<'.,.,', 'grammar.ra', 641 - def _reduce_170( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 656 + def _reduce_172( val, _values, result ) result = nil result end .,., -module_eval <<'.,.,', 'grammar.ra', 645 - def _reduce_171( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 660 + def _reduce_173( val, _values, result ) result = val[1] result = [result] unless result[0].is_a?(Array) result end .,., - # reduce 172 omitted + # reduce 174 omitted -module_eval <<'.,.,', 'grammar.ra', 652 - def _reduce_173( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 667 + def _reduce_175( val, _values, result ) result = val[0] result = [result] unless result[0].is_a?(Array) result << val[2] @@ -1920,67 +1967,67 @@ module_eval <<'.,.,', 'grammar.ra', 652 end .,., -module_eval <<'.,.,', 'grammar.ra', 657 - def _reduce_174( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 672 + def _reduce_176( val, _values, result ) Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype") result = [val[0], val[2]] result end .,., -module_eval <<'.,.,', 'grammar.ra', 661 - def _reduce_175( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 676 + def _reduce_177( val, _values, result ) Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype") result = [val[0]] result end .,., -module_eval <<'.,.,', 'grammar.ra', 663 - def _reduce_176( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 678 + def _reduce_178( val, _values, result ) result = [val[0], val[2]] result end .,., -module_eval <<'.,.,', 'grammar.ra', 665 - def _reduce_177( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 680 + def _reduce_179( val, _values, result ) result = [val[0]] result end .,., - # reduce 178 omitted + # reduce 180 omitted -module_eval <<'.,.,', 'grammar.ra', 670 - def _reduce_179( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 685 + def _reduce_181( val, _values, result ) result = val[1] result end .,., - # reduce 180 omitted + # reduce 182 omitted -module_eval <<'.,.,', 'grammar.ra', 675 - def _reduce_181( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 690 + def _reduce_183( val, _values, result ) result = val[1] result end .,., - # reduce 182 omitted + # reduce 184 omitted - # reduce 183 omitted + # reduce 185 omitted -module_eval <<'.,.,', 'grammar.ra', 681 - def _reduce_184( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 696 + def _reduce_186( val, _values, result ) result = ast AST::Variable, :value => val[0] result end .,., -module_eval <<'.,.,', 'grammar.ra', 689 - def _reduce_185( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 704 + def _reduce_187( val, _values, result ) if val[1].instance_of?(AST::ASTArray) result = val[1] else @@ -1990,21 +2037,21 @@ module_eval <<'.,.,', 'grammar.ra', 689 end .,., -module_eval <<'.,.,', 'grammar.ra', 691 - def _reduce_186( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 706 + def _reduce_188( val, _values, result ) result = ast AST::ASTArray result end .,., - # reduce 187 omitted + # reduce 189 omitted - # reduce 188 omitted + # reduce 190 omitted - # reduce 189 omitted + # reduce 191 omitted -module_eval <<'.,.,', 'grammar.ra', 696 - def _reduce_190( val, _values, result ) +module_eval <<'.,.,', 'grammar.ra', 711 + def _reduce_192( val, _values, result ) result = nil result end -- cgit From 7275d7cb9083b4183f394a5d6798e1675def6d28 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Tue, 7 Oct 2008 13:51:59 +1100 Subject: Fxied #1354 - yum provider problems with RHEL 3 --- lib/puppet/provider/package/rpm.rb | 9 ++- lib/puppet/provider/package/yumhelper.py | 103 +++++++++++++++++++++++++++---- 2 files changed, 100 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/package/rpm.rb b/lib/puppet/provider/package/rpm.rb index a303da4e2..b5a5c5dbc 100755 --- a/lib/puppet/provider/package/rpm.rb +++ b/lib/puppet/provider/package/rpm.rb @@ -23,9 +23,16 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr def self.instances packages = [] + # rpm < 4.1 don't support --nosignature + output = rpm "--version" + sig = "--nosignature" + if output =~ /RPM version (([123].*)|(4\.0.*))/ + sig = "" + end + # list out all of the packages begin - execpipe("#{command(:rpm)} -qa --nosignature --nodigest --qf '#{NEVRAFORMAT}\n'") { |process| + execpipe("#{command(:rpm)} -qa #{sig} --nodigest --qf '#{NEVRAFORMAT}\n'") { |process| # now turn each returned line into a package object process.each { |line| hash = nevra_to_hash(line) diff --git a/lib/puppet/provider/package/yumhelper.py b/lib/puppet/provider/package/yumhelper.py index 962b96ce4..8eab0d081 100644 --- a/lib/puppet/provider/package/yumhelper.py +++ b/lib/puppet/provider/package/yumhelper.py @@ -4,8 +4,23 @@ # (C) 2007 Red Hat Inc. # David Lutterkort -import yum import sys +import string +import re + +# this maintains compatibility with really old platforms with python 1.x +from os import popen, WEXITSTATUS + +# Try to use the yum libraries by default, but shell out to the yum executable +# if they are not present (i.e. yum <= 2.0). This is only required for RHEL3 +# and earlier that do not support later versions of Yum. Once RHEL3 is EOL, +# shell_out() and related code can be removed. +try: + import yum +except ImportError: + useyumlib = 0 +else: + useyumlib = 1 OVERRIDE_OPTS = { 'debuglevel': 0, @@ -26,14 +41,80 @@ def pkg_lists(my): my.doRpmDBSetup() return my.doPackageLists('updates') -try: +def shell_out(): + try: + p = popen("/usr/bin/env yum check-update 2>&1") + output = p.readlines() + rc = p.close() + + if rc is not None: + # None represents exit code of 0, otherwise the exit code is in the + # format returned by wait(). Exit code of 100 from yum represents + # updates available. + if WEXITSTATUS(rc) != 100: + return WEXITSTATUS(rc) + else: + # Exit code is None (0), no updates waiting so don't both parsing output + return 0 + + # Yum prints a line of hyphens (old versions) or a blank line between + # headers and package data, so skip everything before them + skipheaders = 0 + for line in output: + if not skipheaders: + if re.compile("^((-){80}|)$").search(line): + skipheaders = 1 + continue + + # Skip any blank lines + if re.compile("^[ \t]*$").search(line): + continue + + # Format is: + # Yum 1.x: name arch (epoch:)?version + # Yum 2.0: name arch (epoch:)?version repo + # epoch is optional if 0 + + p = string.split(line) + pname = p[0] + parch = p[1] + pevr = p[2] + + # Separate out epoch:version-release + evr_re = re.compile("^(\d:)?(\S+)-(\S+)$") + evr = evr_re.match(pevr) + + pepoch = "" + if evr.group(1) is None: + pepoch = "0" + else: + pepoch = evr.group(1).replace(":", "") + pversion = evr.group(2) + prelease = evr.group(3) + + print "_pkg", pname, pepoch, pversion, prelease, parch + + return 0 + except: + print sys.exc_info()[0] + return 1 + +if useyumlib: try: - my = yum.YumBase() - ypl = pkg_lists(my) - for pkg in ypl.updates: - print "_pkg %s %s %s %s %s" % (pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch) - finally: - my.closeRpmDB() -except IOError, e: - print "_err IOError %d %s" % (e.errno, e) - sys.exit(1) + try: + my = yum.YumBase() + ypl = pkg_lists(my) + for pkg in ypl.updates: + print "_pkg %s %s %s %s %s" % (pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch) + finally: + my.closeRpmDB() + except IOError, e: + print "_err IOError %d %s" % (e.errno, e) + sys.exit(1) + except AttributeError, e: + # catch yumlib errors in buggy 2.x versions of yum + print "_err AttributeError %s" % e + sys.exit(1) +else: + rc = shell_out() + sys.exit(rc) -- cgit From fb14e91226e494210c3b6c88d8553a745e4ac3ed Mon Sep 17 00:00:00 2001 From: Andrew Shafer Date: Mon, 6 Oct 2008 22:06:39 -0600 Subject: Fixed #1473 - Rescue Timeout::Error in xmlrpc clients Added a rescue block for Timeout::Error (which isn't a subclass of StandardError) Removed a Dev Error conditional to facilitate testing --- lib/puppet/network/xmlrpc/client.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb index 6d77286d3..c79f91d57 100644 --- a/lib/puppet/network/xmlrpc/client.rb +++ b/lib/puppet/network/xmlrpc/client.rb @@ -35,10 +35,6 @@ module Puppet::Network interface.methods.each { |ary| method = ary[0] - if public_method_defined?(method) - raise Puppet::DevError, "Method %s is already defined" % - method - end newclient.send(:define_method,method) { |*args| Puppet.debug "Calling %s.%s" % [namespace, method] begin @@ -74,6 +70,10 @@ module Puppet::Network Puppet.warning "Other end went away; restarting connection and retrying" self.recycle_connection retry + rescue Timeout::Error => detail + Puppet.err "Connection timeout calling %s.%s: %s" % + [namespace, method, detail.to_s] + raise XMLRPCClientError.new("Connection Timeout").set_backtrace(detail.backtrace) rescue => detail if detail.message =~ /^Wrong size\. Was \d+, should be \d+$/ Puppet.warning "XMLRPC returned wrong size. Retrying." -- cgit From 765db307f875a52b7dec386b0af90f8e5b4590bb Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 6 Oct 2008 19:03:40 -0500 Subject: Adding partial spec tests for Puppet::Util::Metric. Signed-off-by: Luke Kanies --- lib/puppet/util/metric.rb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/metric.rb b/lib/puppet/util/metric.rb index ca23aa87f..722277e33 100644 --- a/lib/puppet/util/metric.rb +++ b/lib/puppet/util/metric.rb @@ -5,6 +5,8 @@ require 'puppet' class Puppet::Util::Metric # Load the library as a feature, so we can test its presence. + # It's only used by this class, so there's no reason to move it + # to the main feature list. Puppet.features.add :rrd, :libs => 'RRDtool' attr_accessor :type, :name, :value, :label @@ -93,11 +95,7 @@ class Puppet::Util::Metric def initialize(name,label = nil) @name = name.to_s - if label - @label = label - else - @label = name.to_s.capitalize.gsub("_", " ") - end + @label = label || labelize(name) @values = [] end @@ -107,9 +105,7 @@ class Puppet::Util::Metric end def newvalue(name,value,label = nil) - unless label - label = name.to_s.capitalize.gsub("_", " ") - end + label ||= labelize(name) @values.push [name,label,value] end @@ -145,7 +141,16 @@ class Puppet::Util::Metric def values @values.sort { |a, b| a[1] <=> b[1] } end + + private + + # Convert a name into a label. + def labelize(name) + name.to_s.capitalize.gsub("_", " ") + end end +# This is necessary because we changed the class path in early 2007, +# and reports directly yaml-dump these metrics, so both client and server +# have to agree on the class name. Puppet::Metric = Puppet::Util::Metric - -- cgit From 0b1e60f69a03e6525e1a9eefd748c59b4fc5261c Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 6 Oct 2008 19:06:21 -0500 Subject: Adding an array indexer method to Puppet::Util::Metric as requested in #1633. Signed-off-by: Luke Kanies --- lib/puppet/util/metric.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/puppet/util/metric.rb b/lib/puppet/util/metric.rb index 722277e33..e6d7678aa 100644 --- a/lib/puppet/util/metric.rb +++ b/lib/puppet/util/metric.rb @@ -14,6 +14,15 @@ class Puppet::Util::Metric attr_writer :basedir + # Return a specific value + def [](name) + if value = @values.find { |v| v[0] == name } + return value[2] + else + return nil + end + end + def basedir if defined? @basedir @basedir -- cgit From c7a6ef2889b0fb2507e5be98a1dd29b69957a216 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Mon, 6 Oct 2008 22:39:56 +0200 Subject: Fix #1202 - Collection attribute matching doesn't parse arrays This patch allows to do this: User <| groups == leads |> @user { "foo": ensure => "present", groups => ["bar","baz","leads"] } Signed-off-by: Brice Figureau --- lib/puppet/parser/ast/collexpr.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/parser/ast/collexpr.rb b/lib/puppet/parser/ast/collexpr.rb index 3e13d9400..baed325cb 100644 --- a/lib/puppet/parser/ast/collexpr.rb +++ b/lib/puppet/parser/ast/collexpr.rb @@ -30,7 +30,12 @@ class CollExpr < AST::Branch case @oper when "and": code1.call(resource) and code2.call(resource) when "or": code1.call(resource) or code2.call(resource) - when "==": resource[str1] == str2 + when "==": + if resource[str1].is_a?(Array) && form != :exported + resource[str1].include?(str2) + else + resource[str1] == str2 + end when "!=": resource[str1] != str2 end end -- cgit From 253d4df1f49e1516a111557b98b29509c39b41e0 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sun, 5 Oct 2008 17:11:22 +0200 Subject: Fix regression when templatedir doesn't exist. When searching for a module template and if the default templatedir is inexistant, puppet was raising an error without trying the modules templates directories. Signed-off-by: Brice Figureau --- lib/puppet/module.rb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb index b34f2f8b0..9385812b1 100644 --- a/lib/puppet/module.rb +++ b/lib/puppet/module.rb @@ -73,17 +73,23 @@ class Puppet::Module end template_paths = templatepath(environment) - default_template_path = File::join(template_paths.first, template) + if template_paths + # If we can find the template in :templatedir, we return that. + td_file = template_paths.collect { |path| + File::join(path, template) + }.find { |f| File.exists?(f) } - # If we can find the template in :templatedir, we return that. - td_file = template_paths.collect { |path| - File::join(path, template) - }.find { |f| File.exists?(f) } - - return td_file unless td_file == nil + return td_file unless td_file == nil + end td_file = find_template_for_module(template, environment) - td_file ||= default_template_path + + # check in the default template dir, if there is one + if td_file.nil? + raise Puppet::Error, "No valid template directory found, please check templatedir settings" if template_paths.nil? + td_file = File::join(template_paths.first, template) + end + td_file end def self.find_template_for_module(template, environment = nil) -- cgit From 4df51eaca0770618d5593c4a07eb9529077da114 Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Mon, 6 Oct 2008 17:30:38 -0400 Subject: New and improved tests for file type SELinux contexts --- lib/puppet/util/selinux.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index 6a9bcaf79..c25773344 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -51,7 +51,7 @@ module Puppet::Util::SELinux # out to the three (or four) component parts. Supports :seluser, :selrole, # :seltype, and on systems with range support, :selrange. def parse_selinux_context(component, context) - if context == "unlabeled" + if context.nil? or context == "unlabeled" return nil end unless context =~ /^[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+(:[a-z0-9_])?/ -- cgit From 996ac469b3013e4bcda8bc2f3bcb49ef57740a1f Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Tue, 7 Oct 2008 22:46:02 -0400 Subject: Fix scenario when SELinux support tools exist, but SELinux is disabled --- lib/puppet/util/selinux.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index c25773344..e99ee30e2 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -34,6 +34,9 @@ module Puppet::Util::SELinux # Note: For this command to work a full, non-relative, filesystem path # should be given. def get_selinux_default_context(file) + unless selinux_support? + return nil + end unless FileTest.executable?("/usr/sbin/matchpathcon") return nil end @@ -73,6 +76,9 @@ module Puppet::Util::SELinux # only a single component or update the entire context. It is just a # wrapper around the chcon command. def set_selinux_context(file, value, component = false) + unless selinux_support? + return nil + end case component when :seluser flag = "-u" -- cgit From 2153baed8c6b99f9b77ed2f63fb24433bd72058c Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 8 Oct 2008 12:14:11 -0500 Subject: Fixing #1640 - file groups now no longer get set on every run (this was a regression caused by other work I did). Signed-off-by: Luke Kanies --- lib/puppet/type/file/group.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') diff --git a/lib/puppet/type/file/group.rb b/lib/puppet/type/file/group.rb index 75beb537a..56883add6 100755 --- a/lib/puppet/type/file/group.rb +++ b/lib/puppet/type/file/group.rb @@ -46,6 +46,21 @@ module Puppet end end + def insync?(current) + @should.each do |value| + if value =~ /^\d+$/ + gid = Integer(value) + elsif value.is_a?(String) + fail "Could not find group %s" % value unless gid = gid(value) + else + gid = value + end + + return true if gid == current + end + return false + end + def retrieve return :absent unless stat = resource.stat(false) -- cgit From 28534471ef91301cc6a270f826dfff0f6021f89e Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sun, 5 Oct 2008 17:11:38 +0200 Subject: Fix several small regressions in plugins mount Since a30ecf2aeffd71960bd806fb28cd6d1b8adc2452, reclist has one parameter less, but Puppet::Network::Handler::PluginMount.list wasn't ported to the new API. While mounting plugins, reclist wasn't requiring 'file_serving/fileset', leading to an NameError. The change to the new API meant that we lost the existance test of plugins mount directory. It was failing when the client was mounting module plugins that weren't existing (like facter and no custom facts defined). Signed-off-by: Brice Figureau --- lib/puppet/network/handler/fileserver.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index da0a2befe..d87eb83fa 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -653,8 +653,6 @@ class Puppet::Network::Handler # and "bad batch". # def list(relpath, recurse, ignore, client = nil) - require 'puppet/file_serving' - require 'puppet/file_serving/fileset' abspath = file_path(relpath, client) if FileTest.exists?(abspath) if FileTest.directory?(abspath) and recurse @@ -667,6 +665,8 @@ class Puppet::Network::Handler end def reclist(abspath, recurse, ignore) + require 'puppet/file_serving' + require 'puppet/file_serving/fileset' args = { :recurse => recurse, :links => :follow } args[:ignore] = ignore if ignore fs = Puppet::FileServing::Fileset.new(abspath, args) @@ -720,9 +720,12 @@ class Puppet::Network::Handler def list(relpath, recurse, ignore, client = nil) result = [] valid_modules.each do |m| - ary = reclist(mod_file_path(m, relpath, client), nil, recurse, ignore) - ary = [] if ary.nil? - result += ary + modpath = mod_file_path(m, relpath, client) + if FileTest.exists?(modpath) + ary = reclist(modpath, recurse, ignore) + ary = [] if ary.nil? + result += ary + end end result end -- cgit From 4265825096677f596a6b8a2274e0bb802a60904c Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Wed, 8 Oct 2008 14:37:44 +0200 Subject: Fix #1636 - part2 - correct some client errors. #1636 original patch was incomplete, and on some cases, the client could report: "Failed to generate additional resources during transaction: None of the provided sources exist" The server was trying to recurse when asking to list files and thus was returning an empty response instead of a "file" response. --- lib/puppet/network/handler/fileserver.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index d87eb83fa..815d0ba82 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -722,9 +722,13 @@ class Puppet::Network::Handler valid_modules.each do |m| modpath = mod_file_path(m, relpath, client) if FileTest.exists?(modpath) - ary = reclist(modpath, recurse, ignore) - ary = [] if ary.nil? - result += ary + if FileTest.directory?(modpath) and recurse + ary = reclist(modpath, recurse, ignore) + ary = [] if ary.nil? + result += ary + else + result += [["/", File.stat(modpath).ftype]] + end end end result -- cgit From 2b4aa0c442f40125526cf2a19c15af4908684388 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 9 Oct 2008 07:58:26 +1100 Subject: Fixed #1639 - uninitialized constant Puppet::Type::User::ProviderUseradd --- lib/puppet/provider/user/user_role_add.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/provider/user/user_role_add.rb b/lib/puppet/provider/user/user_role_add.rb index 23581abbb..819516dc4 100644 --- a/lib/puppet/provider/user/user_role_add.rb +++ b/lib/puppet/provider/user/user_role_add.rb @@ -1,6 +1,6 @@ require 'puppet/util/user_attr' -Puppet::Type.type(:user).provide :user_role_add, :parent => Puppet::Type::User::ProviderUseradd do +Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd do desc "User management inherits ``useradd`` and adds logic to manage roles on Solaris using roleadd." -- cgit From a562ce5f7c6737280b92ee05b0609bd4b8088450 Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Wed, 8 Oct 2008 11:39:10 -0400 Subject: Add unit test coverage for Puppet::Util::SELinux and fix problems found by tests --- lib/puppet/util/selinux.rb | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index e99ee30e2..8c1aecf3b 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -18,11 +18,22 @@ module Puppet::Util::SELinux unless selinux_support? return nil end - context = `stat -c %C #{file}` - if ($?.to_i >> 8) > 0 + context = "" + begin + execpipe("stat -c %C #{file}") do |out| + out.each do |line| + context << line + end + end + rescue Puppet::ExecutionFailure return nil end context.chomp! + # Handle the case that the system seems to have SELinux support but + # stat finds unlabled files. + if context == "(null)" + return nil + end return context end @@ -40,8 +51,14 @@ module Puppet::Util::SELinux unless FileTest.executable?("/usr/sbin/matchpathcon") return nil end - context = %x{/usr/sbin/matchpathcon #{file} 2>&1} - if ($?.to_i >> 8) > 0 + context = "" + begin + execpipe("/usr/sbin/matchpathcon #{file}") do |out| + out.each do |line| + context << line + end + end + rescue Puppet::ExecutionFailure return nil end # For a successful match, matchpathcon returns two fields separated by @@ -57,18 +74,15 @@ module Puppet::Util::SELinux if context.nil? or context == "unlabeled" return nil end - unless context =~ /^[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+(:[a-z0-9_])?/ + unless context =~ /^([a-z0-9_]+):([a-z0-9_]+):([a-z0-9_]+)(?::([a-zA-Z0-9:,._-]+))?/ raise Puppet::Error, "Invalid context to parse: #{context}" end - bits = context.split(':') ret = { - :seluser => bits[0], - :selrole => bits[1], - :seltype => bits[2] + :seluser => $1, + :selrole => $2, + :seltype => $3, + :selrange => $4, } - if bits.length == 4 - ret[:selrange] = bits[3] - end return ret[component] end @@ -97,7 +111,9 @@ module Puppet::Util::SELinux unless retval error = Puppet::Error.new("failed to chcon %s" % [@resource[:path]]) raise error + return false end + return true end # Since this call relies on get_selinux_default_context it also needs a @@ -113,7 +129,8 @@ module Puppet::Util::SELinux cur_context = get_selinux_current_context(file) if new_context != cur_context set_selinux_context(file, new_context) + return new_context end - return new_context + return nil end end -- cgit From 53b7d42bb061ff1cfea3519179779a1cba2cf877 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 8 Oct 2008 22:03:22 -0500 Subject: Fixing the broken tests resulting from the fix for #1551. The test was expecting the current time, albeit as an integer. Signed-off-by: Luke Kanies --- lib/puppet/network/handler/master.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index 05ae7b9a2..71b633a09 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -24,7 +24,7 @@ class Puppet::Network::Handler # Tell a client whether there's a fresh config for it def freshness(client = nil, clientip = nil) # Always force a recompile. Newer clients shouldn't do this (as of April 2008). - return 0 + return Time.now.to_i end def initialize(hash = {}) -- cgit From 2bf0ba5651bfebf202bac5636063cece0208b667 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 8 Oct 2008 22:10:26 -0500 Subject: Fixing a test that was failing because i-have-no-idea Signed-off-by: Luke Kanies --- lib/puppet/util.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index d6de3e2e1..59f732dae 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -227,7 +227,11 @@ module Util end else x = %x{which #{bin} 2>/dev/null}.chomp - return x + if x == "" + return nil + else + return x + end end end module_function :binary -- cgit From aea55823db21088f2dc19f99f857b12332b6c208 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 8 Oct 2008 22:23:40 -0500 Subject: Removing a gid test for users, since it is a bad test and has mostly been replaced in rspec Signed-off-by: Luke Kanies --- lib/puppet/type/user.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index 74c4c6a33..29f4880c1 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -147,8 +147,7 @@ module Puppet raise ArgumentError, "Group names must be provided, not numbers" end if value.include?(",") - puts value - raise ArgumentError, "Group names must be provided as an array, not a comma-separated list" + raise ArgumentError, "Group names must be provided as an array, not as a comma-separated list '%s'" % value end end end -- cgit From b0c01dac2270b3107a07fd504f1c41f592e8f790 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 8 Oct 2008 22:27:12 -0500 Subject: Adding an additional option for the fix in ff36832e, skipping missing cert dirs Signed-off-by: Luke Kanies --- lib/puppet/sslcertificates/support.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/puppet/sslcertificates/support.rb b/lib/puppet/sslcertificates/support.rb index d95944adc..5ca06721d 100644 --- a/lib/puppet/sslcertificates/support.rb +++ b/lib/puppet/sslcertificates/support.rb @@ -133,6 +133,9 @@ module Puppet::SSLCertificates::Support #return nil unless FileTest.directory?(dir) raise ArgumentError, "Tried to fix SSL files to a file containing uppercase" unless short.downcase == short + + return false unless File.directory?(dir) + real_file = Dir.entries(dir).reject { |f| f =~ /^\./ }.find do |other| other.downcase == short end -- cgit From c5d1a4f6ffe72477ce02358a93d48df850aea15b Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Fri, 10 Oct 2008 10:53:18 +1100 Subject: Added last part of #1633 patch - update to util/metrics.rb --- lib/puppet/util/metric.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/puppet/util/metric.rb b/lib/puppet/util/metric.rb index e6d7678aa..0a8bc49c6 100644 --- a/lib/puppet/util/metric.rb +++ b/lib/puppet/util/metric.rb @@ -149,6 +149,11 @@ class Puppet::Util::Metric def values @values.sort { |a, b| a[1] <=> b[1] } + end + + def [](key) + value = @values.find { |v| v[0] == key } + return value[2] end private -- cgit From eff6ce0b5e83ed73b8e2bbe3ddd68cf4cd77caeb Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Fri, 10 Oct 2008 14:26:27 +1100 Subject: Revert "Added last part of #1633 patch - update to util/metrics.rb" This reverts commit c5d1a4f6ffe72477ce02358a93d48df850aea15b. --- lib/puppet/util/metric.rb | 5 ----- 1 file changed, 5 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/metric.rb b/lib/puppet/util/metric.rb index 0a8bc49c6..e6d7678aa 100644 --- a/lib/puppet/util/metric.rb +++ b/lib/puppet/util/metric.rb @@ -149,11 +149,6 @@ class Puppet::Util::Metric def values @values.sort { |a, b| a[1] <=> b[1] } - end - - def [](key) - value = @values.find { |v| v[0] == key } - return value[2] end private -- cgit From 65eafb7c01e6b4c003066cf7c6dceb5910e91950 Mon Sep 17 00:00:00 2001 From: duritong Date: Fri, 10 Oct 2008 16:15:59 +0200 Subject: lazy load latest package definitions with yumhelper 2.2 merge commit to 0.24x, original commit: I could observe that yumhelper.py can run quite some time and use quite a lot of memory (up to 100MB!) if you're using many repositories. As the yumhelper is only needed if you use latest as a ensure-keyword it makes no sense for people like me letting puppet fetch these details always, if you're never going to use latest. => lazy loading. After discussion on the list, this is the new version for lazy loading yum latest package versions. It is implemented mainly in the way that Luke proposed. However it stores the latest informations in the variable latest_info so the latest method didn't get too hackish and could nearly be left like it was before. --- lib/puppet/provider/package/yum.rb | 41 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/package/yum.rb b/lib/puppet/provider/package/yum.rb index 7998b92c0..56fad1af9 100755 --- a/lib/puppet/provider/package/yum.rb +++ b/lib/puppet/provider/package/yum.rb @@ -7,9 +7,7 @@ Puppet::Type.type(:package).provide :yum, :parent => :rpm, :source => :rpm do YUMHELPER = File::join(File::dirname(__FILE__), "yumhelper.py") - class << self - attr_reader :updates - end + attr_accessor :latest_info if command('rpm') confine :true => begin @@ -24,22 +22,32 @@ Puppet::Type.type(:package).provide :yum, :parent => :rpm, :source => :rpm do defaultfor :operatingsystem => [:fedora, :centos, :redhat] def self.prefetch(packages) - @updates = {} if Process.euid != 0 raise Puppet::Error, "The yum provider can only be used as root" end super - python(YUMHELPER).each_line do |l| - l.chomp! - next if l.empty? - if l[0,4] == "_pkg" - hash = nevra_to_hash(l[5..-1]) - [hash[:name], "#{hash[:name]}.#{hash[:arch]}"].each do |n| - @updates[n] ||= [] - @updates[n] << hash - end - end - end + return unless packages.detect { |name, package| package.should(:ensure) == :latest } + + # collect our 'latest' info + updates = {} + python(YUMHELPER).each_line do |l| + l.chomp! + next if l.empty? + if l[0,4] == "_pkg" + hash = nevra_to_hash(l[5..-1]) + [hash[:name], "#{hash[:name]}.#{hash[:arch]}"].each do |n| + updates[n] ||= [] + updates[n] << hash + end + end + end + + # Add our 'latest' info to the providers. + packages.each do |name, package| + if info = updates[package[:name]] + package.provider.latest_info = info[0] + end + end end def install @@ -73,11 +81,10 @@ Puppet::Type.type(:package).provide :yum, :parent => :rpm, :source => :rpm do # What's the latest package version available? def latest - upd = self.class.updates[@resource[:name]] + upd = latest_info unless upd.nil? # FIXME: there could be more than one update for a package # because of multiarch - upd = upd[0] return "#{upd[:version]}-#{upd[:release]}" else # Yum didn't find updates, pretend the current -- cgit From 157c0ddff032bb78838a1448eb1ff989bf1da705 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Sat, 11 Oct 2008 08:12:22 +0100 Subject: Fix 1642 (always warning) and improve unit tests to cover when to warn and not --- lib/puppet/type/file/checksum.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/type/file/checksum.rb b/lib/puppet/type/file/checksum.rb index 27edee13d..785ed0fee 100755 --- a/lib/puppet/type/file/checksum.rb +++ b/lib/puppet/type/file/checksum.rb @@ -53,7 +53,7 @@ Puppet::Type.type(:file).newproperty(:checksum) do else if FileTest.directory?(@resource[:path]) return :time - elsif @resource[:source] + elsif @resource[:source] and value.to_s != "md5" self.warning("Files with source set must use md5 as checksum. Forcing to md5 from %s for %s" % [ value, @resource[:path] ]) return :md5 else -- cgit From b0fd2e057a7fbff59565febc3ebb60a33863ff85 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 13 Oct 2008 10:35:40 -0500 Subject: Fixing #1647 - puppetdoc's 'providers' report works again. Signed-off-by: Luke Kanies --- lib/puppet/provider/confine/variable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/provider/confine/variable.rb b/lib/puppet/provider/confine/variable.rb index 84d17367a..333356341 100644 --- a/lib/puppet/provider/confine/variable.rb +++ b/lib/puppet/provider/confine/variable.rb @@ -3,7 +3,7 @@ require 'puppet/provider/confine' class Puppet::Provider::Confine::Variable < Puppet::Provider::Confine def self.summarize(confines) result = Hash.new { |hash, key| hash[key] = [] } - confines.inject(result) { |total, confine| total[confine.fact] += confine.values unless confine.valid?; total } + confines.inject(result) { |total, confine| total[confine.class.name] += confine.values unless confine.valid?; total } end attr_accessor :name -- cgit From 00d5fe403d754e61ae32f01f6879dfc93bfa6111 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sun, 5 Oct 2008 18:52:20 +0200 Subject: Fix #1115 - Allow checking tags/classes from ERb templates Add to predefined variables to the ERB template space. "classes" and "tags" which provide arrays of all the defined classes and tags for a node. Signed-off-by: Brice Figureau --- lib/puppet/parser/templatewrapper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb index 3b74e62d4..fc716b0fd 100644 --- a/lib/puppet/parser/templatewrapper.rb +++ b/lib/puppet/parser/templatewrapper.rb @@ -37,6 +37,16 @@ class Puppet::Parser::TemplateWrapper end end + # Allow templates to access the defined classes + def classes + return scope.catalog.classes + end + + # Allow templates to access the defined tags + def tags + return scope.catalog.tags + end + # Ruby treats variables like methods, so we used to expose variables # within scope to the ERB code via method_missing. As per RedMine #1427, # though, this means that conflicts between methods in our inheritance -- cgit From dedf0cdce952e36bcdccfc88b1efc33d9f5eaddb Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Mon, 13 Oct 2008 16:48:40 -0400 Subject: Setting SELinux contexts with chcon should not dereference symbolic links --- lib/puppet/util/selinux.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index 8c1aecf3b..d91a6943a 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -106,8 +106,8 @@ module Puppet::Util::SELinux flag = "" end - Puppet.debug "Running chcon #{flag} #{value} #{file}" - retval = system("chcon #{flag} #{value} #{file}") + Puppet.debug "Running chcon -h #{flag} #{value} #{file}" + retval = system("chcon -h #{flag} #{value} #{file}") unless retval error = Puppet::Error.new("failed to chcon %s" % [@resource[:path]]) raise error -- cgit From d4df36126fa62406c2cbb7a55b18234032da156b Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Tue, 14 Oct 2008 16:01:28 -0400 Subject: Use fully qualified paths when calling binaries, adjust chcon call to use Puppet's execute() function. --- lib/puppet/util/selinux.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index d91a6943a..0a4af3ca1 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -20,7 +20,7 @@ module Puppet::Util::SELinux end context = "" begin - execpipe("stat -c %C #{file}") do |out| + execpipe("/usr/bin/stat -c %C #{file}") do |out| out.each do |line| context << line end @@ -106,13 +106,7 @@ module Puppet::Util::SELinux flag = "" end - Puppet.debug "Running chcon -h #{flag} #{value} #{file}" - retval = system("chcon -h #{flag} #{value} #{file}") - unless retval - error = Puppet::Error.new("failed to chcon %s" % [@resource[:path]]) - raise error - return false - end + execute(["/usr/bin/chcon","-h",flag,value,file]) return true end -- cgit From a74ec60d33dee1c592ec858faeccc23d7a7b79f3 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 16 Oct 2008 16:17:30 -0500 Subject: Fixing tests I broke when trying to fix the Providers reference. Signed-off-by: Luke Kanies --- lib/puppet/provider/confine/variable.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/provider/confine/variable.rb b/lib/puppet/provider/confine/variable.rb index 333356341..0ef90d6d8 100644 --- a/lib/puppet/provider/confine/variable.rb +++ b/lib/puppet/provider/confine/variable.rb @@ -1,11 +1,19 @@ require 'puppet/provider/confine' +# Require a specific value for a variable, either a Puppet setting +# or a Facter value. This class is a bit weird because the name +# is set explicitly by the ConfineCollection class -- from this class, +# it's not obvious how the name would ever get set. class Puppet::Provider::Confine::Variable < Puppet::Provider::Confine + # Provide a hash summary of failing confines -- the key of the hash + # is the name of the confine, and the value is the missing yet required values. + # Only returns failed values, not all required values. def self.summarize(confines) result = Hash.new { |hash, key| hash[key] = [] } - confines.inject(result) { |total, confine| total[confine.class.name] += confine.values unless confine.valid?; total } + confines.inject(result) { |total, confine| total[confine.name] += confine.values unless confine.valid?; total } end + # This is set by ConfineCollection. attr_accessor :name # Retrieve the value from facter @@ -20,6 +28,7 @@ class Puppet::Provider::Confine::Variable < Puppet::Provider::Confine "facter value '%s' for '%s' not in required list '%s'" % [value, self.name, values.join(",")] end + # Compare the passed-in value to the retrieved value. def pass?(value) test_value.downcase.to_s == value.to_s.downcase end -- cgit