Mike,
Thank you for your reply!

вс, 20 дек. 2020 г. в 18:29, Mike Gilbert <flop...@gentoo.org>:

> I like the idea, but there are some problems with the execution.
>
> However, I would rather not comment on the patch via some random github 
> overlay.
>
> Here are some better ways you can contribute:
>
> 1. Send your patch as an email to this mailing list using git
> format-patch and git send-email.

I created a patch via `git format-patch -1 -o <path>'
But I haven't been able to configure git send-email... It seems that
it is not very straightforward: [1]...
So, I'm attaching the patch to this e-mail.

> 2. Open a bug report and attach your patch.

Did it:
https://bugs.gentoo.org/760905

> 3. Open a pull request against the Gentoo repo here:
> https://github.com/gentoo/gentoo.

Did it: (following the instructions on [2] until "Then create a pull request")
https://github.com/gentoo/gentoo/pull/18738


[1] https://flameeyes.blog/2017/07/30/why-is-git-send-email-so-awful-in-2017/
[2] https://wiki.gentoo.org/wiki/GitHub_Pull_Requests

-- 
Best regards,
Alex
From 53c8b275cab3b1213268bde10c9705dabd4c0e63 Mon Sep 17 00:00:00 2001
From: halcon74 <hal...@tuta.io>
Date: Sun, 20 Dec 2020 19:36:57 +0300
Subject: [PATCH] add zst support

---
 eclass/unpacker.eclass | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
index 63aedee4480..c8981601822 100644
--- a/eclass/unpacker.eclass
+++ b/eclass/unpacker.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: unpacker.eclass
@@ -33,7 +33,7 @@ inherit toolchain-funcs
 # `plzip`, `pdlzip` and `lzip`.  Make sure your choice accepts the "-dc" options.
 # Note: this is meant for users to set, not ebuilds.
 
-# for internal use only (unpack_pdv and unpack_makeself)
+# for internal use only (unpack_pdv, unpack_makeself and unpack_zst)
 find_unpackable_file() {
 	local src=$1
 	if [[ -z ${src} ]] ; then
@@ -327,6 +327,21 @@ unpack_zip() {
 	[[ $? -le 1 ]] || die "unpacking ${zip} failed (arch=unpack_zip)"
 }
 
+# @FUNCTION: unpack_zst
+# @USAGE: <zst file>
+# @DESCRIPTION:
+# Unpack zst archives.
+unpack_zst() {
+	[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
+
+	local zst=$(find_unpackable_file "$1")
+	unpack_banner "${zst}"
+	zstd -df "${zst}" -o "${P}.tar"
+	tar -xpf "${P}.tar" -C "${WORKDIR}"
+
+	[[ $? -le 1 ]] || die "unpacking ${zst} failed (arch=unpack_zst)"
+}
+
 # @FUNCTION: _unpacker
 # @USAGE: <one archive to unpack>
 # @INTERNAL
@@ -356,6 +371,8 @@ _unpacker() {
 	*.lz)
 		: ${UNPACKER_LZIP:=$(type -P plzip || type -P pdlzip || type -P lzip)}
 		comp="${UNPACKER_LZIP} -dc" ;;
+	*.zst)
+		comp="zstd -df" ;;
 	esac
 
 	# then figure out if there are any archiving aspects
@@ -383,6 +400,8 @@ _unpacker() {
 		;;
 	*.zip)
 		arch="unpack_zip" ;;
+	*.zst)
+		arch="unpack_zst" ;;
 	esac
 
 	# finally do the unpack
@@ -459,6 +478,8 @@ unpacker_src_uri_depends() {
 			d="app-arch/unzip" ;;
 		*.lz)
 			d="|| ( app-arch/plzip app-arch/pdlzip app-arch/lzip )" ;;
+		*.zst)
+			d="app-arch/zstd" ;;
 		esac
 		deps+=" ${d}"
 	done
-- 
2.26.2

Reply via email to