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?

-- Markus
-----------------------------------------------------------
The power of accurate observation is
commonly called cynicism by those
who have not got it.  ~George Bernard Shaw
------------------------------------------------------------

-- 
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.

Reply via email to