36
36
require 'optparse'
37
37
require 'ostruct'
38
38
39
- begin
40
- require 'rdoc/rdoc'
41
- $haverdoc = true
42
- rescue LoadError
43
- puts "Missing rdoc; skipping documentation"
44
- $haverdoc = false
45
- end
46
-
47
39
PREREQS = %w{ openssl facter cgi }
48
40
MIN_FACTER_VERSION = 1.5
49
41
@@ -140,25 +132,9 @@ def prepare_installation
140
132
InstallOptions . check_prereqs = true
141
133
InstallOptions . batch_files = true
142
134
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
-
153
135
ARGV . options do |opts |
154
136
opts . banner = "Usage: #{ File . basename ( $0) } [options]"
155
137
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
162
138
opts . on ( '--[no-]configs' , 'Prevents the installation of config files' , 'Default off.' ) do |ontest |
163
139
InstallOptions . configs = ontest
164
140
end
@@ -205,14 +181,8 @@ def prepare_installation
205
181
InstallOptions . batch_files = false
206
182
end
207
183
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
215
184
InstallOptions . configs = true
185
+ warn "--quick is deprecated. Use --configs"
216
186
end
217
187
opts . separator ( "" )
218
188
opts . on_tail ( '--help' , "Shows this help text." ) do
@@ -223,9 +193,6 @@ def prepare_installation
223
193
opts . parse!
224
194
end
225
195
226
- version = [ RbConfig ::CONFIG [ "MAJOR" ] , RbConfig ::CONFIG [ "MINOR" ] ] . join ( "." )
227
- libdir = File . join ( RbConfig ::CONFIG [ "libdir" ] , "ruby" , version )
228
-
229
196
# Mac OS X 10.5 and higher declare bindir
230
197
# /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
231
198
# which is not generally where people expect executables to be installed
@@ -312,7 +279,8 @@ def prepare_installation
312
279
if sitelibdir . nil?
313
280
sitelibdir = $LOAD_PATH. find { |x | x =~ /site_ruby/ }
314
281
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" )
316
284
elsif sitelibdir !~ Regexp . quote ( version )
317
285
sitelibdir = File . join ( sitelibdir , version )
318
286
end
@@ -328,10 +296,6 @@ def prepare_installation
328
296
# This is the new way forward
329
297
if not InstallOptions . destdir . nil?
330
298
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."
335
299
else
336
300
destdir = ''
337
301
end
@@ -362,7 +326,6 @@ def prepare_installation
362
326
InstallOptions . codedir = codedir
363
327
InstallOptions . config_dir = configdir
364
328
InstallOptions . bin_dir = bindir
365
- InstallOptions . lib_dir = libdir
366
329
InstallOptions . man_dir = mandir
367
330
InstallOptions . var_dir = vardir
368
331
InstallOptions . public_dir = publicdir
@@ -381,36 +344,6 @@ def join(basedir, dir)
381
344
"#{ basedir } #{ dir } "
382
345
end
383
346
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
-
414
347
##
415
348
# Install file(s) from ./bin to RbConfig::CONFIG['bindir']. Patch it on the way
416
349
# 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)
476
409
# Set these values to what you want installed.
477
410
configs = glob ( %w{ conf/puppet.conf conf/hiera.yaml } )
478
411
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)$/ }
481
412
man = glob ( %w{ man/man[0-9]/* } )
482
413
libs = glob ( %w{ lib/**/* } )
483
414
locales = glob ( %w{ locales/**/* } )
@@ -488,8 +419,6 @@ def install_binfile(from, op_file, target)
488
419
windows_bins = glob ( %w{ ext/windows/*bat } )
489
420
end
490
421
491
- #build_rdoc(rdoc) if InstallOptions.rdoc
492
- #build_ri(ri) if InstallOptions.ri
493
422
do_configs ( configs , InstallOptions . config_dir ) if InstallOptions . configs
494
423
do_bins ( bins , InstallOptions . bin_dir )
495
424
do_bins ( windows_bins , InstallOptions . bin_dir , 'ext/windows/' ) if $osname == "windows" && InstallOptions . batch_files
0 commit comments