[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
Markus Roberts
Markus at reality.com
Wed Jul 14 10:37:34 UTC 2010
The following commit has been merged in the upstream branch:
commit 1c3e844c120c3c91c63b64c093f94d5dbab7b946
Author: Markus Roberts <Markus at reality.com>
Date: Sun Jul 11 12:12:43 2010 -0700
Minimal fix for #4205 -- incorrect Import loop messages
This patch fixes the narrow problem of #4205, wherein type_loader would reparse
a file each time it was imported (causing the parser to incorrectly think that
it was in a loop) by checking @imported inside the existing check on the
thread-guarded @loaded. (@imported was being set but never checked).
This works (and is thread safe) because all of this is going on inside a giant
synchronize care of @loaded. But it, like the fix for #4208, does nothing
about the global lock.
Areas for future research:
1) Why is the looping inside of import?
2) Why are there separate @loaded and @imported tables?
3) Why is the parsing treated like a function (called deep in the structure)
yet coded like a thread-savvy pseudo state monad (e.g. raising errors that
presume it knows/owns what's going on outside the whole process)?
These and many other exciting questions are deferred to #4211
diff --git a/lib/puppet/parser/type_loader.rb b/lib/puppet/parser/type_loader.rb
index 6c32f6a..cb8657f 100644
--- a/lib/puppet/parser/type_loader.rb
+++ b/lib/puppet/parser/type_loader.rb
@@ -51,8 +51,10 @@ class Puppet::Parser::TypeLoader
unless file =~ /^#{File::SEPARATOR}/
file = File.join(dir, file)
end
- @imported[file] = true
- parse_file(file)
+ unless imported? file
+ @imported[file] = true
+ parse_file(file)
+ end
end
modname
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list