six-rsync 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/six/rsync/lib.rb +58 -43
- data/lib/six/rsync.rb +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/six/rsync/lib.rb
CHANGED
@@ -401,51 +401,66 @@ module Six
|
|
401
401
|
# direct unpack of gz into working folder
|
402
402
|
# Update file
|
403
403
|
if online
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
404
|
+
hosts = config[:hosts].clone
|
405
|
+
done = false
|
406
|
+
|
407
|
+
## Pack
|
408
|
+
if online
|
409
|
+
b = false
|
410
|
+
while hosts.size > 0 && !done do
|
411
|
+
# FIXME: Nasty
|
412
|
+
if b
|
413
|
+
host = hosts.sample
|
414
|
+
@logger.info "Trying #{host}"
|
415
|
+
end
|
416
|
+
b = true
|
417
|
+
hosts -= [host]
|
418
|
+
begin
|
419
|
+
# TODO: Progress bar
|
420
|
+
if mismatch.count > (@repos_remote[typ].count / 2)
|
421
|
+
@logger.info "Many files mismatched (#{mismatch.count}), running full update on .pack folder"
|
422
|
+
arr_opts = []
|
423
|
+
arr_opts << PARAMS
|
424
|
+
if host[/\A(\w)*\@/]
|
425
|
+
arr_opts << RSH
|
426
|
+
end
|
427
|
+
|
428
|
+
arr_opts << esc(File.join(host, '.pack/.'))
|
429
|
+
arr_opts << esc(pack_path)
|
430
|
+
command('', arr_opts)
|
431
|
+
else
|
432
|
+
c = mismatch.size
|
433
|
+
@logger.info "Fetching #{mismatch.size} files... Please wait"
|
434
|
+
slist = File.join(TOOLS_PATH, ".six-updater_#{rand 9999}-list")
|
435
|
+
File.open(slist, 'w') do |f|
|
436
|
+
mismatch.each { |e| f.puts e }
|
437
|
+
end
|
438
|
+
arr_opts = []
|
439
|
+
arr_opts << PARAMS
|
429
440
|
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
441
|
+
arr_opts << RSH if host[/\A(\w)*\@/]
|
442
|
+
|
443
|
+
slist = "\"#{slist}\""
|
444
|
+
|
445
|
+
while slist[WINDRIVE] do
|
446
|
+
drive = slist[WINDRIVE]
|
447
|
+
slist.gsub!(drive, "\"/cygdrive/#{$1}")
|
448
|
+
end
|
449
|
+
arr_opts << "--files-from=#{slist}"
|
450
|
+
|
451
|
+
arr_opts << esc(File.join(host, '.pack/.'))
|
452
|
+
arr_opts << esc(pack_path)
|
453
|
+
|
454
|
+
command('', arr_opts)
|
455
|
+
FileUtils.rm_f slist
|
456
|
+
end
|
457
|
+
done = true
|
458
|
+
rescue
|
459
|
+
@logger.warn "Failure"
|
460
|
+
@logger.debug "#{$!}"
|
461
|
+
end
|
447
462
|
end
|
448
|
-
|
463
|
+
@logger.warn "There was a problem during updating, please retry!" unless done
|
449
464
|
end
|
450
465
|
end
|
451
466
|
when :wd
|
data/lib/six/rsync.rb
CHANGED
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.
|
4
|
+
version: 0.2.2
|
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-
|
12
|
+
date: 2009-12-07 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|