poise-archive 1.1.0 → 1.1.1

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: ed1a6f15b6ab1ebc7f37e710fb97e3eb57875c24
4
- data.tar.gz: 72373e0a9bc17188f4d551c5c682b271e4d3f0c3
3
+ metadata.gz: 91ccb73c49f6703d1836d4ea834300556e636022
4
+ data.tar.gz: 98c56241ab537943ca0a6e4b5e0c7490a0fb5fdf
5
5
  SHA512:
6
- metadata.gz: b40e2e071adb5e3bf1141ce6a28b06ac6ac18949c2f59eb7c3a0435dd55b8447eb98e6a3655d013be2725bda178cde72c0ab59144788e409a3ddb9ee982275b9
7
- data.tar.gz: 896dd2cc1d7344aebd8b10709522168ad57f5d385a4e8268772b4641a0f6293765f26e175cc5aa5de7332664fc89674f47b899e851a76d1f1beccdae798917db
6
+ metadata.gz: e3a403715a2874abda4d9382226b234dcacafb93799cdf5ff69b2b4a6c0e788134301fd9c4c51370462cc64a6441d4cfe91bdcbebdf7ba3844b72202ad47ebb7
7
+ data.tar.gz: 1cf28ee3de172108eebaf3e9f408c8245e846d8f2c98dac4da3c26894d24d1f5e6dc69c50bef2404871360783322635e5ba55a2e5051bfaee045d5efa83c3ba6
@@ -1,5 +1,9 @@
1
1
  # Poise-Archive Changelog
2
2
 
3
+ ## v1.1.1
4
+
5
+ * Fix GNU tar longlink extension.
6
+
3
7
  ## v1.1.0
4
8
 
5
9
  * Scrap the original tar implementation in favor of a 100% pure-Ruby solution.
@@ -47,14 +47,23 @@ module PoiseArchive
47
47
  #
48
48
  # @return [void]
49
49
  def unpack_tar
50
+ entry_name = nil
50
51
  tar_each do |entry|
51
- entry_name = if entry.full_name == TAR_LONGLINK
52
- entry.read.strip
53
- else
54
- entry.full_name
55
- end.split(/\//).drop(new_resource.strip_components).join('/')
56
- next if entry_name.empty?
57
- dest = ::File.join(new_resource.destination, entry_name)
52
+ if entry.full_name == TAR_LONGLINK
53
+ # Stash the longlink name so it will be used for the next entry.
54
+ entry_name = entry.read.strip
55
+ # And then skip forward because this isn't a real block.
56
+ next
57
+ end
58
+ # For entries not preceded by a longlink block, use the normal name.
59
+ entry_name ||= entry.full_name
60
+ # Process strip_components by mangling the name.
61
+ parsed_name = entry_name.split(/\//).drop(new_resource.strip_components).join('/')
62
+ # Reset entry_name for the next entry.
63
+ entry_name = nil
64
+ # If strip_components wiped out the name, don't process this entry.
65
+ next if parsed_name.empty?
66
+ dest = ::File.join(new_resource.destination, parsed_name)
58
67
  if entry.directory?
59
68
  Dir.mkdir(dest, entry.header.mode)
60
69
  elsif entry.file?
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module PoiseArchive
19
- VERSION = '1.1.0'
19
+ VERSION = '1.1.1'
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poise-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz