From c3ac00f24d930e2db9c4b122cf3c9f34dc2e05e2 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Thu, 7 Apr 2022 21:29:08 +0200 Subject: [PATCH] Added support for xz-compressed packages --- src/archive.c.v | 3 +++ src/package.v | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/archive.c.v b/src/archive.c.v index 8d1314fd..1f0d1dd5 100644 --- a/src/archive.c.v +++ b/src/archive.c.v @@ -15,6 +15,9 @@ fn C.archive_read_support_filter_zstd(&C.archive) // Configure the archive to work with gzip compression 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 fn C.archive_read_support_format_tar(&C.archive) diff --git a/src/package.v b/src/package.v index 8bd30d04..41251a6c 100644 --- a/src/package.v +++ b/src/package.v @@ -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 -// 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 { if !os.is_file(pkg_path) { 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 C.archive_read_support_filter_zstd(a) C.archive_read_support_filter_gzip(a) + C.archive_read_support_filter_xz(a) // The content should always be a tarball C.archive_read_support_format_tar(a)