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 --- data/doc/sisu/CHANGELOG_v3 | 4 ++++ lib/sisu/v3/sysenv.rb | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index b7099304..62ed8f67 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -22,6 +22,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.10.orig.tar.gz * copyright (minor) touch, dates for setup.rb + * sysenv, rsync, get rid of annoying new nag to terminal (-v reporting + Dir.pwd), prevent attempt to change directory unless different directory + requested + %% 3.0.9.orig.tar.gz (2011-05-17:20/2) http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/3.0.9-1 http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.9.orig.tar.gz 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