From 50670caaa53996278d760a7c4b4d8f9586500dd7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 21 Oct 2025 20:26:04 -0700 Subject: [PATCH] dev-util/bcc: fix dirname $0 in tools Closes: https://bugs.gentoo.org/964734 Signed-off-by: Zac Medico --- dev-util/bcc/bcc-0.31.0-r2.ebuild | 3 ++- dev-util/bcc/bcc-0.32.0.ebuild | 1 + dev-util/bcc/bcc-0.34.0.ebuild | 1 + dev-util/bcc/bcc-0.35.0.ebuild | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dev-util/bcc/bcc-0.31.0-r2.ebuild b/dev-util/bcc/bcc-0.31.0-r2.ebuild index 5fc842517becf..97de0a8ce17b5 100644 --- a/dev-util/bcc/bcc-0.31.0-r2.ebuild +++ b/dev-util/bcc/bcc-0.31.0-r2.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -193,6 +193,7 @@ src_install() { for tool in "${ED}"/usr/share/bcc/tools/*; do [[ -d ${tool} || ! -x ${tool} || ${tool} =~ .*[.](c|txt) ]] && continue grep -qE '^#!/usr/bin/(env |)python' "${tool}" && continue + sed -e 's:dirname \$0:dirname "$(realpath "$0")":' -i "${tool}" || die target="/usr/sbin/$(bcc_tool_name "${tool}")" [[ -e ${ED}${target} ]] && continue diff --git a/dev-util/bcc/bcc-0.32.0.ebuild b/dev-util/bcc/bcc-0.32.0.ebuild index 49b66101e0887..ef4eddac9954c 100644 --- a/dev-util/bcc/bcc-0.32.0.ebuild +++ b/dev-util/bcc/bcc-0.32.0.ebuild @@ -193,6 +193,7 @@ src_install() { for tool in "${ED}"/usr/share/bcc/tools/*; do [[ -d ${tool} || ! -x ${tool} || ${tool} =~ .*[.](c|txt) ]] && continue grep -qE '^#!/usr/bin/(env |)python' "${tool}" && continue + sed -e 's:dirname \$0:dirname "$(realpath "$0")":' -i "${tool}" || die target="/usr/sbin/$(bcc_tool_name "${tool}")" [[ -e ${ED}${target} ]] && continue diff --git a/dev-util/bcc/bcc-0.34.0.ebuild b/dev-util/bcc/bcc-0.34.0.ebuild index b8d98a3ce42ea..6e54c68eed636 100644 --- a/dev-util/bcc/bcc-0.34.0.ebuild +++ b/dev-util/bcc/bcc-0.34.0.ebuild @@ -193,6 +193,7 @@ src_install() { for tool in "${ED}"/usr/share/bcc/tools/*; do [[ -d ${tool} || ! -x ${tool} || ${tool} =~ .*[.](c|txt) ]] && continue grep -qE '^#!/usr/bin/(env |)python' "${tool}" && continue + sed -e 's:dirname \$0:dirname "$(realpath "$0")":' -i "${tool}" || die target="/usr/sbin/$(bcc_tool_name "${tool}")" [[ -e ${ED}${target} ]] && continue diff --git a/dev-util/bcc/bcc-0.35.0.ebuild b/dev-util/bcc/bcc-0.35.0.ebuild index ce25ce02b2354..ea3e6f59636aa 100644 --- a/dev-util/bcc/bcc-0.35.0.ebuild +++ b/dev-util/bcc/bcc-0.35.0.ebuild @@ -193,6 +193,7 @@ src_install() { for tool in "${ED}"/usr/share/bcc/tools/*; do [[ -d ${tool} || ! -x ${tool} || ${tool} =~ .*[.](c|txt) ]] && continue grep -qE '^#!/usr/bin/(env |)python' "${tool}" && continue + sed -e 's:dirname \$0:dirname "$(realpath "$0")":' -i "${tool}" || die target="/usr/sbin/$(bcc_tool_name "${tool}")" [[ -e ${ED}${target} ]] && continue