From f7bad422ac9a564e08ea3b25f43822eecce8faf2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 17 May 2011 23:00:31 -0400 Subject: v3: sysenv, rsync, get rid of annoying nag to terminal (-v reporting Dir.pwd) * prevent attempt to change directory unless different directory requested --- lib/sisu/v3/sysenv.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 5a59ebf8..127e4181 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -774,7 +774,7 @@ module SiSU_Env #? system("scp -Cr #{@input} #{@output}") \ #: (puts "\tWARN: #{program} not found" ) end - def rsync(action='',chdir='.') + def rsync(action='',chdir=nil) program='rsync' if program_found?(program) vb=if @cmd =~/q/; 'q' @@ -783,11 +783,17 @@ module SiSU_Env end msg='' msg=" && echo 'OK: #{@input} -> #{@output}'" unless @cmd =~/q/ - puts "rsync -az#{vb} #{action} #{@input} #{@output}" if @cmd =~/[vVM]/ + puts "rsync -az#{vb} #{action} #{@input} #{@output}" if @cmd =~/[vVM]/ + dir_change,dir_return='','' + if chdir \ + && chdir != Dir.pwd + dir_change="cd #{chdir}" + dir_return='cd -' + end system(" - cd #{chdir} + #{dir_change} rsync -az#{vb} #{action} #{@input} #{@output} #{msg} - cd - + #{dir_return} ") else puts "\tWARN: #{program} not found" end @@ -3818,7 +3824,7 @@ WOK "#{output_path.base.url}/po4a/#{@md.fnb}/pot" end def rcp - p "#{output_path.base.dir}/po4a/#{@md.fnb}/pot" + #p "#{output_path.base.dir}/po4a/#{@md.fnb}/pot" end self end -- cgit v1.2.3