From b8b389267e75c064503cfe772831b68444b413b0 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Thu, 8 Oct 2015 19:31:23 -0300 Subject: [PATCH] check dependencies; requires chake >= 0.10 --- Rakefile | 6 +++--- tasks/dependencies.rake | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 tasks/dependencies.rake diff --git a/Rakefile b/Rakefile index bad4894..83be36a 100644 --- a/Rakefile +++ b/Rakefile @@ -49,8 +49,8 @@ end require 'chake' -if Gem::Version.new(Chake::VERSION) < Gem::Version.new('0.7') - fail "Please upgrade to chake 0.7+" +if Gem::Version.new(Chake::VERSION) < Gem::Version.new('0.10') + fail "Please upgrade to chake 0.10+" end ips ||= YAML.load_file(ips_file) @@ -137,7 +137,7 @@ namespace :export_data do end end -task :bootstrap_common => 'config/local/ssh_config' +task :bootstrap_common => :check_dependencies unless ENV['nodeps'] task 'converge:integration' => 'converge:database' diff --git a/tasks/dependencies.rake b/tasks/dependencies.rake new file mode 100644 index 0000000..eca78e8 --- /dev/null +++ b/tasks/dependencies.rake @@ -0,0 +1,12 @@ +task :check_dependencies do + missing = [ + { program: 'sphinx-build', package: 'python-sphinx' }, + { program: 'make', package: 'make' }, + ].select do |dependency| + !system("which #{dependency[:program]} >/dev/null") + end + missing.each do |dependency| + puts "Please install package #{dependency[:package]}" + end + fail 'E: missing dependencies' if missing.size > 0 +end -- libgit2 0.21.2