summaryrefslogtreecommitdiffstats
path: root/tasks/rake/manpages.rake
diff options
context:
space:
mode:
authornfagerlund <nick.fagerlund@gmail.com>2011-02-16 18:36:33 -0800
committernfagerlund <nick.fagerlund@gmail.com>2011-02-17 12:01:18 -0800
commitdac032d589862a9f5c2f054aaf17686bf96f0c09 (patch)
tree6d5379ac48d664b5fe06b3bc6e513115fffaf776 /tasks/rake/manpages.rake
parenta0cff49aaa6586347b77437137cfa57f8013c344 (diff)
downloadpuppet-dac032d589862a9f5c2f054aaf17686bf96f0c09.tar.gz
puppet-dac032d589862a9f5c2f054aaf17686bf96f0c09.tar.xz
puppet-dac032d589862a9f5c2f054aaf17686bf96f0c09.zip
(#1204) Make rake gen_manpages output puppet-{application} manpages
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.
Diffstat (limited to 'tasks/rake/manpages.rake')
-rw-r--r--tasks/rake/manpages.rake18
1 files changed, 14 insertions, 4 deletions
diff --git a/tasks/rake/manpages.rake b/tasks/rake/manpages.rake
index 752a6a7a6..f48e57cc7 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