Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/, eclass/tests/
Date: Tue, 27 Sep 2022 20:28:59
Message-Id: 1664310482.98bce41166f1a62c6a9b843db7e68a7efedd5742.mgorny@gentoo
1 commit: 98bce41166f1a62c6a9b843db7e68a7efedd5742
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 24 14:30:13 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 27 20:28:02 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98bce411
7
8 unpacker.eclass: Add support for .lz4 and .lzo compression
9
10 Add support for .lz4 and .lzo formats that can be used for .tar.gpkg
11 compression.
12
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 eclass/tests/unpacker.sh | 7 +++++++
16 eclass/unpacker.eclass | 8 ++++++++
17 2 files changed, 15 insertions(+)
18
19 diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh
20 index 7a297d61babd..1f2327054521 100755
21 --- a/eclass/tests/unpacker.sh
22 +++ b/eclass/tests/unpacker.sh
23 @@ -165,6 +165,8 @@ test_compressed_file .lzma lzma
24 test_compressed_file .xz xz
25 test_compressed_file .lz lzip
26 test_compressed_file .zst zstd
27 +test_compressed_file .lz4 lz4
28 +test_compressed_file .lzo lzop
29
30 test_compressed_file_multistream .bz2 bzip2
31 test_compressed_file_multistream .gz gzip
32 @@ -187,6 +189,8 @@ test_compressed_tar .tar.xz xz
33 test_compressed_tar .txz xz
34 test_compressed_tar .tar.lz lzip
35 test_compressed_tar .tar.zst zstd
36 +test_compressed_tar .tar.lz4 lz4
37 +test_compressed_tar .tar.lzo lzop
38
39 test_unpack test.cpio test.in cpio 'cpio -o --quiet <<<${TESTFILE} > ${archive}'
40 test_compressed_cpio .cpio.bz2 bzip2
41 @@ -196,6 +200,8 @@ test_compressed_cpio .cpio.lzma lzma
42 test_compressed_cpio .cpio.xz xz
43 test_compressed_cpio .cpio.lz lzip
44 test_compressed_cpio .cpio.zst zstd
45 +test_compressed_cpio .cpio.lz4 lz4
46 +test_compressed_cpio .cpio.lzo lzop
47
48 test_deb
49 test_deb .gz gzip
50 @@ -223,6 +229,7 @@ test_reject_junk .lz
51 test_reject_junk .zst
52 test_reject_junk .tar
53 test_reject_junk .cpio
54 +test_reject_junk .gpkg.tar
55 test_reject_junk .deb
56 test_reject_junk .zip
57 test_reject_junk .7z
58
59 diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
60 index 8fb1c2abd1cf..a64c5eae18aa 100644
61 --- a/eclass/unpacker.eclass
62 +++ b/eclass/unpacker.eclass
63 @@ -401,6 +401,10 @@ _unpacker_get_decompressor() {
64 echo "${UNPACKER_LZIP} -dc" ;;
65 *.zst)
66 echo "zstd -dc" ;;
67 + *.lz4)
68 + echo "lz4 -dc" ;;
69 + *.lzo)
70 + echo "lzop -dc" ;;
71 esac
72 }
73
74 @@ -535,6 +539,10 @@ unpacker_src_uri_depends() {
75 d="app-arch/zstd" ;;
76 *.lha|*.lzh)
77 d="app-arch/lha" ;;
78 + *.lz4)
79 + d="app-arch/lz4" ;;
80 + *.lzo)
81 + d="app-arch/lzop" ;;
82 esac
83 deps+=" ${d}"
84 done