appbundle-updater 0.2.2 → 0.2.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5890c1c5cd9b4cec6094ab1bd3ecaf17e9c5d8e4
4
- data.tar.gz: 99409df42e6b1967180fcefa47c377485cc64826
3
+ metadata.gz: dfcacfbb727241b71f679cd6d73822845d46678a
4
+ data.tar.gz: 2e73c75ef74df6d2ce735199ec6069eb97421362
5
5
  SHA512:
6
- metadata.gz: 75fddef196538706740fe4a70851dd6acbe71d12201e0047d487c492ad4eefa13c975a4c62ad7969e4862885aef1c78f363c81dda374f16fba25c4fd837a5958
7
- data.tar.gz: 682e150d1d33c6a9973bab2f6e253b63fb6fce498f9a0d90ee36835f62f22f5bd33dc1fa7e03065672ba5bc3db07ebe8975619c1fa09b941c2ae7b7d560beada
6
+ metadata.gz: b35f3f5574fd2e4db0b4298fd4e2380eec65098107f9922c96bbe09fced2bafaf5a56fb564180e9f118bc0f0ff12384e562ebb67ee4da2ada39d4c83d9cec4aa
7
+ data.tar.gz: c9ccff22e84a8e3f6704d576234f60b29f9c997a0044c3cfe37de2f281124d3920e30ca70d3bae94f142dbe4d3aa96f279fc898dd886750f7d201b1d3013cafe
@@ -1,5 +1,20 @@
1
1
  # Change Log
2
2
 
3
+ ## [Unreleased](https://github.com/chef/appbundle-updater/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/chef/appbundle-updater/compare/v0.2.2...HEAD)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - fix windows via using tar.exe [\#8](https://github.com/chef/appbundle-updater/pull/8) ([lamont-granquist](https://github.com/lamont-granquist))
10
+
11
+ ## [v0.2.2](https://github.com/chef/appbundle-updater/tree/v0.2.2) (2015-09-25)
12
+ [Full Changelog](https://github.com/chef/appbundle-updater/compare/v0.2.1...v0.2.2)
13
+
14
+ **Merged pull requests:**
15
+
16
+ - fixing syntax error \(derp\) [\#7](https://github.com/chef/appbundle-updater/pull/7) ([lamont-granquist](https://github.com/lamont-granquist))
17
+
3
18
  ## [v0.2.1](https://github.com/chef/appbundle-updater/tree/v0.2.1) (2015-09-25)
4
19
  [Full Changelog](https://github.com/chef/appbundle-updater/compare/v0.2.0...v0.2.1)
5
20
 
@@ -43,11 +43,41 @@ def bin_dir
43
43
  chefdk.join("embedded/bin")
44
44
  end
45
45
 
46
+ ENV_KEYS = %w[
47
+ BUNDLE_BIN_PATH BUNDLE_GEMFILE GEM_HOME GEM_PATH GEM_ROOT IRBRC MY_RUBY_HOME RUBYLIB RUBYOPT RUBY_ENGINE RUBY_ROOT RUBY_VERSION _ORIGINAL_GEM_PATH PATH
48
+ ].freeze
49
+
50
+ def run(cmd)
51
+ ENV_KEYS.each { |key| ENV["_YOLO_#{key}"] = ENV[key]; ENV.delete(key) }
52
+ ENV['PATH'] = bin_dir.to_s + File::PATH_SEPARATOR + ENV['_YOLO_PATH']
53
+ puts " running: #{cmd}"
54
+ output = `#{cmd} 2>&1` #FIXME: bash/zsh-ism, will not work on csh
55
+ unless $?.exited? && $?.exitstatus == 0
56
+ raise("Command [#{cmd}] failed!\n\n---BEGIN OUTPUT--\n#{output}\n---END OUTPUT--\n")
57
+ end
58
+ ENV_KEYS.each { |key| ENV[key] = ENV.delete("_YOLO_#{key}") }
59
+ end
60
+
46
61
  TAR_LONGLINK = '././@LongLink'
47
62
 
63
+ def extract_tgz(file, destination = '.')
64
+ if windows?
65
+ extract_tgz_windows(file, destination)
66
+ else
67
+ extract_tgz_unix(file, destination)
68
+ end
69
+ end
70
+
71
+ # our windows omnibus packages all are guaranteed to have tar
72
+ def extract_tgz_windows(file, destination = '.')
73
+ Dir.chdir(app_dir) do
74
+ run("tar xf #{file} --directory #{destination}")
75
+ end
76
+ end
77
+
48
78
  # pure ruby `tar xzf`, handles longlinks and directories ending in '/'
49
79
  # (http://stackoverflow.com/a/31310593/506908)
50
- def extract_tgz(file, destination = '.')
80
+ def extract_tgz_unix(file, destination = '.')
51
81
  # NOTE: THIS IS DELIBERATELY PURE RUBY USING NO NATIVE GEMS AND ONLY
52
82
  # THE RUBY STDLIB BY DESIGN
53
83
  Gem::Package::TarReader.new( Zlib::GzipReader.open file ) do |tar|
@@ -194,9 +224,6 @@ class Updater
194
224
  end
195
225
 
196
226
  private
197
- ENV_KEYS = %w[
198
- BUNDLE_BIN_PATH BUNDLE_GEMFILE GEM_HOME GEM_PATH GEM_ROOT IRBRC MY_RUBY_HOME RUBYLIB RUBYOPT RUBY_ENGINE RUBY_ROOT RUBY_VERSION _ORIGINAL_GEM_PATH PATH
199
- ].freeze
200
227
 
201
228
  def app_dir
202
229
  chefdk.join("embedded/apps/#{app}")
@@ -212,17 +239,6 @@ class Updater
212
239
  run([ruby, script].join(" "))
213
240
  end
214
241
 
215
- def run(cmd)
216
- ENV_KEYS.each { |key| ENV["_YOLO_#{key}"] = ENV[key]; ENV.delete(key) }
217
- ENV['PATH'] = bin_dir.to_s + File::PATH_SEPARATOR + ENV['_YOLO_PATH']
218
- puts " running: #{cmd}"
219
- output = `#{cmd} 2>&1` #FIXME: bash/zsh-ism, will not work on csh
220
- unless $?.exited? && $?.exitstatus == 0
221
- raise("Command [#{cmd}] failed!\n\n---BEGIN OUTPUT--\n#{output}\n---END OUTPUT--\n")
222
- end
223
- ENV_KEYS.each { |key| ENV[key] = ENV.delete("_YOLO_#{key}") }
224
- end
225
-
226
242
  end
227
243
 
228
244
  class CLI
@@ -1,3 +1,3 @@
1
1
  module AppbundleUpdater
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appbundle-updater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - lamont-granquist
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-25 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Updates appbundled apps in Chef's omnibus packages
14
14
  email: