module Dev module Cmd class DeepPull def self.execute puts "checking dependencies in #{DEV[:directory]}" # loop over each DEP with dir: NAME@REVISION format DEV[:dep].each {|key,value| if(value.has_key?(:dir) && value[:dir].include?('@')) # make sure working directory exist dep_wrk_dir="#{DEV[:dev_root]}/wrk/#{value[:dir].gsub(/@[\d]+/,'')}" dep_uri="#{value[:uri].gsub('@REV','')}" puts "#{dep_wrk_dir}" if(File.exists?(dep_wrk_dir)) Dir.chdir(dep_wrk_dir){|dir| call=Dev::SystemCall.new('svn update') call.puts_summary } else call=Dev::SystemCall.new("svn co #{dep_uri} #{dep_wrk_dir}") call.puts_summary end Dir.chdir(dep_wrk_dir){ |dir| original_text = File.read("#{dep_wrk_dir}/rakefile.rb") call=Dev::SystemCall.new('rake deep_pull') call.puts_summary current_text = File.read("#{dep_wrk_dir}/rakefile.rb") if(original_text != current_text) call=Dev::SystemCall.new('rake setup') call.puts_summary call=Dev::SystemCall.new('rake default') call.puts_summary end } end } # shallow pull in this puts "" Pull.execute end end # class DeepPull end # module Cmd end # module Dev