six-rsync 0.1.0 → 0.1.2
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.
- data/Rakefile +1 -1
- data/lib/six/rsync/lib.rb +8 -7
- data/lib/six/rsync.rb +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/six/rsync/lib.rb
CHANGED
@@ -110,7 +110,7 @@ module Six
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def update(cmd, x_opts = [], opts = {})
|
113
|
-
@logger.
|
113
|
+
@logger.debug "Checking for updates..."
|
114
114
|
@config = load_config
|
115
115
|
unless @config
|
116
116
|
@logger.error "Not an Rsync repository!"
|
@@ -126,9 +126,9 @@ module Six
|
|
126
126
|
|
127
127
|
# FIXME: This does not work when not forced, as host is sampled in comparesums :)
|
128
128
|
host = config[:hosts].sample
|
129
|
-
@logger.info "Trying: #{host}, please wait..."
|
130
129
|
|
131
130
|
if opts[:force]
|
131
|
+
@logger.info "Trying: #{host}, please wait..."
|
132
132
|
arr_opts = []
|
133
133
|
arr_opts << PARAMS
|
134
134
|
arr_opts += x_opts
|
@@ -232,7 +232,8 @@ module Six
|
|
232
232
|
@logger.info "Packing #{i}/#{@repos_local[:wd].size}: #{key}"
|
233
233
|
file = File.join(@rsync_work_dir, key)
|
234
234
|
file[REGEX_FOLDER]
|
235
|
-
folder = $
|
235
|
+
folder = $1
|
236
|
+
folder.gsub!(@rsync_work_dir, '')
|
236
237
|
gzip(file)
|
237
238
|
@repos_local[:pack]["#{key}.gz"] = md5("#{file}.gz")
|
238
239
|
FileUtils.mkdir_p pack_path(folder) if folder
|
@@ -445,11 +446,10 @@ module Six
|
|
445
446
|
b = false
|
446
447
|
while hosts.size > 0 && !done do
|
447
448
|
# FIXME: Nasty
|
448
|
-
if b
|
449
|
-
host = hosts.sample
|
450
|
-
end
|
449
|
+
host = hosts.sample if b
|
451
450
|
b = true
|
452
451
|
hosts -= [host]
|
452
|
+
@logger.info "Trying #{host}"
|
453
453
|
|
454
454
|
begin
|
455
455
|
verbose = @verbose
|
@@ -466,7 +466,7 @@ module Six
|
|
466
466
|
end
|
467
467
|
done = true
|
468
468
|
rescue
|
469
|
-
@logger.info "Failed
|
469
|
+
@logger.info "Failed!"
|
470
470
|
end
|
471
471
|
end
|
472
472
|
# TODO: CLEANUP, Should depricate in time.
|
@@ -533,6 +533,7 @@ module Six
|
|
533
533
|
end
|
534
534
|
|
535
535
|
def calc
|
536
|
+
@logger.info "Calculating checksums"
|
536
537
|
[:pack, :wd].each { |t| @repos_local[t] = calc_sums(t) }
|
537
538
|
end
|
538
539
|
|
data/lib/six/rsync.rb
CHANGED