miga-base 1.3.15.6 → 1.3.15.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miga/cli/action/db.rb +20 -5
- data/lib/miga/cli/action/env.rb +2 -2
- data/lib/miga/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfa29b8ed7a76baa9e4d4dd95f446894009cf94827ba2a21b9eb3c0f70e9ce7e
|
4
|
+
data.tar.gz: f62bf672f2cbd1ee8a6faf5d92c57585387d8b9178b870eaa0988b061f19640f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10c0c19433ae493b30d7891577d6f8550714f6dbacdb42ce5e52ef180a77d8c78bfe2f2c6675c440623eaeb9792f4bf81cddc7b98628d08016c2f9ff1e8f13c4
|
7
|
+
data.tar.gz: a56c23c70bdc95a1b2c3b2060dfc8b436accd206fe6e60af01401383ed736ee156b6b2a0eeed4e678c88ec1febeea17b96067b0657ce9ad9749509a9cca74d82
|
data/lib/miga/cli/action/db.rb
CHANGED
@@ -80,7 +80,7 @@ class MiGA::Cli::Action::Db < MiGA::Cli::Action
|
|
80
80
|
cli.puts "# Host: #{manif[:host]}"
|
81
81
|
cli.puts "# Manifest last update: #{manif[:last_update]}"
|
82
82
|
list_databases(manif) and return
|
83
|
-
db = db_requested(manif)
|
83
|
+
db_sym, db = db_requested(manif)
|
84
84
|
list_versions(db) and return
|
85
85
|
ver = version_requested(db)
|
86
86
|
check_target and return
|
@@ -88,7 +88,7 @@ class MiGA::Cli::Action::Db < MiGA::Cli::Action
|
|
88
88
|
# Download and expand
|
89
89
|
file = download_file(@ftp, ver[:path], cli[:reuse_archive])
|
90
90
|
check_digest(ver, file)
|
91
|
-
unarchive(file)
|
91
|
+
unarchive(file, db_sym.to_s)
|
92
92
|
register_database(manif, db, ver)
|
93
93
|
end
|
94
94
|
|
@@ -168,7 +168,7 @@ class MiGA::Cli::Action::Db < MiGA::Cli::Action
|
|
168
168
|
db = manif[:databases][cli[:database]]
|
169
169
|
raise 'Cannot find database in this host' if db.nil?
|
170
170
|
|
171
|
-
db
|
171
|
+
[cli[:database], db]
|
172
172
|
end
|
173
173
|
|
174
174
|
def version_requested(db)
|
@@ -240,13 +240,28 @@ class MiGA::Cli::Action::Db < MiGA::Cli::Action
|
|
240
240
|
cli.num_suffix(ver[:size_unarchived], true) + ')'
|
241
241
|
end
|
242
242
|
|
243
|
-
def unarchive(file)
|
243
|
+
def unarchive(file, db_name)
|
244
244
|
cli.say "Unarchiving #{file}"
|
245
|
+
tmp_archive = File.join(cli[:local], '.TMP_ARCHIVE')
|
246
|
+
FileUtils.mkdir_p(tmp_archive)
|
245
247
|
MiGA::MiGA.run_cmd <<~CMD
|
246
|
-
cd #{
|
248
|
+
cd #{tmp_archive.shellescape} \
|
247
249
|
&& tar -zxf #{file.shellescape} \
|
248
250
|
&& rm #{file.shellescape}
|
249
251
|
CMD
|
252
|
+
|
253
|
+
target = File.join(cli[:local], db_name)
|
254
|
+
source = File.join(tmp_archive, db_name)
|
255
|
+
if Dir.exist?(target)
|
256
|
+
cli.say 'Replacing previous version'
|
257
|
+
tmp = File.join(tmp_archive, "#{db_name}.old")
|
258
|
+
File.rename(target, tmp)
|
259
|
+
File.rename(source, target)
|
260
|
+
File.rm_rf(tmp)
|
261
|
+
else
|
262
|
+
File.rename(source, target)
|
263
|
+
end
|
264
|
+
Dir.unlink(tmp_archive) if Dir.empty?(tmp_archive)
|
250
265
|
end
|
251
266
|
|
252
267
|
def register_database(manif, db, ver)
|
data/lib/miga/cli/action/env.rb
CHANGED
@@ -10,8 +10,8 @@ class MiGA::Cli::Action::Env < MiGA::Cli::Action
|
|
10
10
|
|
11
11
|
def perform
|
12
12
|
puts <<~BASH
|
13
|
-
MIGA="#{MiGA::MiGA.root_path}"
|
14
|
-
MIGA_HOME=${MIGA_HOME:-"$HOME"}
|
13
|
+
export MIGA="#{MiGA::MiGA.root_path}"
|
14
|
+
export MIGA_HOME=${MIGA_HOME:-"$HOME"}
|
15
15
|
. "$MIGA_HOME/.miga_rc"
|
16
16
|
# Ensure MiGA & submodules are first in PATH
|
17
17
|
export PATH="$MIGA/bin:$PATH"
|
data/lib/miga/version.rb
CHANGED
@@ -12,7 +12,7 @@ module MiGA
|
|
12
12
|
# - String indicating release status:
|
13
13
|
# - rc* release candidate, not released as gem
|
14
14
|
# - [0-9]+ stable release, released as gem
|
15
|
-
VERSION = [1.3, 15,
|
15
|
+
VERSION = [1.3, 15, 7].freeze
|
16
16
|
|
17
17
|
##
|
18
18
|
# Nickname for the current major.minor version.
|
@@ -20,7 +20,7 @@ module MiGA
|
|
20
20
|
|
21
21
|
##
|
22
22
|
# Date of the current gem relese.
|
23
|
-
VERSION_DATE = Date.new(2024, 6,
|
23
|
+
VERSION_DATE = Date.new(2024, 6, 17)
|
24
24
|
|
25
25
|
##
|
26
26
|
# References of MiGA
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miga-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.15.
|
4
|
+
version: 1.3.15.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis M. Rodriguez-R
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|