Kinda fixing rake to at least only download once

This commit is contained in:
Dan Buch 2012-11-19 08:45:55 -05:00
parent 5500be5264
commit 351a7dc5ba

View File

@ -5,11 +5,11 @@ RMQV = '2.8.7'
directory './tmp'
file "./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz" => ['./tmp'] do |f|
file "./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz" => ['./tmp'] do |t|
puts "*** Downloading tarball"
open("#{RMQ_URI_BASE}/v#{RMQV}/rabbitmq-java-client-bin-#{RMQV}.tar.gz") do |f|
open('./tmp/rabbitmq-java-client-bin.tar.gz', 'w') do |out|
out.write(f.read)
open("#{RMQ_URI_BASE}/v#{RMQV}/rabbitmq-java-client-bin-#{RMQV}.tar.gz") do |dl|
open(t.name, 'w') do |out|
out.write(dl.read)
end
end
end
@ -18,8 +18,7 @@ file "./tmp/rabbitmq-java-client-bin-#{RMQV}/rabbitmq-client.jar" =>
["./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz"] do
puts "*** Extracting tarball"
Dir.chdir('./tmp') do
`tar xzvf rabbitmq-java-client-bin.tar.gz`
puts "*** Extracted, exit code = #{$?}"
sh "tar xzvf rabbitmq-java-client-bin-#{RMQV}.tar.gz"
end
end