omnizip 0.4.7-aarch64-linux → 0.4.9-aarch64-linux

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
  SHA256:
3
- metadata.gz: c655eea706e63ddd7cf6ffeb69ef16d39191b988f60ec8eda2a8954177e1be15
4
- data.tar.gz: c78c6afe538f10c0bb18b4354004a0deb8eb42486051f8b3ce5936cc4bb634ab
3
+ metadata.gz: d8dda150ae2f867c836cdaf71fb08d9a895db6583c363a3dede8f9aa5549f601
4
+ data.tar.gz: 805ee34ca07fa1b5bff34646aaff4a5b6143c014f8115a11142b8f0f5078cc6f
5
5
  SHA512:
6
- metadata.gz: af0140016851a2c0dddd0ef2ea64f294eb6fb184088a6805f74f912d70f4e2049c7fe01922b849418a09dd579deb61fa026580213aa18c493183a5e2e93505c0
7
- data.tar.gz: 1eba4eb9cad5b8cebef5af02439aac1877a350cee0b28b3a00b02129de6c0fc6f5334c38c85bb51343230ad577739c5eed78906f2dfa5520c9a4472864d7ed1c
6
+ metadata.gz: b2192f1763168ffd809c89e6bfff165a0ae0d8e117780d50ff3a451d585b2df7e0dc44dc5addc5d3c06829fe4581234b5d30d0d3c7e7422b83cc7a1faf6a8d2f
7
+ data.tar.gz: 01127467bf1af2100e6049bc0878afb8005cbc6f3f9a100528f9e5400cd289435cfb79987ad3c8ee0f60b0605f689b4e5961ecc7fd8677b5229cc3ba93ce1475
data/.rubocop_todo.yml CHANGED
@@ -140,6 +140,7 @@ Metrics/BlockLength:
140
140
  Max: 81
141
141
  Exclude:
142
142
  - "lib/tasks/platform_gems.rake"
143
+ - "spec/omnizip/archive_handlers/rust_tier_handlers_spec.rb"
143
144
 
144
145
  # Offense count: 5
145
146
  # Configuration parameters: CountBlocks, CountModifierForms.
data/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Fixed
11
+ - RPM archive-tier readiness: the dylib requirement is
12
+ **0.21.112**, not 0.21.111 — 0.21.111's `./`-stripping was half the
13
+ fix (the Ruby handler's names are ABSOLUTE, from the header's
14
+ DIRNAMES/BASENAMES; 0.21.112 normalizes the cpio names to
15
+ `/usr/…`). The tier spec version-guards accordingly, and with
16
+ 0.21.112 the rpm tier is fully active (list stays Ruby by design;
17
+ read_entry is accelerated). Ships with the rubocop exclusion for
18
+ the tier spec that a CI-skipped merge dropped.
19
+
20
+ ### Added
21
+ - Archive-level tier for every handler: tar, cpio, iso, xar, 7z and
22
+ rar3/4/5 (with `password:` passthrough) route list(names) and
23
+ read_entry through the cdylib's whole-archive surface, falling back
24
+ to the Ruby readers on any Rust error or a missing library. rpm
25
+ rides the tier for read_entry once the dylib is ≥ 0.21.111 (which
26
+ strips the cpio `./` prefix so its entry names match the Ruby
27
+ handler's); rpm list and OLE stay pure-Ruby — OLE is a pinned model
28
+ divergence (Ruby lists top-level entries, Rust flattens the storage
29
+ tree), documented in the capability matrix and pinned by the new
30
+ cross-implementation differential spec.
31
+
10
32
  ### Added
11
33
  - Prebuilt-binary distribution (parsanol model): platform gems
12
34
  (x86_64/aarch64/arm Linux glibc+musl, arm64/x86_64 macOS,
@@ -20,6 +20,11 @@ module Omnizip
20
20
  end
21
21
 
22
22
  def list(path, details: false, **_)
23
+ unless details
24
+ tier_names = Omnizip::Backends.archive_entry_names(path)
25
+ return tier_names if tier_names
26
+ end
27
+
23
28
  entries = Omnizip::Formats::Cpio.list(path)
24
29
  if details
25
30
  entries.map do |e|
@@ -32,6 +37,9 @@ module Omnizip
32
37
  end
33
38
 
34
39
  def read_entry(path, entry_name, **_)
40
+ tier = Omnizip::Backends.archive_read_entry(path, entry_name)
41
+ return tier unless tier.nil?
42
+
35
43
  entry = Omnizip::Formats::Cpio.list(path)
36
44
  .find { |e| e.name == entry_name }
37
45
  unless entry
@@ -20,6 +20,11 @@ module Omnizip
20
20
  end
21
21
 
22
22
  def list(path, details: false, **_)
23
+ unless details
24
+ tier_names = Omnizip::Backends.archive_entry_names(path)
25
+ return tier_names if tier_names
26
+ end
27
+
23
28
  entries = Omnizip::Formats::Iso.list(path)
24
29
  if details
25
30
  entries.map do |e|
@@ -32,6 +37,9 @@ module Omnizip
32
37
  end
33
38
 
34
39
  def read_entry(path, entry_name, **_)
40
+ tier = Omnizip::Backends.archive_read_entry(path, entry_name)
41
+ return tier unless tier.nil?
42
+
35
43
  entry = Omnizip::Formats::Iso.list(path)
36
44
  .find { |e| e.full_path == entry_name }
37
45
  unless entry
@@ -29,6 +29,11 @@ module Omnizip
29
29
  end
30
30
 
31
31
  def list(path, details: false, **_)
32
+ unless details
33
+ tier_names = Omnizip::Backends.archive_entry_names(path)
34
+ return tier_names if tier_names
35
+ end
36
+
32
37
  reader = Omnizip::Formats::Rar::Reader.new(path).open
33
38
  entries = reader.list_files
34
39
  if details
@@ -43,6 +48,9 @@ module Omnizip
43
48
  end
44
49
 
45
50
  def read_entry(path, entry_name, password: nil, **_)
51
+ tier = Omnizip::Backends.archive_read_entry(path, entry_name, password: password)
52
+ return tier unless tier.nil?
53
+
46
54
  Dir.mktmpdir("omnizip-rar-entry") do |dir|
47
55
  dest = File.join(dir, "entry")
48
56
  Omnizip::Formats::Rar::Decompressor.extract_entry(
@@ -29,6 +29,9 @@ module Omnizip
29
29
  end
30
30
 
31
31
  def read_entry(path, entry_name, **_)
32
+ tier = Omnizip::Backends.archive_read_entry(path, entry_name)
33
+ return tier unless tier.nil?
34
+
32
35
  Dir.mktmpdir("omnizip-rpm-entry") do |dir|
33
36
  Omnizip::Formats::Rpm.extract(path, dir)
34
37
  dest = File.join(dir, entry_name)
@@ -25,6 +25,11 @@ module Omnizip
25
25
  end
26
26
 
27
27
  def list(path, details: false, **options)
28
+ unless details
29
+ tier_names = Omnizip::Backends.archive_entry_names(path, password: options[:password])
30
+ return tier_names if tier_names
31
+ end
32
+
28
33
  with_reader(path, options) do |reader|
29
34
  entries = reader.list_files
30
35
  if details
@@ -40,6 +45,9 @@ module Omnizip
40
45
  end
41
46
 
42
47
  def read_entry(path, entry_name, **options)
48
+ tier = Omnizip::Backends.archive_read_entry(path, entry_name, password: options[:password])
49
+ return tier unless tier.nil?
50
+
43
51
  with_reader(path, options) do |reader|
44
52
  entry = reader.list_files.find { |e| e.name == entry_name }
45
53
  raise Errno::ENOENT, "Entry not found: #{entry_name}" unless entry
@@ -22,6 +22,11 @@ module Omnizip
22
22
  end
23
23
 
24
24
  def list(path, details: false, **_)
25
+ unless details
26
+ tier_names = Omnizip::Backends.archive_entry_names(path)
27
+ return tier_names if tier_names
28
+ end
29
+
25
30
  entries = Omnizip::Formats::Tar.list(path)
26
31
  if details
27
32
  entries.map do |entry|
@@ -58,7 +63,10 @@ module Omnizip
58
63
  end
59
64
  end
60
65
 
61
- def read_entry(path, entry_name)
66
+ def read_entry(path, entry_name, **_)
67
+ tier = Omnizip::Backends.archive_read_entry(path, entry_name)
68
+ return tier unless tier.nil?
69
+
62
70
  data = nil
63
71
  Omnizip::Formats::Tar.open(path) do |reader|
64
72
  entry = reader.entries.find { |e| e.name == entry_name }
@@ -21,6 +21,11 @@ module Omnizip
21
21
  end
22
22
 
23
23
  def list(path, details: false, **_)
24
+ unless details
25
+ tier_names = Omnizip::Backends.archive_entry_names(path)
26
+ return tier_names if tier_names
27
+ end
28
+
24
29
  entries = Omnizip::Formats::Xar.list(path)
25
30
  if details
26
31
  entries.map do |e|
@@ -33,6 +38,9 @@ module Omnizip
33
38
  end
34
39
 
35
40
  def read_entry(path, entry_name, **_)
41
+ tier = Omnizip::Backends.archive_read_entry(path, entry_name)
42
+ return tier unless tier.nil?
43
+
36
44
  Dir.mktmpdir("omnizip-xar-entry") do |dir|
37
45
  Omnizip::Formats::Xar.extract(path, dir)
38
46
  dest = File.join(dir, entry_name)
@@ -96,15 +96,18 @@ module Omnizip
96
96
 
97
97
  # Whole-archive tier helpers: nil means "Rust unavailable or
98
98
  # entry not found — caller falls back to the Ruby reader".
99
- def archive_entry_names(path)
100
- Omnizip::Implementations::Rust::Archive.open(File.binread(path)) { |a| return a.entry_names }
99
+ # Encrypted formats (rar, 7z) pass password:.
100
+ def archive_entry_names(path, password: nil)
101
+ Omnizip::Implementations::Rust::Archive.open(File.binread(path), password: password) do |a|
102
+ return a.entry_names
103
+ end
101
104
  rescue Omnizip::Implementations::Rust::Archive::LibraryMissing, Omnizip::Implementations::Rust::Error, StandardError
102
105
  nil
103
106
  end
104
107
 
105
108
  # rubocop:disable-next Lint/ReturnInVoidContext
106
- def archive_read_entry(path, entry_name)
107
- Omnizip::Implementations::Rust::Archive.open(File.binread(path)) do |a|
109
+ def archive_read_entry(path, entry_name, password: nil)
110
+ Omnizip::Implementations::Rust::Archive.open(File.binread(path), password: password) do |a|
108
111
  idx = a.entry_names.index(entry_name)
109
112
  return nil if idx.nil?
110
113
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Omnizip
4
- VERSION = "0.4.7"
4
+ VERSION = "0.4.9"
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnizip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.9
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.