Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
PATH
remote: .
specs:
repomd_parser (1.2.0)
bzip2-ffi (~> 1.1.1)
nokogiri (~> 1.8)
ruby-xz (~> 1.0, >= 1.0.3)
zstd-ruby (~> 1.3, >= 1.3.5.0)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.3)
bzip2-ffi (1.1.1)
ffi (~> 1.0)
diff-lcs (1.6.2)
docile (1.4.1)
ffi (1.17.2-aarch64-linux-gnu)
ffi (1.17.2-aarch64-linux-musl)
ffi (1.17.2-arm-linux-gnu)
ffi (1.17.2-arm-linux-musl)
ffi (1.17.2-arm64-darwin)
ffi (1.17.2-x86_64-darwin)
ffi (1.17.2-x86_64-linux-gnu)
ffi (1.17.2-x86_64-linux-musl)
json (2.16.0)
nokogiri (1.18.10-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.10-aarch64-linux-musl)
racc (~> 1.4)
nokogiri (1.18.10-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.10-arm-linux-musl)
racc (~> 1.4)
nokogiri (1.18.10-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-linux-musl)
racc (~> 1.4)
parallel (1.27.0)
parser (3.3.10.0)
ast (~> 2.4.1)
racc
racc (1.8.1)
rainbow (3.1.1)
rake (13.3.1)
regexp_parser (2.11.3)
rexml (3.4.4)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.7)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.6)
rubocop (1.25.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.17.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.13.0)
ruby-xz (1.0.3)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
unicode-display_width (2.6.0)
zstd-ruby (1.5.7.1)

PLATFORMS
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
bundler (>= 1.16)
rake (~> 13.0)
repomd_parser!
rspec (~> 3.0)
rubocop (<= 1.25)
rubocop-ast (<= 1.17.0)
simplecov (~> 0.16.1)

BUNDLED WITH
2.6.2
2 changes: 2 additions & 0 deletions lib/repomd_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@

require 'zlib'
require 'bzip2/ffi'
require 'xz'

module RepomdParser
def self.decompress_io(io_object, filename)
case File.extname(filename)
when '.gz' then Zlib::GzipReader.new(io_object)
when '.zst' then RepomdParser::ZstdReader.new(io_object)
when '.bz2' then Bzip2::FFI::Reader.open(io_object)
when '.xz' then XZ::StreamReader.open(io_object)
else io_object
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/repomd_parser/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

module RepomdParser
VERSION = '1.1.0'.freeze
VERSION = '1.2.0'.freeze
end
1 change: 1 addition & 0 deletions repomd_parser.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
spec.add_dependency 'bzip2-ffi', '~> 1.1.1'
spec.add_dependency 'nokogiri', '~> 1.8'
spec.add_dependency 'zstd-ruby', '~> 1.3', '>= 1.3.5.0'
spec.add_dependency 'ruby-xz', ' ~>1.0', '>= 1.0.3'
end
Binary file not shown.
13 changes: 13 additions & 0 deletions spec/lib/repomd_parser/primary_xml_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@
expect(parsed_files).to eq(expected_result)
end
end
context 'XML compressed with XZ' do
let(:parsed_files) do
described_class.new.parse_file(
file_fixture(
'dummy_repo/repodata/abf421e45af5cd686f050bab3d2a98e0a60d1b5ca3b07c86cb948fc1abfa675e-primary.xml.xz'
)
)
end

it 'references rpm files' do
expect(parsed_files).to eq(expected_result)
end
end

context 'plain XML' do
let(:parsed_files) do
Expand Down
Loading