six-updater 0.14.16 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/six/updater.rb +1 -1
- data/lib/six/updater/mod.rb +37 -17
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/six/updater.rb
CHANGED
data/lib/six/updater/mod.rb
CHANGED
@@ -36,6 +36,10 @@ module Six
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
def esc(val)
|
40
|
+
"\"#{val}\""
|
41
|
+
end
|
42
|
+
|
39
43
|
def get_repositories
|
40
44
|
cfg = File.join(@path, '.repositories.yml')
|
41
45
|
@repositories = if FileTest.exist?(cfg)
|
@@ -216,7 +220,7 @@ module Six
|
|
216
220
|
log.info "Found #{@folder_str}.7z, using it"
|
217
221
|
#Six::Updater.zipcheck
|
218
222
|
FileUtils.mkdir_p @path
|
219
|
-
cmd = "7z x -o
|
223
|
+
cmd = "7z x -o#{esc(@path)} #{esc(file)}"
|
220
224
|
log.debug cmd
|
221
225
|
output = %x[#{cmd}]
|
222
226
|
log.debug output
|
@@ -307,22 +311,31 @@ module Six
|
|
307
311
|
return
|
308
312
|
end
|
309
313
|
|
310
|
-
path = File.join(@path, 'keys')
|
314
|
+
path = File.join(@path, 'store', 'keys.tar')
|
315
|
+
path = File.join(@path, 'store', 'keys') unless File.exists?(path)
|
316
|
+
path = File.join(@path, 'keys') unless File.directory?(path)
|
311
317
|
if File.exists?(path)
|
312
318
|
log.info "Found keys, processing..."
|
313
319
|
k_path = File.join(@config[:app_path], 'keys')
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
if suffix
|
321
|
-
|
322
|
-
|
320
|
+
if File.directory? path
|
321
|
+
Dir[File.join(path, '*.bikey')].each do |key|
|
322
|
+
key[/(.*)\/(.*)/]
|
323
|
+
path, file = $1, $2
|
324
|
+
file[/(.*)_(.*)\.bikey/]
|
325
|
+
prefix, suffix = $1, $2
|
326
|
+
if suffix && prefix
|
327
|
+
if suffix[/(\D*)\d*/]
|
328
|
+
suf = $1
|
329
|
+
Dir[File.join(k_path, "#{prefix}_#{suf}*.bikey")].each { |delkey| FileUtils.rm_f(delkey) } if suf
|
330
|
+
end
|
323
331
|
end
|
332
|
+
FileUtils.cp(key, k_path)
|
324
333
|
end
|
325
|
-
|
334
|
+
else
|
335
|
+
# TODO: Cleanup old keys, Ruby Tar library, examine content? - tarruby doesn't build on 1.9.1. mingw
|
336
|
+
cmd = "7z x #{esc(path)} -o #{esc(@config[:app_path])}"
|
337
|
+
cmd.gsub!("/", "\\")
|
338
|
+
system cmd
|
326
339
|
end
|
327
340
|
end
|
328
341
|
end
|
@@ -342,8 +355,9 @@ module Six
|
|
342
355
|
time = Time.now.to_i
|
343
356
|
f = @modconfig[:folder].clone
|
344
357
|
f.gsub!('@', '')
|
345
|
-
path = File.join(@path, 'store', 'userconfig')
|
346
|
-
path = File.join(@path, 'userconfig') unless File.exists?(path)
|
358
|
+
path = File.join(@path, 'store', 'userconfig.tar')
|
359
|
+
path = File.join(@path, 'store', 'userconfig') unless File.exists?(path)
|
360
|
+
path = File.join(@path, 'userconfig') unless File.directory?(path)
|
347
361
|
if File.exists?(path)
|
348
362
|
uconfig = File.join(@config[:app_path], 'userconfig')
|
349
363
|
uconfigpath = File.join(uconfig, f)
|
@@ -352,9 +366,15 @@ module Six
|
|
352
366
|
return
|
353
367
|
end
|
354
368
|
log.info "Found userconfig, processing..."
|
355
|
-
FileUtils::mv(uconfigpath, "#{uconfigpath}_#{time}") if
|
356
|
-
|
357
|
-
|
369
|
+
FileUtils::mv(uconfigpath, "#{uconfigpath}_#{time}") if File.exists?(uconfigpath)
|
370
|
+
if File.directory? path
|
371
|
+
FileUtils::mkdir_p uconfig unless File.exists?(uconfig)
|
372
|
+
FileUtils::cp_r(path, uconfigpath)
|
373
|
+
else
|
374
|
+
cmd = "7z x #{esc(path)} -o #{esc(@config[:app_path])}"
|
375
|
+
cmd.gsub!("/", "\\")
|
376
|
+
system cmd
|
377
|
+
end
|
358
378
|
end
|
359
379
|
end
|
360
380
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: six-updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.1
|
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: 2010-02-
|
12
|
+
date: 2010-02-21 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|