lib/omnibus/packagers/solaris.rb in omnibus-5.0.0 vs lib/omnibus/packagers/solaris.rb in omnibus-5.1.0
- old
+ new
@@ -66,34 +66,46 @@
#
def write_scripts
SCRIPT_MAP.each do |source, destination|
source_path = File.join(project.package_scripts_path, source.to_s)
- if File.file?(source_path)
- destination_path = staging_dir_path(destination)
- log.debug(log_key) { "Adding script `#{source}' to `#{destination_path}'" }
- copy_file(source_path, destination_path)
- end
+ next unless File.file?(source_path)
+
+ destination_path = staging_dir_path(destination)
+ log.debug(log_key) { "Adding script `#{source}' to `#{destination_path}'" }
+ copy_file(source_path, destination_path)
end
end
#
# Generate a Prototype file for solaris build
#
def write_prototype_file
shellout! "cd #{install_dirname} && find #{install_basename} -print > #{staging_dir_path('files')}"
+ File.open staging_dir_path('files.clean'), 'w+' do |fout|
+ File.open staging_dir_path('files') do |fin|
+ fin.each_line do |line|
+ if line.chomp =~ /\s/
+ log.warn(log_key) { "Skipping packaging '#{line}' file due to whitespace in filename" }
+ else
+ fout.write(line)
+ end
+ end
+ end
+ end
+
# generate list of control files
File.open staging_dir_path('Prototype'), 'w+' do |f|
f.write <<-EOF.gsub(/^ {10}/, '')
i pkginfo
i postinstall
i postremove
EOF
end
# generate the prototype's file list
- shellout! "cd #{install_dirname} && pkgproto < #{staging_dir_path('files')} > #{staging_dir_path('Prototype.files')}"
+ shellout! "cd #{install_dirname} && pkgproto < #{staging_dir_path('files.clean')} > #{staging_dir_path('Prototype.files')}"
# fix up the user and group in the file list to root
shellout! "awk '{ $5 = \"root\"; $6 = \"root\"; print }' < #{staging_dir_path('Prototype.files')} >> #{staging_dir_path('Prototype')}"
end