diff options
author | V3n3RiX <venerix@koprulu.sector> | 2025-01-11 06:41:28 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2025-01-11 06:41:28 +0000 |
commit | f1634517e73f2faf342a366354c3e0f2edb45952 (patch) | |
tree | ae3c632ec3576f8d57b3acd5e1aba5643f0f6d9b /eclass/verify-sig.eclass | |
parent | f9d8ddaae80afb8fa0924cd3f769f9b37dd373e1 (diff) |
gentoo auto-resync : 11:01:2025 - 06:41:28
Diffstat (limited to 'eclass/verify-sig.eclass')
-rw-r--r-- | eclass/verify-sig.eclass | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass index 0e6b9b43e557..12b689f0f4b2 100644 --- a/eclass/verify-sig.eclass +++ b/eclass/verify-sig.eclass @@ -1,4 +1,4 @@ -# Copyright 2020-2024 Gentoo Authors +# Copyright 2020-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: verify-sig.eclass @@ -48,6 +48,8 @@ esac if [[ -z ${_VERIFY_SIG_ECLASS} ]]; then _VERIFY_SIG_ECLASS=1 +inherit eapi9-pipestatus + IUSE="verify-sig" # @ECLASS_VARIABLE: VERIFY_SIG_METHOD @@ -423,6 +425,36 @@ verify-sig_verify_signed_checksums() { esac } +# @FUNCTION: verify-sig_uncompress_verify_unpack +# @USAGE: <compressed-tar> <sig-file> [<key-file>] +# @DESCRIPTION: +# Uncompress the <compressed-tar> tarball, verify the uncompressed +# archive against the signature in <sig-file> and unpack it. This is +# useful for kernel.org packages that sign the uncompressed tarball +# instead of the compressed archive. <key-file> can either be passed +# directly, or it defaults to VERIFY_SIG_OPENPGP_KEY_PATH. The function +# dies if verification or any of the unpacking steps fail. +verify-sig_uncompress_verify_unpack() { + local file=${1} + local unpacker + + # TODO: integrate with unpacker.eclass somehow? + case ${file} in + *.tar.xz) + unpacker=( xz -cd ) + ;; + *) + die "${FUNCNAME}: only .tar.xz archives are supported at the moment" + ;; + esac + + einfo "Unpacking ${file} ..." + verify-sig_verify_detached - "${@:2}" < <( + "${unpacker[@]}" "${file}" | tee >(tar -xf - || die) + pipestatus || die + ) +} + # @FUNCTION: verify-sig_src_unpack # @DESCRIPTION: # Default src_unpack override that verifies signatures for all |