From 7e4aeaf563a8d9b6997d872e9ce513e01b7ee022 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Wed, 19 Jun 2024 22:03:33 -0400 Subject: sys-fs/btrfs-progs: optimize src_unpack We can avoid using a temp file via bash command substitution. Signed-off-by: Mike Gilbert --- sys-fs/btrfs-progs/btrfs-progs-6.9.ebuild | 34 ++++++++++-------------------- sys-fs/btrfs-progs/btrfs-progs-9999.ebuild | 34 ++++++++++-------------------- 2 files changed, 22 insertions(+), 46 deletions(-) (limited to 'sys-fs') diff --git a/sys-fs/btrfs-progs/btrfs-progs-6.9.ebuild b/sys-fs/btrfs-progs/btrfs-progs-6.9.ebuild index 59e32bcafd5d..a3192a87f3a1 100644 --- a/sys-fs/btrfs-progs/btrfs-progs-6.9.ebuild +++ b/sys-fs/btrfs-progs/btrfs-progs-6.9.ebuild @@ -94,29 +94,17 @@ pkg_setup() { : # Prevent python-any-r1_python_setup } -src_unpack() { - if [[ ${PV} == 9999 ]] ; then - git-r3_src_unpack - return - fi - - if in_iuse verify-sig && use verify-sig ; then - mkdir "${T}"/verify-sig || die - pushd "${T}"/verify-sig &>/dev/null || die - - # Upstream sign the decompressed .tar - # Let's do it separately in ${T} then cleanup to avoid external - # effects on normal unpack. - cp "${DISTDIR}"/${MY_P}.tar.xz . || die - xz -d ${MY_P}.tar.xz || die - verify-sig_verify_detached ${MY_P}.tar "${DISTDIR}"/${MY_P}.tar.sign - - popd &>/dev/null || die - rm -r "${T}"/verify-sig || die - fi - - default -} +if [[ ${PV} != 9999 ]]; then + src_unpack() { + if use verify-sig ; then + # Upstream sign the decompressed .tar + verify-sig_verify_detached \ + <(xz -cd "${DISTDIR}"/${MY_P}.tar.xz) \ + "${DISTDIR}"/${MY_P}.tar.sign + fi + default + } +fi src_prepare() { default diff --git a/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild b/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild index 59e32bcafd5d..a3192a87f3a1 100644 --- a/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild +++ b/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild @@ -94,29 +94,17 @@ pkg_setup() { : # Prevent python-any-r1_python_setup } -src_unpack() { - if [[ ${PV} == 9999 ]] ; then - git-r3_src_unpack - return - fi - - if in_iuse verify-sig && use verify-sig ; then - mkdir "${T}"/verify-sig || die - pushd "${T}"/verify-sig &>/dev/null || die - - # Upstream sign the decompressed .tar - # Let's do it separately in ${T} then cleanup to avoid external - # effects on normal unpack. - cp "${DISTDIR}"/${MY_P}.tar.xz . || die - xz -d ${MY_P}.tar.xz || die - verify-sig_verify_detached ${MY_P}.tar "${DISTDIR}"/${MY_P}.tar.sign - - popd &>/dev/null || die - rm -r "${T}"/verify-sig || die - fi - - default -} +if [[ ${PV} != 9999 ]]; then + src_unpack() { + if use verify-sig ; then + # Upstream sign the decompressed .tar + verify-sig_verify_detached \ + <(xz -cd "${DISTDIR}"/${MY_P}.tar.xz) \ + "${DISTDIR}"/${MY_P}.tar.sign + fi + default + } +fi src_prepare() { default -- cgit v1.2.3-65-gdbad