diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-04 01:34:39 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-04 01:34:39 +0000 |
| commit | 584652c6b84fdbc910f7bde96639b772dde8fa23 (patch) | |
| tree | a242937c48de48b93709dbab534e7eab5fa35490 /install.rb | |
| parent | 0e0fdac1a743416191dd202cf8606d7a2ef042eb (diff) | |
| download | puppet-584652c6b84fdbc910f7bde96639b772dde8fa23.tar.gz puppet-584652c6b84fdbc910f7bde96639b772dde8fa23.tar.xz puppet-584652c6b84fdbc910f7bde96639b772dde8fa23.zip | |
Disabling most documentation generation except for the API docs, and wrapping the StatusServer in the xmlrpc check
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@766 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'install.rb')
| -rw-r--r-- | install.rb | 90 |
1 files changed, 61 insertions, 29 deletions
diff --git a/install.rb b/install.rb index d36857fbd..a9422c697 100644 --- a/install.rb +++ b/install.rb @@ -36,21 +36,30 @@ require 'rbconfig'
require 'find'
require 'fileutils'
-require 'rdoc/rdoc'
require 'optparse'
require 'ostruct'
+begin
+ require 'rdoc/rdoc'
+ $haverdoc = true
+rescue LoadError
+ puts "Missing rdoc; skipping documentation"
+ $haverdoc = false
+end
+
+PREREQS = %w{openssl facter xmlrpc/client xmlrpc/server cgi}
+
InstallOptions = OpenStruct.new
def glob(list)
- g = list.map { |i| Dir.glob(i) }
- g.flatten!
- g.compact!
- g.reject! { |e| e =~ /\.svn/ }
- g
+ g = list.map { |i| Dir.glob(i) }
+ g.flatten!
+ g.compact!
+ g.reject! { |e| e =~ /\.svn/ }
+ g
end
- # Set these values to what you want installed.
+# Set these values to what you want installed.
bins = glob(%w{bin/**/*})
rdoc = glob(%w{bin/**/* lib/**/*.rb README README-library CHANGELOG TODO Install}).reject { |e| e=~ /\.(bat|cmd)$/ }
ri = glob(%w(bin/**/*.rb lib/**/*.rb)).reject { |e| e=~ /\.(bat|cmd)$/ }
@@ -74,15 +83,32 @@ def do_libs(libs, strip = 'lib/') end
end
+# Verify that all of the prereqs are installed
+def check_prereqs
+ PREREQS.each { |pre|
+ begin
+ require pre
+ rescue LoadError
+ puts "Could not load %s; cannot install" % pre
+ end
+ }
+end
+
##
# Prepare the file installation.
#
def prepare_installation
- InstallOptions.rdoc = true
- if RUBY_PLATFORM == "i386-mswin32"
- InstallOptions.ri = false
+ # Only try to do docs if we're sure they have rdoc
+ if $haverdoc
+ InstallOptions.rdoc = true
+ if RUBY_PLATFORM == "i386-mswin32"
+ InstallOptions.ri = false
+ else
+ InstallOptions.ri = true
+ end
else
- InstallOptions.ri = true
+ InstallOptions.rdoc = false
+ InstallOptions.ri = false
end
InstallOptions.tests = true
@@ -153,25 +179,30 @@ end # Build the rdoc documentation. Also, try to build the RI documentation.
#
def build_rdoc(files)
- r = RDoc::RDoc.new
- r.document(["--main", "README", "--title", "Puppet -- Site Configuration Management",
- "--line-numbers"] + files)
-
-rescue RDoc::RDocError => e
- $stderr.puts e.message
-rescue Exception => e
- $stderr.puts "Couldn't build RDoc documentation\n#{e.message}"
+ return unless $haverdoc
+ begin
+ r = RDoc::RDoc.new
+ r.document(["--main", "README", "--title",
+ "Puppet -- Site Configuration Management", "--line-numbers"] + files)
+ rescue RDoc::RDocError => e
+ $stderr.puts e.message
+ rescue Exception => e
+ $stderr.puts "Couldn't build RDoc documentation\n#{e.message}"
+ end
end
def build_ri(files)
- ri = RDoc::RDoc.new
- #ri.document (["--ri-site", "--merge"] + files)
- ri.document(["--ri-site"] + files)
-rescue RDoc::RDocError => e
- $stderr.puts e.message
-rescue Exception => e
- $stderr.puts "Couldn't build Ri documentation\n#{e.message}"
- $stderr.puts "Continuing with install..."
+ return unless $haverdoc
+ begin
+ ri = RDoc::RDoc.new
+ #ri.document(["--ri-site", "--merge"] + files)
+ ri.document(["--ri-site"] + files)
+ rescue RDoc::RDocError => e
+ $stderr.puts e.message
+ rescue Exception => e
+ $stderr.puts "Couldn't build Ri documentation\n#{e.message}"
+ $stderr.puts "Continuing with install..."
+ end
end
def run_tests(test_list)
@@ -261,10 +292,11 @@ goto done :done
EOS
+check_prereqs
prepare_installation
run_tests(tests) if InstallOptions.tests
-build_rdoc(rdoc) if InstallOptions.rdoc
-build_ri(ri) if InstallOptions.ri
+#build_rdoc(rdoc) if InstallOptions.rdoc
+#build_ri(ri) if InstallOptions.ri
do_bins(bins, Config::CONFIG['bindir'])
do_libs(libs)
|
