mixlib-archive 1.0.1-universal-mingw32 → 1.1.4-universal-mingw32

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
  SHA256:
3
- metadata.gz: 3257be73a98527e13ed8c47c4c93b3aabe0d8444764646b38e8621cf755e3a1a
4
- data.tar.gz: 75ae3489c75b2d9c0214627b3fa8240c1312d2ed5a8359ec6df6d7c2e9cef225
3
+ metadata.gz: 047bea16a67fe85bed1e833d57984037118cff998cb203c40eb1e22c31cc4cbc
4
+ data.tar.gz: 48be81edf028239f70dc9523a6902d0078d97ca3478c1bb898285beb5a9cb225
5
5
  SHA512:
6
- metadata.gz: 52d96f21a49417c1b434c7297b3bfe512d1c05417a737aa51632bb9c80d3300dc6daf0d0ddf8ffd94fc52596d8105c44ec94afed52f48dda2a065486b64843dc
7
- data.tar.gz: '08158917b97540e807e3e32c1d7303267aba83523e94a002ce6782455cccbbfba6524fc3cbd69aae6e43dd2a1c4dcf2ea871bd4816ecd68c771815aa33c6b106'
6
+ metadata.gz: c594dc361aa18493eca90e0dd6381e6ae07b517fd86592f975929ff4d59ac2eb5b3601d83fc1982b2b3a1ee00347a726b68650627f96428afc6bed373fce9b6a
7
+ data.tar.gz: 03252431a3f5b09b64d2e98ba8c144c5536dc1ca9ad2e79de0cf012a0120cc1fa2bc39f9857854eec64ad6ed3dce880f9316ef13c04a6dbe4d606afb11a073a6
@@ -1,7 +1,7 @@
1
- require "mixlib/archive/tar"
2
- require "mixlib/archive/version"
1
+ require_relative "archive/tar"
2
+ require_relative "archive/version"
3
3
  require "mixlib/log"
4
- require "find"
4
+ require "find" unless defined?(Find.find)
5
5
 
6
6
  module Mixlib
7
7
  class Archive
@@ -21,7 +21,7 @@ module Mixlib
21
21
  archive = File.expand_path(archive)
22
22
  begin
23
23
  # we prefer to use libarchive, which supports a great big pile o' stuff
24
- require "mixlib/archive/lib_archive"
24
+ require_relative "archive/lib_archive"
25
25
  @archiver = Mixlib::Archive::LibArchive.new(archive)
26
26
  rescue LoadError
27
27
  # but if we can't use that, we'll fall back to ruby's native tar implementation
@@ -58,6 +58,7 @@ module Mixlib
58
58
  if @empty
59
59
  Dir.foreach(destination) do |entry|
60
60
  next if entry == "." || entry == ".."
61
+
61
62
  FileUtils.remove_entry_secure(File.join(destination, entry))
62
63
  end
63
64
  end
@@ -6,12 +6,6 @@ module Mixlib
6
6
  attr_reader :options
7
7
  attr_reader :archive
8
8
 
9
- class << self
10
- attr_accessor :mutex_chdir
11
- end
12
-
13
- Mixlib::Archive::LibArchive.mutex_chdir = Mutex.new
14
-
15
9
  def initialize(archive, options = {})
16
10
  @archive = archive
17
11
  @options = options
@@ -27,24 +21,17 @@ module Mixlib
27
21
  flags = perms ? ::Archive::EXTRACT_PERM : nil
28
22
  FileUtils.mkdir_p(destination)
29
23
 
30
- # @note Dir.chdir is applied to the process, thus it is not thread-safe
31
- # and must be synchronized.
32
- # TODO: figure out a better alternative to chdir
33
- Mixlib::Archive::LibArchive.mutex_chdir.synchronize do
34
- Dir.chdir(destination) do
35
- reader = ::Archive::Reader.open_filename(@archive)
24
+ reader = ::Archive::Reader.open_filename(@archive)
36
25
 
37
- reader.each_entry do |entry|
38
- if entry.pathname =~ ignore_re
39
- Mixlib::Archive::Log.warn "ignoring entry #{entry.pathname}"
40
- next
41
- end
42
-
43
- reader.extract(entry, flags.to_i)
44
- end
45
- reader.close
26
+ reader.each_entry do |entry|
27
+ if entry.pathname =~ ignore_re
28
+ Mixlib::Archive::Log.warn "ignoring entry #{entry.pathname}"
29
+ next
46
30
  end
31
+
32
+ reader.extract(entry, flags.to_i, destination: destination)
47
33
  end
34
+ reader.close
48
35
  end
49
36
 
50
37
  # Creates an archive with the given set of +files+
@@ -1,6 +1,6 @@
1
- require "rubygems/package"
2
- require "tempfile"
3
- require "zlib"
1
+ require "rubygems/package" unless defined?(Gem::Package)
2
+ require "tempfile" unless defined?(Tempfile)
3
+ require "zlib" unless defined?(Zlib)
4
4
 
5
5
  module Mixlib
6
6
  class Archive
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Archive
3
- VERSION = "1.0.1".freeze
3
+ VERSION = "1.1.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.4
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Chef Software, Inc
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-16 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -43,7 +43,7 @@ homepage: https://github.com/chef/mixlib-archive
43
43
  licenses:
44
44
  - Apache-2.0
45
45
  metadata: {}
46
- post_install_message:
46
+ post_install_message:
47
47
  rdoc_options: []
48
48
  require_paths:
49
49
  - lib
@@ -58,9 +58,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  requirements: []
61
- rubyforge_project:
62
- rubygems_version: 2.7.6
63
- signing_key:
61
+ rubygems_version: 3.1.4
62
+ signing_key:
64
63
  specification_version: 4
65
64
  summary: A simple interface to various archive formats
66
65
  test_files: []