public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 09/15] unpacker.eclass: Add support for .lz4 and .lzo compression
Date: Sun, 25 Sep 2022 20:23:11 +0200	[thread overview]
Message-ID: <20220925182317.1559529-10-mgorny@gentoo.org> (raw)
In-Reply-To: <20220925182317.1559529-1-mgorny@gentoo.org>

Add support for .lz4 and .lzo formats that can be used for .tar.gpkg
compression.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/tests/unpacker.sh | 7 +++++++
 eclass/unpacker.eclass   | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh
index af979b0e2995..60b651759a52 100755
--- a/eclass/tests/unpacker.sh
+++ b/eclass/tests/unpacker.sh
@@ -165,6 +165,8 @@ test_compressed_file .lzma lzma
 test_compressed_file .xz xz
 test_compressed_file .lz lzip
 test_compressed_file .zst zstd
+test_compressed_file .lz4 lz4
+test_compressed_file .lzo lzop
 
 test_compressed_file_multistream .bz2 bzip2
 test_compressed_file_multistream .gz gzip
@@ -187,6 +189,8 @@ test_compressed_tar .tar.xz xz
 test_compressed_tar .txz xz
 test_compressed_tar .tar.lz lzip
 test_compressed_tar .tar.zst zstd
+test_compressed_tar .tar.lz4 lz4
+test_compressed_tar .tar.lzo lzop
 
 test_unpack test.cpio test.in cpio 'cpio -o --quiet <<<${TESTFILE} > ${archive}'
 test_compressed_cpio .cpio.bz2 bzip2
@@ -196,6 +200,8 @@ test_compressed_cpio .cpio.lzma lzma
 test_compressed_cpio .cpio.xz xz
 test_compressed_cpio .cpio.lz lzip
 test_compressed_cpio .cpio.zst zstd
+test_compressed_cpio .cpio.lz4 lz4
+test_compressed_cpio .cpio.lzo lzop
 
 test_deb
 test_deb .gz gzip
@@ -223,6 +229,7 @@ test_reject_junk .lz
 test_reject_junk .zst
 test_reject_junk .tar
 test_reject_junk .cpio
+test_reject_junk .gpkg.tar
 test_reject_junk .deb
 test_reject_junk .zip
 test_reject_junk .7z
diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
index 8fb1c2abd1cf..a64c5eae18aa 100644
--- a/eclass/unpacker.eclass
+++ b/eclass/unpacker.eclass
@@ -401,6 +401,10 @@ _unpacker_get_decompressor() {
 		echo "${UNPACKER_LZIP} -dc" ;;
 	*.zst)
 		echo "zstd -dc" ;;
+	*.lz4)
+		echo "lz4 -dc" ;;
+	*.lzo)
+		echo "lzop -dc" ;;
 	esac
 }
 
@@ -535,6 +539,10 @@ unpacker_src_uri_depends() {
 			d="app-arch/zstd" ;;
 		*.lha|*.lzh)
 			d="app-arch/lha" ;;
+		*.lz4)
+			d="app-arch/lz4" ;;
+		*.lzo)
+			d="app-arch/lzop" ;;
 		esac
 		deps+=" ${d}"
 	done
-- 
2.37.3



  parent reply	other threads:[~2022-09-25 18:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 18:23 [gentoo-dev] [PATCH 00/15] unpacker.eclass: Tests, bugfixes and GPKG support Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 01/15] eclass/tests: Add tests for unpacker.eclass Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 02/15] unpacker.eclass: Remove `-f` from zstd arguments Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 03/15] unpacker.eclass: Fix unpack_7z to respect the exit status Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 04/15] unpacker.eclass: Remove support for EAPI 5 Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 05/15] unpacker.eclass: Use bash substitution instead of tr for lowercase Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 06/15] unpacker.eclass: Use lowercase in unpacker_src_uri_depends Michał Górny
2022-09-25 21:04   ` John Helmert III
2022-09-25 21:06     ` John Helmert III
2022-09-25 18:23 ` [gentoo-dev] [PATCH 07/15] unpacker.eclass: Remove uppercase RAR/LHA variants Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 08/15] unpacker.eclass: Move decompressor recognition into a function Michał Górny
2022-09-25 18:23 ` Michał Górny [this message]
2022-09-25 18:23 ` [gentoo-dev] [PATCH 10/15] unpacker.eclass: Add on-the-fly .gpkg.tar unpacking support Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 11/15] sys-kernel/gentoo-kernel-bin: Use unpacker.eclass for .gpkg.tar Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 12/15] unpacker.eclass: decompress xz in parallel Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 13/15] unpacker.eclass: Support lbzip2 as parallel bz2 decompressor Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 14/15] unpacker.eclass: Fix handling GNU ar archives in hand-weaved impl Michał Górny
2022-09-25 18:23 ` [gentoo-dev] [PATCH 15/15] unpacker.eclass: Unpack .deb packages on-the-fly as well Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220925182317.1559529-10-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox