[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5-303-gfcfa26a

Brice Figureau brice-puppet at daysofwonder.com
Thu Mar 17 10:46:11 UTC 2011


The following commit has been merged in the upstream branch:
commit cfa0c32fc5149464af97235a7bb458950d19cc82
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Fri Feb 11 20:34:22 2011 +0100

    Fix #6281 - Make sure puppetdoc analyzes all files
    
    It can happen that when parsing a file puppet parses other manifests
    if they get imported (this is at least true for site.pp, even in
    ignoreimport=true). Thus those files are now "watched".
    But puppetdoc needs to analyze all files, and since 99c101 we are now
    checking if the file was already parsed to not reparse it again.
    If that was the case, though, we weren't analyzing the produced code.
    Thus it was possible to not produce documentation for the site.pp content.
    
    Signed-off-by: Brice Figureau <brice-puppet at daysofwonder.com>

diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb
index f59af64..ea7439a 100644
--- a/lib/puppet/util/rdoc/parser.rb
+++ b/lib/puppet/util/rdoc/parser.rb
@@ -41,8 +41,10 @@ class Parser
         @parser.file = @input_file_name
         @ast = @parser.parse
       end
-      scan_top_level(@top_level)
+    else
+      @ast = env.known_resource_types
     end
+    scan_top_level(@top_level)
     @top_level
   end
 
diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb
index 3295e90..b4453ae 100755
--- a/spec/unit/util/rdoc/parser_spec.rb
+++ b/spec/unit/util/rdoc/parser_spec.rb
@@ -43,6 +43,18 @@ describe RDoc::Parser do
 
       @parser.scan.should be_a(RDoc::PuppetTopLevel)
     end
+
+    it "should scan the top level even if the file has already parsed" do
+      known_type = stub 'known_types'
+      env = stub 'env'
+      Puppet::Node::Environment.stubs(:new).returns(env)
+      env.stubs(:known_resource_types).returns(known_type)
+      known_type.expects(:watching_file?).with("module/manifests/init.pp").returns(true)
+
+      @parser.expects(:scan_top_level)
+
+      @parser.scan
+    end
   end
 
   describe "when scanning top level entities" do

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list