From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id A75AB3858D37 for ; Thu, 29 Jun 2023 12:34:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A75AB3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from csb.redhat.com (83-84-7-238.cable.dynamic.v4.ziggo.nl [83.84.7.238]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id A7A153006CF5; Thu, 29 Jun 2023 14:34:30 +0200 (CEST) Received: by csb.redhat.com (Postfix, from userid 10916) id AFEF6E6758; Thu, 29 Jun 2023 14:34:29 +0200 (CEST) From: Mark Wielaard To: debugedit@sourceware.org Cc: Mark Wielaard Subject: [PATCH] find-debuginfo: Prefix install_dir to PATH Date: Thu, 29 Jun 2023 14:34:10 +0200 Message-Id: <20230629123410.993614-1-mark@klomp.org> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3036.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Some distros install a symlink to find-debuginfo[.sh] under the old /usr/lib/rpm/ path. But don't have symlinks there for other helper tools like debugedit and sepdebugcrcfix. So those tools are then not under the install_dir as find-debuginfo calculates it. So instead of invoking those helper tools with a full install dir path, prefix the install dir to the PATH so the tools can be found there (or anywhere else on the PATH). Signed-off-by: Mark Wielaard --- scripts/find-debuginfo.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in index e7ac095..f87b777 100755 --- a/scripts/find-debuginfo.in +++ b/scripts/find-debuginfo.in @@ -101,7 +101,9 @@ EOF } # Figure out where we are installed so we can call other helper scripts. +# Prefix to PATH to prefer tools from install dir. install_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PATH=${install_dir}:$PATH # With -g arg, pass it to strip on libraries or executables. strip_g=false @@ -457,7 +459,7 @@ do_file() if [ "$no_recompute_build_id" = "true" ]; then no_recompute="-n" fi - id=$(${install_dir}/debugedit -b "$debug_base_name" -d "$debug_dest_name" \ + id=$(debugedit -b "$debug_base_name" -d "$debug_dest_name" \ $no_recompute -i \ ${build_id_seed:+--build-id-seed="$build_id_seed"} \ -l "$SOURCEFILE" "$f") || exit @@ -619,7 +621,7 @@ if $run_dwz \ # dwz invalidates .gnu_debuglink CRC32 in the main files. cat "$ELFBINSFILE" | (cd "$RPM_BUILD_ROOT"; \ - tr '\n' '\0' | xargs -0 ${install_dir}/sepdebugcrcfix usr/lib/debug) + tr '\n' '\0' | xargs -0 sepdebugcrcfix usr/lib/debug) fi fi -- 2.39.3