[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:30:28 UTC 2010


The following commit has been merged in the upstream branch:
commit a8245d86f8d2bd94714cf1fd7654b662208faa0e
Author: Bryan Kearney <bkearney at redhat.com>
Date:   Mon Mar 22 08:36:07 2010 -0400

    Handle path elements with ticks and spaces

diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index 0f1503a..dde676c 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
@@ -82,18 +82,24 @@ Puppet::Type.type(:augeas).provide(:augeas) do
                 if f == :path
                     start = sc.pos
                     nbracket = 0
+                    inSingleTick = false
+                    inDoubleTick = false
                     begin
-                        sc.skip(/([^\]\[\s\\]|\\.)+/)
+                        sc.skip(/([^\]\[\s\\'"]|\\.)+/)
                         ch = sc.getch
                         nbracket += 1 if ch == "["
                         nbracket -= 1 if ch == "]"
+                        inSingleTick = !inSingleTick if ch == "'"
+                        inDoubleTick = !inDoubleTick if ch == "\""
                         fail("unmatched [") if nbracket < 0
-                    end until nbracket == 0 && (sc.eos? || ch =~ /\s/)
+                    end until ((nbracket == 0 && !inSingleTick && !inDoubleTick && (ch =~ /\s/)) || sc.eos?)
                         len = sc.pos - start
                         len -= 1 unless sc.eos?
                     unless p = sc.string[start, len]
                         fail("missing path argument #{narg} for #{cmd}")
                     end
+                    # Rip off any ticks if they are there.
+                    p = p[1, (p.size - 2)] if p[0,1] == "'" || p[0,1] == "\""
                     p.chomp!("/")
                     if p[0,1] != "$" && p[0,1] != "/"
                         argline << context + p

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list