On 10/07/10 18:43, Markus Roberts wrote: > On Sat, Jul 10, 2010 at 7:35 AM, Brice Figureau > <[email protected]> wrote: >> Due to the glob pattern used, we are trying to import manifests twice. >> Since it isn't possible (see #4205), it is not possible to use a pattern >> in an import statement. >> This patch fixes the glob pattern to look only to pp and rb files. > > >> --- a/lib/puppet/parser/files.rb >> +++ b/lib/puppet/parser/files.rb >> @@ -24,7 +24,7 @@ module Puppet::Parser::Files >> # Than that would be a "no." >> end >> abspat = File::expand_path(start, cwd) >> - [nil, Dir.glob(abspat + (File.extname(abspat).empty? ? '{,.pp,.rb}' : >> '' )).reject { |f| FileTest.directory?(f) }] >> + [nil, Dir.glob(abspat + (File.extname(abspat).empty? ? '{.pp,.rb}' : '' >> )).reject { |f| FileTest.directory?(f) }] >> end > > Hmm. This fixes it for the "foo*" case, but breaks it for the > "foo*pp" case (it would then only match "foo*pp.pp"). That's not a > likely case (and could just be rewritten as "foo*.pp") but still. > Would it make sense to throw a ".uniq" on there right before the > reject instead?
That was how I first fixed it, then went back to modification of the glob pattern since I didn't thought about your (highly impobable) pattern :-) I guess using uniq is better and covers everything. -- Brice Figureau My Blog: http://www.masterzen.fr/ -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
