summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/autoload.rb4
-rwxr-xr-xlib/puppet/type/pfile/checksum.rb11
-rw-r--r--test/other/autoload.rb3
3 files changed, 12 insertions, 6 deletions
diff --git a/lib/puppet/autoload.rb b/lib/puppet/autoload.rb
index 7e880b922..2604b3c91 100644
--- a/lib/puppet/autoload.rb
+++ b/lib/puppet/autoload.rb
@@ -76,8 +76,10 @@ class Puppet::Autoload
# aren't used.
name = File.basename(file).sub(".rb", '').intern
next if @loaded.include? name
+ next if $".include?(File.join(@path, name.to_s + ".rb"))
+ filepath = File.join(@path, name.to_s + ".rb")
begin
- Kernel.load file, @wrap
+ Kernel.require filepath
@loaded[name] = true
rescue => detail
if Puppet[:trace]
diff --git a/lib/puppet/type/pfile/checksum.rb b/lib/puppet/type/pfile/checksum.rb
index cd82a4439..a37ccf9dc 100755
--- a/lib/puppet/type/pfile/checksum.rb
+++ b/lib/puppet/type/pfile/checksum.rb
@@ -4,8 +4,13 @@
# changes on its own.
module Puppet
Puppet.type(:file).newstate(:checksum) do
- desc "How to check whether a file has changed. **md5**/*lite-md5*/
- *time*/*mtime*"
+ desc "How to check whether a file has changed. This state is used internally
+ for file copying, but it can also be used to monitor files somewhat
+ like Tripwire without managing the file contents in any way. You can
+ specify that a file's checksum should be monitored and then subscribe to
+ the file from another object and receive events to signify
+ checksum changes, for instance."
+
@event = :file_changed
@unmanaged = true
@@ -24,6 +29,8 @@ module Puppet
str = @validtypes.join("|")
+ # This is here because Puppet sets this internally, using
+ # {md5}......
newvalue(/^\{#{str}\}/) do
handlesum()
end
diff --git a/test/other/autoload.rb b/test/other/autoload.rb
index 7cbb11c1a..f561a81a9 100644
--- a/test/other/autoload.rb
+++ b/test/other/autoload.rb
@@ -98,7 +98,4 @@ TestAutoload.newthing(:#{name.to_s})
"Did not get loaded #{thing.to_s}")
end
end
-
- def test_loadall
- end
end