[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:02 UTC 2009


The following commit has been merged in the master branch:
commit b2f0d872a273760c5ac65663685faea9be9ecfd5
Author: Paul Nasrat <pnasrat at googlemail.com>
Date:   Mon Sep 29 11:57:26 2008 +0100

    Fix ticket 1596 in new fileset code, use tmpdir in fileserver tests.

diff --git a/CHANGELOG b/CHANGELOG
index c54aa62..b73e076 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
 0.24.x
+    Fixed #1596 - Deploying file resources with ++ generates error
+
     Fixed #1610 - Raise "Filebucketed" messages to Notice priority
 
     Added a number of confines to package providers
diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb
index 7cd7366..3cb7631 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(".")
diff --git a/spec/unit/file_serving/fileset.rb b/spec/unit/file_serving/fileset.rb
index 2cd3e83..18ac1b4 100755
--- a/spec/unit/file_serving/fileset.rb
+++ b/spec/unit/file_serving/fileset.rb
@@ -176,6 +176,15 @@ describe Puppet::FileServing::Fileset, " when recursing" do
         @fileset.links = :manage
         @fileset.files.sort.should == @files.sort
     end
+
+    it "should succeed when paths have regexp significant characters" do
+        @path = "/my/path/rV1x2DafFr0R6tGG+1bbk++++TM"
+        File.expects(:lstat).with(@path).returns stub("stat", :directory? => true)
+        @fileset = Puppet::FileServing::Fileset.new(@path)
+        mock_dir_structure(@path)
+        @fileset.recurse = true
+        @fileset.files.sort.should == @files.sort
+    end
 end
 
 describe Puppet::FileServing::Fileset, " when following links that point to missing files" do
diff --git a/spec/unit/network/handler/fileserver.rb b/spec/unit/network/handler/fileserver.rb
index 9cde963..a9138f6 100644
--- a/spec/unit/network/handler/fileserver.rb
+++ b/spec/unit/network/handler/fileserver.rb
@@ -20,7 +20,7 @@ describe Puppet::Network::Handler do
     end
 
     before do
-        @basedir = File.join("/tmp", "test_network_handler")
+        @basedir = File.join(Dir.tmpdir(), "test_network_handler")
         Dir.mkdir(@basedir)
         @file = File.join(@basedir, "aFile")
         @link = File.join(@basedir, "aLink")

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list