six-rsync 0.2.2 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/lib/six/rsync/lib.rb +11 -22
  3. data/lib/six/rsync.rb +1 -1
  4. metadata +2 -2
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rake/testtask'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'six-rsync'
15
- s.version = '0.2.2'
15
+ s.version = '0.2.6'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
data/lib/six/rsync/lib.rb CHANGED
@@ -329,18 +329,18 @@ module Six
329
329
  host = config[:hosts].sample
330
330
 
331
331
  verfile_srv = File.join(".pack", ".repository.yml")
332
+ verbose = @verbose
333
+ @verbose = false
332
334
  begin
333
- verbose = @verbose
334
- @verbose = false
335
335
  fetch_file(verfile_srv, host)
336
- @verbose = verbose
337
336
  rescue
338
- @verbose = verbose
339
337
  # FIXME: Should never assume that :)
340
338
  @logger.warn "Unable to retrieve version file from server, repository probably doesnt exist!"
341
339
  @logger.debug "#{$!}"
342
340
  # raise RsyncExecuteError
343
341
  end
342
+ @verbose = verbose
343
+
344
344
  load_repos(:remote)
345
345
  if @repos_local[:version] < @repos_remote[:version] # && !force
346
346
  @logger.warn "WARNING, version on server is NEWER, aborting!"
@@ -495,6 +495,8 @@ module Six
495
495
  ## Pack
496
496
  if online
497
497
  b = false
498
+ verbose = @verbose
499
+ @verbose = false
498
500
  while hosts.size > 0 && !done do
499
501
  # FIXME: Nasty
500
502
  host = hosts.sample if b
@@ -503,10 +505,7 @@ module Six
503
505
  @logger.info "Trying #{host}"
504
506
 
505
507
  begin
506
- verbose = @verbose
507
- @verbose = false
508
508
  fetch_file(".pack/.repository.yml", host)
509
- @verbose = verbose
510
509
 
511
510
  load_repos(:remote)
512
511
  load_repos(:local)
@@ -520,12 +519,7 @@ module Six
520
519
  @logger.debug "#{$!}"
521
520
  end
522
521
  end
523
- # TODO: CLEANUP, Should depricate in time.
524
- if FileTest.exists? pack_path('.repository.yml')
525
- [pack_path('.version'), pack_path('.sums.yml'), File.join(@rsync_work_dir, '.sums.yml')].each do |f|
526
- FileUtils.rm_f f if FileTest.exists? f
527
- end
528
- end
522
+ @verbose = verbose
529
523
  end
530
524
  if done || online
531
525
  # TODO: Don't do actions when not online
@@ -612,9 +606,6 @@ module Six
612
606
  end
613
607
 
614
608
  def load_config
615
- # TODO: Remove after a while, depricated .pack
616
- old = File.join(@rsync_work_dir, '.pack')
617
- FileUtils.mv(old, pack_path) if FileTest.exists?(old)
618
609
  load_yaml(File.join(rsync_path, 'config.yml'))
619
610
  end
620
611
 
@@ -648,11 +639,6 @@ module Six
648
639
  config[:pack] = config[:pack].sort
649
640
  config[:wd] = config[:wd].sort
650
641
  File.open(file, 'w') { |file| file.puts config.to_yaml }
651
-
652
- # TODO: CLEANUP, Should depricate in time.
653
- [File.join(@rsync_work_dir, '.rsync/.version'), File.join(@rsync_work_dir, '.rsync/sums_pack.yml'), File.join(@rsync_work_dir, '.rsync/sums_wd.yml')].each do |f|
654
- FileUtils.rm_f f if FileTest.exists? f
655
- end
656
642
  end
657
643
 
658
644
  def load_repos(typ)
@@ -839,9 +825,12 @@ module Six
839
825
  # FIXME: This doesn't work with the new popen or is there a way?
840
826
  if s.exitstatus > 0
841
827
  @logger.debug "Exitstatus: #{s.exitstatus}"
842
- if (s.exitstatus == 1 && out.size == 0) || s.exitstatus == 5
828
+ if (s.exitstatus == 1 && out.size == 0)# || s.exitstatus == 5
843
829
  return ''
844
830
  end
831
+ if out.to_s =~ /max connections \((.*)\) reached/
832
+ @logger.warn "Server reached maximum connections."
833
+ end
845
834
  raise Rsync::RsyncExecuteError.new(rsync_cmd + ':' + out.to_s)
846
835
  end
847
836
  status
data/lib/six/rsync.rb CHANGED
@@ -30,7 +30,7 @@ module Six
30
30
  end
31
31
 
32
32
  module Rsync
33
- VERSION = '0.2.2'
33
+ VERSION = '0.2.6'
34
34
  TOOLS_PATH = File.join(BASE_PATH, 'tools')
35
35
  FOLDER = /(.*)\/(.*)/
36
36
  ENV['PATH'] = ENV['PATH'] + ";#{TOOLS_PATH};#{File.join(TOOLS_PATH, 'bin')}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six-rsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sickboy
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-07 00:00:00 +01:00
12
+ date: 2009-12-09 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15