devinstall 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 787f87b759b55152d2289690d13d252750959d10
4
- data.tar.gz: 2c7c82ab18b1a35b10e8ab1ad0843621c0e6b1ba
3
+ metadata.gz: 814187f402502bc1f4530dbe4c2a8b9ec8c24190
4
+ data.tar.gz: 9818041552ee6e73fbda4ed3e778e458472996e4
5
5
  SHA512:
6
- metadata.gz: 3da99d23d6bb38aac0a04839082e771df2aa69c819d4bd067ce32a9b6827c08a9dd796c3f677b1af7d4f07fbf2864808b9a63334d05422bc64bce4f0be3a89ae
7
- data.tar.gz: f4f01fb943d21cbe1e15b28c97fec5bafa5b38ecc44b35af6145a61cb4e5ceeeb3e0c36ca29d5c1e9d1d82308fe6ec0ca437ca4cdadb07a25d26a6adce216daa
6
+ metadata.gz: ad7dded5934b11adfb7715bb3c0cc0d97e4c758a509ff4f8b54d43b034641a356e796ea88219264882f3a8e59dd32ae9111234a7a6aa182e9aa29e81254399a3
7
+ data.tar.gz: 3468b12ee4269d3dd87ac3de83123b0d20b0403376e4a59a96dccdb098261e65d090521605c7b2713d2b8242f2667ac4cb47fa97c58a37016bab750daf35bf05
data/bin/pkg-tool CHANGED
@@ -3,11 +3,20 @@
3
3
  require 'devinstall/cli'
4
4
 
5
5
  command = ARGV.shift
6
+ package = ''
6
7
 
7
8
  unless %w"build install upload help version test".include? command
8
9
  puts "Unknown command #{command}"
9
10
  exit! 1
10
11
  end
11
- cli=Devinstall::Cli.new
12
+
13
+ ## the next should be the package
14
+ # so if ARGV[0] don't start with --
15
+ # we name it package
16
+ if ARGV[0][0..1] != '--'
17
+ package = ARGV.shift
18
+ end
19
+
20
+ cli=Devinstall::Cli.new(package)
12
21
  cli.send(command.to_sym)
13
22
 
@@ -14,7 +14,7 @@ module Devinstall
14
14
  @opt['config']
15
15
  end
16
16
 
17
- def initialize
17
+ def initialize(package)
18
18
  begin
19
19
  @opt = Getopt::Long.getopts(
20
20
  ['--package', '-p', Getopt::REQUIRED],
@@ -42,6 +42,9 @@ module Devinstall
42
42
  # complete from default values
43
43
  %w"package env type".each { |o| @opt[o] ||= Settings.defaults[o.to_sym] if Settings.defaults[o.to_sym] }
44
44
  # verify all informations
45
+ if package != '' # a packege was supplied on commandline
46
+ @opt['package'] = package # this overrides all
47
+ end
45
48
  %w"package type env".each do |k|
46
49
  unless @opt[k]
47
50
  puts "You must specify option '#{k}' either as default or in command line"
@@ -1,3 +1,3 @@
1
1
  module Devinstall
2
- VERSION = '0.2.5' # Small bugfixes
2
+ VERSION = '0.2.6' # Small bugfixes
3
3
  end
data/lib/devinstall.rb CHANGED
@@ -32,6 +32,11 @@ module Devinstall
32
32
  # @param [String] package
33
33
  def initialize (package)
34
34
  # curently implemented only for .deb packages (for .rpm later :D)
35
+ unless Settings.packages.has_key? package.to_sym
36
+ puts "You required an undefined package #{package}"
37
+ puts "Aborting!"
38
+ exit! 1
39
+ end
35
40
  @package = package.to_sym
36
41
  @_package_version = Hash.new # versions for types:
37
42
  @package_files = Hash.new
@@ -141,13 +146,18 @@ module Devinstall
141
146
  end
142
147
  install[k] = Settings.install[:environments][environment][k]
143
148
  end
149
+
150
+ install[:host] = [install[:host]] unless Array === install[:host]
151
+
144
152
  case type
145
- when :deb
146
- command("#{scp} #{local_temp}/#{@package_files[type][:deb]} #{install[:user]}@#{install[:host]}:#{install[:folder]}")
147
- command("#{sudo} #{install[:user]}@#{install[:host]} /usr/bin/dpkg -i #{install[:folder]}/#{@package_files[type][:deb]}")
148
- else
149
- puts "unknown package type '#{type.to_s}'"
150
- exit! 1
153
+ when :deb
154
+ install[:host].each do |host|
155
+ command("#{scp} #{local_temp}/#{@package_files[type][:deb]} #{install[:user]}@#{host}:#{install[:folder]}")
156
+ command("#{sudo} #{install[:user]}@#{host} /usr/bin/dpkg -i #{install[:folder]}/#{@package_files[type][:deb]}")
157
+ end
158
+ else
159
+ puts "unknown package type '#{type.to_s}'"
160
+ exit! 1
151
161
  end
152
162
  end
153
163
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devinstall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dragos Boca