software_smithy 1.1 → 1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,61 +35,41 @@
35
35
  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
36
  # }}}
37
37
 
38
- # try and blank? methods borrowed from rails
39
- # See: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/try.rb
40
- class Object
41
- def try(method, *args, &block)
42
- send(method, *args, &block)
43
- end
44
- remove_method :try
45
- alias_method :try, :__send__
46
-
47
- def blank?
48
- respond_to?(:empty?) ? empty? : !self
49
- end
50
- end
51
-
52
- class NilClass #:nodoc:
53
- def try(*args)
54
- nil
55
- end
56
-
57
- def blank?
58
- true
59
- end
60
- end
61
-
62
38
  module Smithy
63
39
  def notice(message)
64
- STDOUT.puts "==> ".color(:blue).bright+message.bright if STDOUT.tty?
40
+ STDOUT.puts "==> ".color(:blue).bright+message.bright #if STDOUT.tty?
65
41
  end
66
42
 
67
43
  def notice_warn(message)
68
- STDOUT.puts ("==> "+message).color(:yellow) if STDOUT.tty?
44
+ STDOUT.puts ("==> "+message).color(:yellow) #if STDOUT.tty?
69
45
  end
70
46
 
71
47
  def notice_info(message)
72
- STDOUT.puts (message).color(:blue) if STDOUT.tty?
48
+ STDOUT.puts (message).color(:blue) #if STDOUT.tty?
73
49
  end
74
50
 
75
51
  def notice_command(command, comment, width=40)
76
- STDOUT.puts command.bright.ljust(width)+comment.color(:blue) if STDOUT.tty?
52
+ STDOUT.puts command.bright.ljust(width)+comment.color(:blue) #if STDOUT.tty?
77
53
  end
78
54
 
79
55
  def notice_success(message)
80
- if STDOUT.tty?
81
- STDOUT.puts ("==> "+message).color(:green)
82
- else
83
- STDOUT.puts message
84
- end
56
+ # if STDOUT.tty?
57
+ STDOUT.puts "==> ".color(:green).bright + message.color(:green)
58
+ # else
59
+ # STDOUT.puts message
60
+ # end
85
61
  end
86
62
 
87
63
  def notice_fail(message)
88
- if STDOUT.tty?
64
+ # if STDOUT.tty?
89
65
  STDOUT.puts ("==> "+message).color(:red)
90
- else
91
- STDOUT.puts message
92
- end
66
+ # else
67
+ # STDOUT.puts message
68
+ # end
69
+ end
70
+
71
+ def notice_exception(message)
72
+ STDERR.puts "==> ERROR: ".color(:red).bright + message
93
73
  end
94
74
 
95
75
  def process_ouput(stdout, stderr, suppress_stdout = false, log_file = nil)
@@ -156,4 +136,70 @@ module Smithy
156
136
  # end
157
137
  end
158
138
 
139
+ def operating_system
140
+ b = `uname -m`.chomp
141
+ redhat = "/etc/redhat-release"
142
+ suse = "/etc/SuSE-release"
143
+ if File.exists? redhat
144
+ # Red Hat Enterprise Linux Server release 6.3 (Santiago)
145
+ # CentOS release 5.9 (Final)
146
+ content = File.read(redhat)
147
+ content =~ /([\d\.]+)/
148
+ version = $1
149
+ b = "rhel" if content =~ /Red Hat/
150
+ b = "centos" if content =~ /CentOS/
151
+ b += version
152
+ elsif File.exists? suse
153
+ # SUSE Linux Enterprise Server 11 (x86_64)
154
+ # VERSION = 11
155
+ # PATCHLEVEL = 1
156
+ content = File.read(suse)
157
+ content =~ /VERSION = (\d+)/
158
+ version = $1
159
+ content =~ /PATCHLEVEL = (\d+)/
160
+ patch = $1
161
+ b = "sles#{version}.#{patch}"
162
+ end
163
+
164
+ if `gcc --version` =~ /gcc \((.*)\) ([\d\.]+)/
165
+ b << "_gnu#{$2}"
166
+ end
167
+ return b
168
+ end
169
+
170
+ def url_filename(url)
171
+ File.basename(URI(url).path)
172
+ end
173
+
174
+ def url_filename_version_number(url)
175
+ version = url_filename(url)
176
+ version = $1 if version =~ /([\d\.]+[\d])/
177
+ version
178
+ end
179
+
180
+ def url_filename_basename(url)
181
+ name = url_filename(url)
182
+ name = $1 if name =~ /(.*?)-([\d\.]+[\d])/
183
+ name
184
+ end
185
+
186
+ def log_exception(e, argv, config)
187
+ logfile = Smithy::Config.global[:"global-error-log"]
188
+ if logfile.present?
189
+ exception = {
190
+ "time" => DateTime.now,
191
+ "user" => `whoami`.chomp,
192
+ "hostname" => `hostname`.chomp,
193
+ "working_dir" => Dir.getwd,
194
+ "argv" => argv,
195
+ "config" => config,
196
+ "exception" => e,
197
+ "backtrace" => e.backtrace
198
+ }
199
+ File.open(logfile, "a") do |f|
200
+ f.write(exception.to_yaml)
201
+ end
202
+ end
203
+ end
204
+
159
205
  end
@@ -54,6 +54,10 @@ module Smithy
54
54
  ]
55
55
  #{:prg_env => "PrgEnv-pathscale", :compiler_name => "pathscale", :human_name => "pathscale", :regex => /(pathscale)(.*)/}
56
56
 
57
+ def self.compilers
58
+ Smithy::Config.compilers || Environments
59
+ end
60
+
57
61
  def initialize(args = {})
58
62
  @package = args[:package]
59
63
  @builds = @package.alternate_builds
@@ -88,9 +92,14 @@ module Smithy
88
92
 
89
93
  FileUtils.mkdir_p(File.join(module_path, package.name), options)
90
94
 
91
- FileOperations.render_erb :destination => module_file,
92
- :erb => File.join(@@smithy_bin_root, "/etc/templates/modulefile.erb"),
93
- :binding => get_binding, :options => options
95
+ if args[:existing]
96
+ existing_modulefile = File.join(args[:existing], "../modulefile", package.name, package.version)
97
+ FileOperations.install_file(existing_modulefile, module_file, options) if File.exists?(existing_modulefile)
98
+ else
99
+ FileOperations.render_erb :destination => module_file,
100
+ :erb => File.join(@@smithy_bin_root, "/etc/templates/modulefile.erb"),
101
+ :binding => get_binding, :options => options
102
+ end
94
103
 
95
104
  FileOperations.make_group_writable(module_path, options.merge(:recursive => true))
96
105
  FileOperations.set_group(module_path, package.group, options.merge(:recursive => true))
@@ -123,9 +132,11 @@ module Smithy
123
132
 
124
133
  def module_build_list(package, builds, args = {})
125
134
  output = ""
126
- notice "Multiple Builds Found"
127
- notice_info "Build Name".rjust(25)+" Required Modules"
128
- Environments.each_with_index do |e,i|
135
+
136
+
137
+ notice "Multiple Builds Found" if Smithy::Config.global[:verbose]
138
+ notice_info "Build Name".rjust(25)+" Required Modules" if Smithy::Config.global[:verbose]
139
+ ModuleFile::compilers.each_with_index do |e,i|
129
140
  if i == 0
130
141
  output << "if "
131
142
  else
@@ -146,14 +157,14 @@ module Smithy
146
157
  end
147
158
  output << "[ is-loaded #{name}/#{version} ] {\n"
148
159
  output << " set BUILD #{b}\n"
149
- notice_info b.rjust(25) + " #{e[:prg_env]} + #{name}/#{version}"
160
+ notice_info b.rjust(25) + " #{e[:prg_env]} + #{name}/#{version}" if Smithy::Config.global[:verbose]
150
161
  end
151
162
  output << " } else {\n"
152
163
  output << " set BUILD #{sub_builds.last}\n"
153
164
  output << " }\n"
154
165
  else
155
166
  output << " set BUILD #{builds[j]}\n"
156
- notice_info builds[j].rjust(25) + " #{e[:prg_env]}"
167
+ notice_info builds[j].rjust(25) + " #{e[:prg_env]}" if Smithy::Config.global[:verbose]
157
168
  end
158
169
  else
159
170
  output << " puts stderr \"Not implemented for the #{e[:human_name]} compiler\"\n"
@@ -214,8 +225,8 @@ module Smithy
214
225
  system_module_defaults += module_files_defaults
215
226
  end
216
227
 
217
- # desired_modules = %w{ ^cce ^pgi ^intel ^gcc ^hdf5 ^netcdf ^fftw ^petsc ^trilinos ^chapel ^java ^ntk ^papi ^stat ^gdb ^perftools ^tpsl ^ga\/ ^libsci_acc ^acml }
218
- # stub_packages = system_module_names.select{|m| m =~ /(#{desired_modules.join('|')})/}
228
+ # desired_modules = %w{ ^cce ^pgi ^intel ^gcc ^hdf5 ^netcdf ^fftw ^petsc ^trilinos ^chapel ^java ^ntk ^papi ^stat ^gdb ^perftools ^tpsl ^ga\/ ^libsci_acc ^acml }
229
+ # stub_packages = system_module_names.select{|m| m =~ /(#{desired_modules.join('|')})/}
219
230
 
220
231
  return system_module_names, system_module_defaults
221
232
  end
@@ -40,19 +40,15 @@ module Smithy
40
40
  attr_accessor :arch, :root, :name, :version, :build_name
41
41
  attr_accessor :group
42
42
 
43
- # Remove root and arch from the path if necessary
44
- def self.normalize_name(args = {})
45
- p = args[:name].dup
46
- if args[:swroot]
47
- root = File.dirname args[:swroot]
48
- arch = File.basename args[:swroot]
49
- else
50
- root = args[:root]
51
- arch = args[:arch]
52
- end
53
- p.gsub! /\/?#{root}\/?/, ''
54
- p.gsub! /\/?#{arch}\/?/, ''
55
- return p
43
+ def self.normalize_name(name)
44
+ name = Dir.pwd if name == "."
45
+ name_split = name.split('/')
46
+ name_version_build = []
47
+ name_version_build << name_split[-3]
48
+ name_version_build << name_split[-2]
49
+ name_version_build << name_split[-1]
50
+ name_version_build.compact!
51
+ return File.join(name_version_build)
56
52
  end
57
53
 
58
54
  def initialize(args = {})
@@ -62,7 +58,7 @@ module Smithy
62
58
  if args[:path].try(:downcase) == 'last'
63
59
  @path = Smithy::Config.last_prefix
64
60
  else
65
- @path = Package.normalize_name(:name => args[:path], :root => @root, :arch => @arch)
61
+ @path = Package.normalize_name(args[:path])
66
62
  end
67
63
  @path =~ /(.*)\/(.*)\/(.*)$/
68
64
  @name = $1
@@ -70,7 +66,8 @@ module Smithy
70
66
  @build_name = $3
71
67
  @group = Smithy::Config.file_group
72
68
 
73
- @group_writeable = Smithy::Config.group_writeable?
69
+ @group_writable = Smithy::Config.group_writable?
70
+ @group_writable = args[:group_writable] if args.has_key?(:group_writable)
74
71
  end
75
72
 
76
73
  def get_binding
@@ -108,18 +105,24 @@ module Smithy
108
105
  BuildFileERBs = [
109
106
  BuildFileNames[:env] ]
110
107
 
111
- def build_support_files
108
+ def build_support_files(alternate_source)
112
109
  file_list = []
113
110
  BuildFileNames.each do |name, file|
114
111
  src = File.join(@@smithy_bin_root, "etc/templates/build", file)
115
112
  src += ".erb" if BuildFileERBs.include?(file)
113
+
114
+ if alternate_source && Dir.exists?(alternate_source)
115
+ alt_src = File.join(alternate_source, file)
116
+ src = alt_src if File.exists? alt_src
117
+ end
118
+
116
119
  file_list << { :name => name, :src => src, :dest => File.join(prefix, file) }
117
120
  end
118
121
  return file_list
119
122
  end
120
123
 
121
- def group_writeable?
122
- @group_writeable
124
+ def group_writable?
125
+ @group_writable
123
126
  end
124
127
 
125
128
  def valid?
@@ -131,7 +134,7 @@ module Smithy
131
134
 
132
135
  # If good, save as last prefix
133
136
  Smithy::Config.save_last_prefix(qualified_name)
134
- return true
137
+ return true
135
138
  end
136
139
 
137
140
  def qualified_name
@@ -148,6 +151,10 @@ module Smithy
148
151
  raise "The package #{prefix} does not exist!" unless prefix_exists?
149
152
  end
150
153
 
154
+ def source_directory
155
+ File.join(prefix,"source")
156
+ end
157
+
151
158
  def rebuild_script
152
159
  File.join(prefix, BuildFileNames[:build])
153
160
  end
@@ -205,7 +212,7 @@ module Smithy
205
212
  else
206
213
  FileUtils.touch(lock_file)
207
214
  FileOperations.set_group(lock_file, group)
208
- FileOperations.make_group_writable(lock_file) if group_writeable?
215
+ FileOperations.make_group_writable(lock_file) if group_writable?
209
216
  return true
210
217
  end
211
218
  end
@@ -214,6 +221,23 @@ module Smithy
214
221
  FileUtils.rm_f(lock_file)
215
222
  end
216
223
 
224
+ def valid_build_file
225
+ File.join(prefix, ".valid")
226
+ end
227
+
228
+ def create_valid_build_file
229
+ unless File.exists? valid_build_file
230
+ FileUtils.touch(valid_build_file)
231
+ FileOperations.set_group(valid_build_file, group)
232
+ FileOperations.make_group_writable(valid_build_file) if group_writable?
233
+ return true
234
+ end
235
+ end
236
+
237
+ def delete_valid_build_file
238
+ FileUtils.rm_f(valid_build_file)
239
+ end
240
+
217
241
  def run_script(args ={})
218
242
  case args[:script]
219
243
  when :build
@@ -239,7 +263,7 @@ module Smithy
239
263
  log_file = File.open(log_file_path, 'w') unless args[:dry_run]
240
264
 
241
265
  FileOperations.set_group(log_file, group)
242
- FileOperations.make_group_writable(log_file) if group_writeable?
266
+ FileOperations.make_group_writable(log_file) if group_writable?
243
267
  end
244
268
  if args[:dry_run] || log_file != nil
245
269
  notice "Logging to #{log_file_path}"
@@ -281,11 +305,7 @@ module Smithy
281
305
 
282
306
  case args[:script]
283
307
  when :build
284
- if exit_status == 0
285
- notice "Setting permissions on installed files"
286
- FileOperations.set_group prefix, @group, :recursive => true
287
- FileOperations.make_group_writable prefix, :recursive => true if group_writeable?
288
- end
308
+ set_file_permissions_recursive if exit_status == 0
289
309
  when :test
290
310
  end
291
311
 
@@ -293,47 +313,26 @@ module Smithy
293
313
  end
294
314
  end
295
315
 
296
- def download(url)
297
- curl = '/usr/bin/curl'
298
- curl = `which curl` unless File.exist? curl
299
- raise "curl cannot be located, without it files cannot be downloaded" if curl.blank?
300
-
301
- downloaded_tarball = "#{prefix}/#{File.basename(URI(url).path)}"
302
- if File.exist?(downloaded_tarball)
303
- puts "downloaded ".rjust(12).color(:green).bright + downloaded_tarball
304
- return downloaded_tarball
305
- else
306
- puts "download ".rjust(12).color(:green).bright + url
307
- end
308
-
309
- args = ['-qf#L']
310
- args << "--silent" unless $stdout.tty?
311
- args << '-o'
312
- args << downloaded_tarball
313
- args << url
314
-
315
- if system(curl, *args)
316
- FileOperations.set_group(downloaded_tarball, group)
317
- FileOperations.make_group_writable(downloaded_tarball) if group_writeable?
318
- return downloaded_tarball
319
- else
320
- return false
316
+ def set_file_permissions_recursive
317
+ if group_writable?
318
+ notice "Setting permissions on installed files"
319
+ FileOperations.set_group prefix, @group, :recursive => true
320
+ FileOperations.make_group_writable prefix, :recursive => true if group_writable?
321
321
  end
322
322
  end
323
323
 
324
324
  def extract(args = {})
325
325
  archive = args[:archive]
326
326
  temp_dir = File.join(prefix,"tmp")
327
- source_dir = File.join(prefix,"source")
328
327
 
329
- notice "Extracting #{archive} to #{source_dir}"
328
+ notice "Extracting to #{source_directory}"
330
329
 
331
330
  return if args[:dry_run]
332
331
 
333
- overwrite = nil
334
- overwrite = Smithy::Config.global.try(:[], :force)
335
- if File.exists?(source_dir) &&
336
- while overwrite.nil? do
332
+ overwrite = Smithy::Config.global.try(:[], :force) ? true : "unknown"
333
+ overwrite = true if args[:overwrite]
334
+ if File.exists?(source_directory)
335
+ while overwrite == "unknown" do
337
336
  prompt = Readline.readline(" "*FILE_NOTICE_COLUMNS+"Overwrite? (enter \"h\" for help) [ynh] ")
338
337
  case prompt.downcase
339
338
  when "y"
@@ -355,7 +354,7 @@ module Smithy
355
354
 
356
355
  if overwrite
357
356
  FileUtils.rm_rf temp_dir
358
- FileUtils.rm_rf source_dir
357
+ FileUtils.rm_rf source_directory
359
358
  FileUtils.mkdir temp_dir
360
359
  FileUtils.cd temp_dir
361
360
 
@@ -372,17 +371,33 @@ module Smithy
372
371
 
373
372
  extracted_files = Dir.glob('*')
374
373
  if extracted_files.count == 1
375
- FileUtils.mv extracted_files.first, source_dir
374
+ FileUtils.mv extracted_files.first, source_directory
376
375
  else
377
376
  FileUtils.cd prefix
378
- FileUtils.mv temp_dir, source_dir
377
+ FileUtils.mv temp_dir, source_directory
379
378
  end
380
379
 
381
380
  FileUtils.rm_rf temp_dir
382
381
 
383
- FileOperations.set_group source_dir, @group, :recursive => true
384
- FileOperations.make_group_writable source_dir, :recursive => true if group_writeable?
382
+ FileOperations.set_group source_directory, @group, :recursive => true
383
+ FileOperations.make_group_writable source_directory, :recursive => true if group_writable?
384
+ end
385
+ end
386
+
387
+ def update_version_table_file(options)
388
+ version_table_file = File.join(application_directory, ".versions")
389
+ version_table = YAML.load_file(version_table_file).stringify_keys rescue {}
390
+ if version_table[version].is_a? String
391
+ version_table[version] = [ build_name.encode('UTF-8') ]
392
+ elsif version_table[version].is_a? Array
393
+ version_table[version] << build_name.encode('UTF-8') unless version_table[version].include?(build_name.encode('UTF-8'))
394
+ else
395
+ version_table.merge!({version.encode('UTF-8') => build_name.encode('UTF-8')})
385
396
  end
397
+
398
+ FileOperations.install_from_string version_table.to_yaml, version_table_file, options.merge({:force => true})
399
+ FileOperations.set_group version_table_file, group, options
400
+ FileOperations.make_group_writable version_table_file, options if group_writable?
386
401
  end
387
402
 
388
403
  def create(args = {})
@@ -395,27 +410,26 @@ module Smithy
395
410
  [application_directory].each do |dir|
396
411
  FileOperations.make_directory dir, options
397
412
  FileOperations.set_group dir, group, options
398
- FileOperations.make_group_writable dir, options if group_writeable?
413
+ FileOperations.make_group_writable dir, options if group_writable?
399
414
  end
400
415
 
401
- version_table_file = File.join(application_directory, ".versions")
402
- version_table = YAML.load_file(version_table_file).stringify_keys rescue {}
403
- version_table.merge!({version => build_name})
404
-
405
- FileOperations.install_from_string version_table.to_yaml, version_table_file, options.merge({:force => true})
406
- FileOperations.set_group version_table_file, group, options
407
- FileOperations.make_group_writable version_table_file, options if group_writeable?
416
+ update_version_table_file(options)
408
417
  else
409
418
 
410
419
  directories.each do |dir|
411
420
  #if dir == prefix
412
421
  FileOperations.make_directory dir, options
413
422
  FileOperations.set_group dir, group, options
414
- FileOperations.make_group_writable dir, options if group_writeable?
423
+ FileOperations.make_group_writable dir, options if group_writable?
415
424
  #end
416
425
  end
417
426
 
418
- all_files = build_support_files
427
+ if args[:formula]
428
+ update_version_table_file(options)
429
+ return
430
+ end
431
+
432
+ all_files = build_support_files(args[:existing])
419
433
  all_files = package_support_files + all_files if args[:web] || args[:stub]
420
434
 
421
435
  all_files.each do |file|
@@ -433,7 +447,7 @@ module Smithy
433
447
  end
434
448
 
435
449
  FileOperations.set_group file[:dest], group, options
436
- FileOperations.make_group_writable file[:dest], options if group_writeable?
450
+ FileOperations.make_group_writable file[:dest], options if group_writable?
437
451
  FileOperations.make_executable file[:dest], options if file[:dest] =~ /(#{ExecutableBuildFileNames.join('|')})/
438
452
  end
439
453
 
@@ -442,7 +456,7 @@ module Smithy
442
456
 
443
457
  def module_load_prgenv
444
458
  output = ""
445
- ModuleFile::Environments.each do |e|
459
+ ModuleFile::compilers.each do |e|
446
460
  if build_name =~ e[:regex]
447
461
  output = "module load #{e[:prg_env]}"
448
462
  break
@@ -486,7 +500,7 @@ module Smithy
486
500
  if missing_package.include?(file[:name])
487
501
  FileOperations.install_file file[:src], file[:dest], options
488
502
  FileOperations.set_group file[:dest], group, options
489
- FileOperations.make_group_writable file[:dest], options if group_writeable?
503
+ FileOperations.make_group_writable file[:dest], options if group_writable?
490
504
  end
491
505
  end
492
506
  end
@@ -496,7 +510,7 @@ module Smithy
496
510
  if missing_build.include?(file[:name])
497
511
  FileOperations.install_file file[:src], file[:dest], options
498
512
  FileOperations.set_group file[:dest], group, options
499
- FileOperations.make_group_writable file[:dest], options if group_writeable?
513
+ FileOperations.make_group_writable file[:dest], options if group_writable?
500
514
  end
501
515
  end
502
516
  end
@@ -504,11 +518,11 @@ module Smithy
504
518
  notice "Setting permissions for #{prefix}"
505
519
 
506
520
  FileOperations.set_group prefix, group, options.merge(:recursive => true)
507
- FileOperations.make_group_writable prefix, options.merge(:recursive => true) if group_writeable?
521
+ FileOperations.make_group_writable prefix, options.merge(:recursive => true) if group_writable?
508
522
 
509
523
  [version_directory, application_directory].each do |dir|
510
524
  FileOperations.set_group dir, group, options
511
- FileOperations.make_group_writable dir, options if group_writeable?
525
+ FileOperations.make_group_writable dir, options if group_writable?
512
526
  end
513
527
  end
514
528
 
@@ -527,7 +541,7 @@ module Smithy
527
541
 
528
542
  stubbed_builds = YAML.load_file(File.join(File.dirname(version_directory), ".versions")).stringify_keys rescue {}
529
543
  if stubbed_builds[version]
530
- if stubbed_builds[version].class == String
544
+ if stubbed_builds[version].is_a? String
531
545
  builds += [ stubbed_builds[version] ]
532
546
  else
533
547
  builds += stubbed_builds[version]
@@ -560,12 +574,23 @@ module Smithy
560
574
  Description.publishable?(application_directory)
561
575
  end
562
576
 
577
+ def self.search(query = '')
578
+ Package.all.select{|s| s =~ /#{query}/}
579
+ end
580
+
581
+ def self.search_by_name(name)
582
+ Package.all(:name => name)
583
+ end
584
+
563
585
  def self.all(args = {})
586
+ name = args[:name] || '*'
587
+ version = args[:version] || '*'
588
+ build = args[:build] || '*'
564
589
  # Array of full paths to rebuild scripts
565
- software = Dir.glob(args[:root]+"/*/*/*/#{BuildFileNames[:build]}")
590
+ software = Dir.glob(Smithy::Config.full_root+"/#{name}/#{version}/#{build}/#{BuildFileNames[:build]}")
591
+ software += Dir.glob(Smithy::Config.full_root+"/#{name}/#{version}/#{build}/.valid")
566
592
  # Remove rebuild from each path
567
- software.collect!{|s| s.gsub(/\/#{BuildFileNames[:build]}$/, '')}
568
- #TODO allow sorting?
593
+ software.collect!{|s| s.gsub(/\/(#{BuildFileNames[:build]}|\.valid)$/, '')}
569
594
  software.sort!
570
595
  end
571
596
 
@@ -582,15 +607,15 @@ module Smithy
582
607
  software.reject! do |s|
583
608
  ! Description.publishable?(s)
584
609
  end
585
- software.sort!
610
+ software.sort!
586
611
  return software
587
612
  end
588
613
 
589
614
  def self.create_stubs_from_modules(stub_packages, system_module_defaults, options = {})
590
615
  notice "Generating stubs for the following modules:"
591
616
  Format.print_column_list(stub_packages)
592
- proceed = nil
593
- while proceed.nil? do
617
+ proceed = "no"
618
+ while proceed == "no" do
594
619
  prompt = Readline.readline("Generate the above packages? [yn] ")
595
620
  case prompt.downcase
596
621
  when "y"
@@ -639,7 +664,7 @@ The following information is available by running `module help #{name}`
639
664
  ops = {:noop => options[:"dry-run"] ? true : false}
640
665
  FileOperations.install_from_string(help_content, help_dest, ops)
641
666
  FileOperations.set_group help_dest, p.group, ops
642
- FileOperations.make_group_writable help_dest, ops if p.group_writeable?
667
+ FileOperations.make_group_writable help_dest, ops if p.group_writable?
643
668
  end
644
669
  end
645
670