Skip to content

Commit f3d12c2

Browse files
authored
Merge pull request #9425 from ekohl/remove-unused-install-stuff
Remove deprecated DESTDIR and unused things from install.rb
2 parents 9f73d01 + 7d07ea5 commit f3d12c2

File tree

1 file changed

+3
-74
lines changed

1 file changed

+3
-74
lines changed

install.rb

Lines changed: 3 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@
3636
require 'optparse'
3737
require 'ostruct'
3838

39-
begin
40-
require 'rdoc/rdoc'
41-
$haverdoc = true
42-
rescue LoadError
43-
puts "Missing rdoc; skipping documentation"
44-
$haverdoc = false
45-
end
46-
4739
PREREQS = %w{openssl facter cgi}
4840
MIN_FACTER_VERSION = 1.5
4941

@@ -140,25 +132,9 @@ def prepare_installation
140132
InstallOptions.check_prereqs = true
141133
InstallOptions.batch_files = true
142134

143-
# Only try to do docs if we're sure they have rdoc
144-
if $haverdoc
145-
InstallOptions.rdoc = true
146-
InstallOptions.ri = true
147-
else
148-
InstallOptions.rdoc = false
149-
InstallOptions.ri = false
150-
end
151-
152-
153135
ARGV.options do |opts|
154136
opts.banner = "Usage: #{File.basename($0)} [options]"
155137
opts.separator ""
156-
opts.on('--[no-]rdoc', 'Prevents the creation of RDoc output.', 'Default on.') do |onrdoc|
157-
InstallOptions.rdoc = onrdoc
158-
end
159-
opts.on('--[no-]ri', 'Prevents the creation of RI output.', 'Default off on mswin32.') do |onri|
160-
InstallOptions.ri = onri
161-
end
162138
opts.on('--[no-]configs', 'Prevents the installation of config files', 'Default off.') do |ontest|
163139
InstallOptions.configs = ontest
164140
end
@@ -205,14 +181,8 @@ def prepare_installation
205181
InstallOptions.batch_files = false
206182
end
207183
opts.on('--quick', 'Performs a quick installation. Only the', 'installation is done.') do |quick|
208-
InstallOptions.rdoc = false
209-
InstallOptions.ri = false
210-
InstallOptions.configs = true
211-
end
212-
opts.on('--full', 'Performs a full installation. All', 'optional installation steps are run.') do |full|
213-
InstallOptions.rdoc = true
214-
InstallOptions.ri = true
215184
InstallOptions.configs = true
185+
warn "--quick is deprecated. Use --configs"
216186
end
217187
opts.separator("")
218188
opts.on_tail('--help', "Shows this help text.") do
@@ -223,9 +193,6 @@ def prepare_installation
223193
opts.parse!
224194
end
225195

226-
version = [RbConfig::CONFIG["MAJOR"], RbConfig::CONFIG["MINOR"]].join(".")
227-
libdir = File.join(RbConfig::CONFIG["libdir"], "ruby", version)
228-
229196
# Mac OS X 10.5 and higher declare bindir
230197
# /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
231198
# which is not generally where people expect executables to be installed
@@ -312,7 +279,8 @@ def prepare_installation
312279
if sitelibdir.nil?
313280
sitelibdir = $LOAD_PATH.find { |x| x =~ /site_ruby/ }
314281
if sitelibdir.nil?
315-
sitelibdir = File.join(libdir, "site_ruby")
282+
version = [RbConfig::CONFIG["MAJOR"], RbConfig::CONFIG["MINOR"]].join(".")
283+
sitelibdir = File.join(RbConfig::CONFIG["libdir"], "ruby", version, "site_ruby")
316284
elsif sitelibdir !~ Regexp.quote(version)
317285
sitelibdir = File.join(sitelibdir, version)
318286
end
@@ -328,10 +296,6 @@ def prepare_installation
328296
# This is the new way forward
329297
if not InstallOptions.destdir.nil?
330298
destdir = InstallOptions.destdir
331-
# To be deprecated once people move over to using --destdir option
332-
elsif not ENV['DESTDIR'].nil?
333-
destdir = ENV['DESTDIR']
334-
warn "DESTDIR is deprecated. Use --destdir instead."
335299
else
336300
destdir = ''
337301
end
@@ -362,7 +326,6 @@ def prepare_installation
362326
InstallOptions.codedir = codedir
363327
InstallOptions.config_dir = configdir
364328
InstallOptions.bin_dir = bindir
365-
InstallOptions.lib_dir = libdir
366329
InstallOptions.man_dir = mandir
367330
InstallOptions.var_dir = vardir
368331
InstallOptions.public_dir = publicdir
@@ -381,36 +344,6 @@ def join(basedir, dir)
381344
"#{basedir}#{dir}"
382345
end
383346

384-
##
385-
# Build the rdoc documentation. Also, try to build the RI documentation.
386-
#
387-
def build_rdoc(files)
388-
return unless $haverdoc
389-
begin
390-
r = RDoc::RDoc.new
391-
r.document(["--main", "README", "--title", "Puppet -- Site Configuration Management", "--line-numbers"] + files)
392-
rescue RDoc::RDocError => e
393-
$stderr.puts e.message
394-
rescue Exception => e
395-
$stderr.puts "Couldn't build RDoc documentation\n#{e.message}"
396-
end
397-
end
398-
399-
def build_ri(files)
400-
return unless $haverdoc
401-
return if $osname == "windows"
402-
begin
403-
ri = RDoc::RDoc.new
404-
#ri.document(["--ri-site", "--merge"] + files)
405-
ri.document(["--ri-site"] + files)
406-
rescue RDoc::RDocError => e
407-
$stderr.puts e.message
408-
rescue Exception => e
409-
$stderr.puts "Couldn't build Ri documentation\n#{e.message}"
410-
$stderr.puts "Continuing with install..."
411-
end
412-
end
413-
414347
##
415348
# Install file(s) from ./bin to RbConfig::CONFIG['bindir']. Patch it on the way
416349
# to insert a #! line; on a Unix install, the command is named as expected
@@ -476,8 +409,6 @@ def install_binfile(from, op_file, target)
476409
# Set these values to what you want installed.
477410
configs = glob(%w{conf/puppet.conf conf/hiera.yaml})
478411
bins = glob(%w{bin/*})
479-
#rdoc = glob(%w{bin/* lib/**/*.rb README* }).reject { |e| e=~ /\.(bat|cmd)$/ }
480-
#ri = glob(%w{bin/*.rb lib/**/*.rb}).reject { |e| e=~ /\.(bat|cmd)$/ }
481412
man = glob(%w{man/man[0-9]/*})
482413
libs = glob(%w{lib/**/*})
483414
locales = glob(%w{locales/**/*})
@@ -488,8 +419,6 @@ def install_binfile(from, op_file, target)
488419
windows_bins = glob(%w{ext/windows/*bat})
489420
end
490421

491-
#build_rdoc(rdoc) if InstallOptions.rdoc
492-
#build_ri(ri) if InstallOptions.ri
493422
do_configs(configs, InstallOptions.config_dir) if InstallOptions.configs
494423
do_bins(bins, InstallOptions.bin_dir)
495424
do_bins(windows_bins, InstallOptions.bin_dir, 'ext/windows/') if $osname == "windows" && InstallOptions.batch_files

0 commit comments

Comments
 (0)