Skip to content

Commit

Permalink
Avoid OpenSSL blow the build process due symlinks
Browse files Browse the repository at this point in the history
OpenSSL contained symlinks which blows untar'ing
  • Loading branch information
luislavena committed Aug 4, 2010
1 parent 8ae9a73 commit 4908801
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions rake/extracttask.rb
Expand Up @@ -24,9 +24,9 @@ def extract(file, target, options = {})
# extract the files directly to target directory without the need to first
# extract to a temporary directory as when using 7za.exe
when /(^.+\.tar)\.z$/, /(^.+\.tar)\.gz$/, /(^.+\.tar)\.bz2$/, /(^.+\.tar)\.lzma$/
bsd_tar_extract(target, file)
bsd_tar_extract(target, file, options)
when /(^.+)\.tgz$/
bsd_tar_extract(target, file)
bsd_tar_extract(target, file, options)
when /(^.+\.zip$)/
seven_zip(target, $1)
else
Expand Down Expand Up @@ -80,10 +80,16 @@ def seven_zip_build(source, target, options={})
sh "\"#{RubyInstaller::SEVEN_ZIP}\" a -mx=9 #{sfx_arg} \"#{target}\" \"#{source}\" > NUL 2>&1"
end

def bsd_tar_extract(target, file)
def bsd_tar_extract(target, file, options = {})
block = if options[:noerror]
lambda { |ok, status|
ok or warn "We detected some errors with status (#{status.exitstatus})"
}
end

puts "** Extracting #{file} into #{target}" if Rake.application.options.trace
absolute_file = File.expand_path(file)
Dir.chdir(target) do
sh "\"#{RubyInstaller::BSD_TAR}\" -xf \"#{absolute_file}\" > NUL 2>&1"
sh "\"#{RubyInstaller::BSD_TAR}\" -xf \"#{absolute_file}\" > NUL 2>&1", &block
end
end
2 changes: 1 addition & 1 deletion recipes/dependencies/openssl.rake
Expand Up @@ -26,7 +26,7 @@ namespace(:dependencies) do
files = Rake::Task['dependencies:openssl:download'].prerequisites

files.each { |f|
extract(File.join(RubyInstaller::ROOT, f), package.target)
extract(File.join(RubyInstaller::ROOT, f), package.target, :noerror => true)
}
end

Expand Down

0 comments on commit 4908801

Please sign in to comment.