Skip to content

Commit

Permalink
Added MD5_COMMAND option. Fixes issue dcrec1#26
Browse files Browse the repository at this point in the history
…so you can run rake `solr:download MD5_COMMAND="md5"` on OS X for example
  • Loading branch information
laurens committed Aug 11, 2012
1 parent 2ca97ff commit 961c892
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tasks/solr.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace :solr do
SOLR_VERSION = '3.6.0'
SOLR_FILENAME = "apache-solr-#{SOLR_VERSION}.tgz"
SOLR_MD5SUM = 'ac11ef4408bb015aa3a5eefcb1047aec'
MD5_COMMAND = ENV['MD5_COMMAND'] || "md5sum -c -"
SOLR_URL = "#{APACHE_MIRROR}/lucene/solr/#{SOLR_VERSION}/#{SOLR_FILENAME}"
SOLR_DIR = "apache-solr-#{SOLR_VERSION}"

Expand All @@ -21,7 +22,7 @@ namespace :solr do
Dir.chdir '/tmp' do
sh "wget -c #{SOLR_URL}"

sh "echo \"#{SOLR_MD5SUM} /tmp/#{SOLR_FILENAME}\" | md5sum -c -" do |ok, res|
sh "echo \"#{SOLR_MD5SUM} /tmp/#{SOLR_FILENAME}\" | #{MD5_COMMAND}" do |ok, res|
abort "MD5SUM do not match" if !ok

sh "tar xzf apache-solr-#{SOLR_VERSION}.tgz"
Expand Down

0 comments on commit 961c892

Please sign in to comment.