diff options
| author | Ralph Amissah <ralph@amissah.com> | 2011-05-17 23:00:31 -0400 | 
|---|---|---|
| committer | Ralph Amissah <ralph@amissah.com> | 2011-05-17 23:03:01 -0400 | 
| commit | f7bad422ac9a564e08ea3b25f43822eecce8faf2 (patch) | |
| tree | 33de0e16dd65b218f89814bc29cbab1e2ecc3b1c /lib | |
| parent | v2 v3: 2.9.5 & 3.0.10 version & changelog "opened"; copyright touch (diff) | |
v3: sysenv, rsync, get rid of annoying nag to terminal (-v reporting Dir.pwd)
* prevent attempt to change directory unless different directory requested
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sisu/v3/sysenv.rb | 16 | 
1 files changed, 11 insertions, 5 deletions
| 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 | 
