Added support for xz-compressed packages

cron
Jef Roosens 2022-04-07 21:29:08 +02:00
parent 0bfe28dbc9
commit c3ac00f24d
Signed by untrusted user: Jef Roosens
GPG Key ID: B75D4F293C7052DB
2 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,9 @@ fn C.archive_read_support_filter_zstd(&C.archive)
// Configure the archive to work with gzip compression // Configure the archive to work with gzip compression
fn C.archive_read_support_filter_gzip(&C.archive) fn C.archive_read_support_filter_gzip(&C.archive)
// Configure the archive to work with xz compression
fn C.archive_read_support_filter_xz(&C.archive)
// Configure the archive to work with a tarball content // Configure the archive to work with a tarball content
fn C.archive_read_support_format_tar(&C.archive) fn C.archive_read_support_format_tar(&C.archive)

View File

@ -100,7 +100,7 @@ fn parse_pkg_info_string(pkg_info_str &string) ?PkgInfo {
} }
// read_pkg_archive extracts the file list & .PKGINFO contents from an archive // read_pkg_archive extracts the file list & .PKGINFO contents from an archive
// NOTE: this command only supports zstd- & gzip-compressed tarballs // NOTE: this command only supports zstd-, xz- & gzip-compressed tarballs.
pub fn read_pkg_archive(pkg_path string) ?Pkg { pub fn read_pkg_archive(pkg_path string) ?Pkg {
if !os.is_file(pkg_path) { if !os.is_file(pkg_path) {
return error("'$pkg_path' doesn't exist or isn't a file.") return error("'$pkg_path' doesn't exist or isn't a file.")
@ -112,6 +112,7 @@ pub fn read_pkg_archive(pkg_path string) ?Pkg {
// Sinds 2020, all newly built Arch packages use zstd // Sinds 2020, all newly built Arch packages use zstd
C.archive_read_support_filter_zstd(a) C.archive_read_support_filter_zstd(a)
C.archive_read_support_filter_gzip(a) C.archive_read_support_filter_gzip(a)
C.archive_read_support_filter_xz(a)
// The content should always be a tarball // The content should always be a tarball
C.archive_read_support_format_tar(a) C.archive_read_support_format_tar(a)