commit: 957b37d462947edfc10ebddf9283aaae8f4c9cb3
parent 1f0ad2ab8178455cea936a0f6ec11c84045a6b90
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 25 Oct 2025 06:19:22 +0200
sys-apps/portage: rebase bsdtar patch
Diffstat:
2 files changed, 70 insertions(+), 49 deletions(-)
diff --git a/patches/sys-apps/portage/0001-bin-phase-helpers.sh-use-bsdtar-for-zip-jar-7z-rar-a.patch b/patches/sys-apps/portage/0001-bin-phase-helpers.sh-use-bsdtar-for-zip-jar-7z-rar-a.patch
@@ -0,0 +1,70 @@
+From 9351e8727957bcee6c6627fc465d976237fd8745 Mon Sep 17 00:00:00 2001
+From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
+Date: Fri, 6 Dec 2024 03:26:13 +0100
+Subject: [PATCH] bin/phase-helpers.sh: use bsdtar for zip|jar|7z|rar and
+ tarballs
+
+---
+ bin/phase-helpers.sh | 33 ++++++---------------------------
+ 1 file changed, 6 insertions(+), 27 deletions(-)
+
+diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
+index e1f301a5f..b0c31d02a 100644
+--- a/bin/phase-helpers.sh
++++ b/bin/phase-helpers.sh
+@@ -426,12 +426,6 @@ unpack() {
+ fi
+
+ case ${suffix,,} in
+- 7z)
+- if ! output=$(7z x -y "${srcdir}${f}"); then
+- printf '%s\n' "${output}" >&2
+- false
+- fi
+- ;;
+ a)
+ ar x "${srcdir}${f}"
+ ;;
+@@ -464,33 +458,18 @@ unpack() {
+ gz|z)
+ gzip -dc -- "${srcdir}${f}" > "${basename%.*}"
+ ;;
+- jar|zip)
+- # unzip will interactively prompt under some error conditions,
+- # as reported in bug #336285. Inducing EOF on STDIN makes for
+- # an adequate countermeasure.
+- unzip -qo "${srcdir}${f}" </dev/null
+- ;;
+ lha|lzh)
+ lha xfq "${srcdir}${f}"
+ ;;
+ lzma)
+ xz -F lzma -dc -- "${srcdir}${f}" > "${basename%.*}"
+ ;;
+- rar)
+- unrar x -idq -o+ "${srcdir}${f}"
+- ;;
+- tar.bz|tar.bz2|tbz|tbz2)
+- gtar -I "${bzip2_cmd-bzip2} -c" -xof "${srcdir}${f}"
+- ;;
+- tar|tar.*|tgz)
+- # GNU tar recognises various file suffixes, for
+- # which it is able to execute the appropriate
+- # decompressor. They are documented by the
+- # (info) manual for the -a option.
+- gtar --warning=decompress-program -xof "${srcdir}${f}"
+- ;;
+- txz)
+- gtar -xJof "${srcdir}${f}"
++ zip|jar|7z|rar|tar|tar.*|tgz|tbz|tbz2|txz)
++ # libarchive's bsdtar natively supports most compressors
++ # and archive formats.
++ # Also unlike GNU tar it typically doesn't shells out
++ # (or call rsh)
++ bsdtar xof "${srcdir}${f}"
+ ;;
+ xz)
+ xz -dc -- "${srcdir}${f}" > "${basename%.*}"
+--
+2.51.0
+
diff --git a/patches/sys-apps/portage/0001-bin-phase-helpers.sh-use-libarchive-bsdtar-for-zip-j.patch b/patches/sys-apps/portage/0001-bin-phase-helpers.sh-use-libarchive-bsdtar-for-zip-j.patch
@@ -1,49 +0,0 @@
-From 7f2d1eaba89e98e6932f1ca676e1251e572d6a3a Mon Sep 17 00:00:00 2001
-From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
-Date: Fri, 6 Dec 2024 03:26:13 +0100
-Subject: [PATCH] bin/phase-helpers.sh: use libarchive bsdtar for
- zip|jar|7z|rar
-
----
- bin/phase-helpers.sh | 18 ++----------------
- 1 file changed, 2 insertions(+), 16 deletions(-)
-
-diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
-index 5a35130..547b10b 100644
---- a/bin/phase-helpers.sh
-+++ b/bin/phase-helpers.sh
-@@ -408,11 +408,8 @@ __unpack_tar()
- ${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "${srcdir}${x}" | tar xof -
- __assert_sigpipe_ok "${myfail}"
- ;;
-- zip|jar)
-- # unzip will interactively prompt under some error conditions,
-- # as reported in bug #336285
-- ( set +x ; while true ; do echo n || break ; done ) | \
-- unzip -qo "${srcdir}${x}" || die "${myfail}"
-+ zip|jar|7z|rar)
-+ bsdtar xof "${srcdir}${x}" || die "${myfail}"
- ;;
- gz|z)
- __unpack_tar "gzip -d"
-@@ -420,17 +417,6 @@ __unpack_tar()
- bz2|bz)
- __unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
- ;;
-- 7z)
-- local my_output
-- my_output="$(7z x -y "${srcdir}${x}")"
-- if [[ $? -ne 0 ]]; then
-- echo "${my_output}" >&2
-- die "${myfail}"
-- fi
-- ;;
-- rar)
-- unrar x -idq -o+ "${srcdir}${x}" || die "${myfail}"
-- ;;
- lha|lzh)
- lha xfq "${srcdir}${x}" || die "${myfail}"
- ;;
---
-2.45.2
-