diff options
author | Luke Kanies <luke@madstop.com> | 2008-10-17 09:01:04 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-10-17 09:01:04 -0500 |
commit | 8aee40de69e6fe8d67ab58a2e223443b15820584 (patch) | |
tree | 89e230df3b43302a542f2cb6869f63e2fb93f6d8 /lib/puppet/file_serving | |
parent | 1b517d2fb048603bd1743a662bde74e8ae4b13dc (diff) | |
parent | a74ec60d33dee1c592ec858faeccc23d7a7b79f3 (diff) | |
download | puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.gz puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.xz puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.zip |
Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,
since that method is deprecated.
Conflicts:
CHANGELOG
bin/puppetca
lib/puppet/file_serving/fileset.rb
lib/puppet/network/xmlrpc/client.rb
lib/puppet/type/file/selcontext.rb
spec/unit/file_serving/metadata.rb
spec/unit/type/file.rb
Diffstat (limited to 'lib/puppet/file_serving')
-rw-r--r-- | lib/puppet/file_serving/fileset.rb | 4 | ||||
-rw-r--r-- | lib/puppet/file_serving/metadata.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb index a90734a2b..b28fb2d7e 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(@path, '').sub(%r{^/},'') } + result = files.collect { |file| file.sub(%r{^#{Regexp.escape(@path)}/*}, '') } # And add the path itself. result.unshift(".") @@ -122,7 +122,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/file_serving/metadata.rb b/lib/puppet/file_serving/metadata.rb index 1cc3fa355..1fc2b40ab 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::Base 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 |