Skip to content

Commit bd2c72f

Browse files
committed
changed uzip to check for tbz2, and updated methods
this reflects what is tested and the library used, and should fix an incompatibility with Ubuntu 24.04
1 parent ca893f6 commit bd2c72f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/seek/content_type_detection.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def is_extractable_spreadsheet?(blob = self)
5656

5757
# is any zipped format, that can be extracted from
5858
def is_unzippable_datafile?(blob = self)
59-
blob.file_exists? && (is_zip?(blob)|| is_tar?(blob) || is_tgz?(blob) || is_tbz?(blob) || is_7zip?(blob) || is_txz?(blob))
59+
blob.file_exists? && (is_zip?(blob)|| is_tar?(blob) || is_tgz?(blob) || is_tbz2?(blob) || is_7zip?(blob) || is_txz?(blob))
6060
end
6161

6262
def is_in_simulatable_size_limit?(blob = self)
@@ -79,8 +79,8 @@ def is_tgz?(blob = self)
7979
blob.content_type_file_extensions.include?('tgz')
8080
end
8181

82-
def is_tbz?(blob = self)
83-
blob.content_type_file_extensions.include?('tbz')
82+
def is_tbz2?(blob = self)
83+
blob.content_type_file_extensions.include?('tbz2')
8484
end
8585

8686
def is_txz?(blob = self)

lib/seek/data_files/unzip.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def unzip(tmp_dir)
1111
unzip_zip(tmp_dir)
1212
elsif content_blob.is_tgz?
1313
unzip_tgz(tmp_dir)
14-
elsif content_blob.is_tbz?
15-
unzip_tbz(tmp_dir)
14+
elsif content_blob.is_tbz2?
15+
unzip_tbz2(tmp_dir)
1616
elsif content_blob.is_txz?
1717
unzip_txz(tmp_dir)
1818
elsif content_blob.is_tar?
@@ -35,7 +35,7 @@ def unzip_tar(tmp_dir, input = content_blob.filepath)
3535
Minitar.unpack(input, tmp_dir)
3636
end
3737

38-
def unzip_tbz(tmp_dir)
38+
def unzip_tbz2(tmp_dir)
3939
Tempfile.create('decompressed_tar') do |temp_tar|
4040
Bzip2::FFI::Reader.open(content_blob.filepath) do |reader|
4141
IO.copy_stream(reader, temp_tar)

0 commit comments

Comments
 (0)