[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:31 UTC 2010


The following commit has been merged in the upstream branch:
commit 99d8323ece06ffde0ddfb5753ef94541d473a9d9
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Sat Jul 10 18:52:28 2010 +0200

    Fix #4206 - import "path/*" tries to import files twice
    
    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 makes sure manifests are returned only once.
    
    Signed-off-by: Brice Figureau <brice-puppet at daysofwonder.com>

diff --git a/lib/puppet/parser/files.rb b/lib/puppet/parser/files.rb
index 7497434..9ef05e1 100644
--- 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}' : '' )).uniq.reject { |f| FileTest.directory?(f) }]
   end
 
   # Find the concrete file denoted by +file+. If +file+ is absolute,
diff --git a/spec/unit/parser/files_spec.rb b/spec/unit/parser/files_spec.rb
index d1b5491..fcfbfa6 100644
--- a/spec/unit/parser/files_spec.rb
+++ b/spec/unit/parser/files_spec.rb
@@ -173,6 +173,12 @@ describe Puppet::Parser::Files do
       FileTest.expects(:directory?).with(dir).returns(true)
       Puppet::Parser::Files.find_manifests(pattern)[1].should == [file]
     end
+
+    it "should return files once only" do
+      pattern = @basepath + "/fully/qualified/pattern/*"
+      Dir.expects(:glob).with(pattern+'{,.pp,.rb}').returns(%w{one two one})
+      Puppet::Parser::Files.find_manifests(pattern)[1].should == %w{one two}
+    end
   end
 
   describe "when searching for manifests in a found module" do

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list