The manpage generator can now make manpages for the modern executable in
addition to the legacy executables. The section for the legacy
names should be deleted upon the release of 2.8.0.

Signed-off-by: nfagerlund <[email protected]>
---
Local-branch: ticket/next/1204
 tasks/rake/manpages.rake |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/tasks/rake/manpages.rake b/tasks/rake/manpages.rake
index 752a6a7..f48e57c 100644
--- a/tasks/rake/manpages.rake
+++ b/tasks/rake/manpages.rake
@@ -5,23 +5,33 @@ task :gen_manpages do
 
   sbins = Dir.glob(%w{sbin/*})
   bins  = Dir.glob(%w{bin/*})
-  
+  applications  = Dir.glob(%w{lib/puppet/application/*})
   # Locate ronn
   ronn = %x{which ronn}
   ronn.chomp!
+
   # Create puppet.conf.5 man page
   %x{RUBYLIB=./lib:$RUBYLIB bin/puppetdoc --reference configuration > 
./man/man5/puppetconf.5.ronn}
   %x{#{ronn} --manual="Puppet manual" --organization="Puppet Labs, LLC" -r 
./man/man5/puppetconf.5.ronn}
   File.move("./man/man5/puppetconf.5", "./man/man5/puppet.conf.5")
   File.unlink("./man/man5/puppetconf.5.ronn")
 
-  # Create binary man pages
+  # Create LEGACY binary man pages (i.e. delete me for 2.8.0)
   binary = bins + sbins
   binary.each do |bin|
-    b = bin.gsub( /(bin|sbin)\//, "")
+    b = bin.gsub( /^s?bin\//, "")
     %x{RUBYLIB=./lib:$RUBYLIB #{bin} --help > ./man/man8/#{b}.8.ronn}
     %x{#{ronn} --manual="Puppet manual" --organization="Puppet Labs, LLC" -r 
./man/man8/#{b}.8.ronn}
     File.unlink("./man/man8/#{b}.8.ronn")
   end
-  
+
+  # Create modern binary man pages
+  applications.each do |app|
+    app.gsub!( /^lib\/puppet\/application\/(.*?)\.rb/, '\1')
+    %x{RUBYLIB=./lib:$RUBYLIB bin/puppet #{app} --help > 
./man/man8/puppet-#{app}.8.ronn}
+    %x{#{ronn} --manual="Puppet manual" --organization="Puppet Labs, LLC" -r 
./man/man8/puppet-#{app}.8.ronn}
+    File.unlink("./man/man8/puppet-#{app}.8.ronn")
+  end
+
+
 end
\ No newline at end of file
-- 
1.7.3.3

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