From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id 06F52385AC34 for ; Wed, 10 Nov 2021 21:42:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 06F52385AC34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 1268672C8B8; Thu, 11 Nov 2021 00:42:48 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id F1A697CFBB4; Thu, 11 Nov 2021 00:42:47 +0300 (MSK) Date: Thu, 11 Nov 2021 00:42:47 +0300 From: "Dmitry V. Levin" To: "Frank Ch. Eigler" Cc: elfutils-devel@sourceware.org Subject: Re: [patch] PR27783: default debuginfod-urls profile rework Message-ID: <20211110214247.GA3988@altlinux.org> References: <20211003213333.GC21634@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211003213333.GC21634@redhat.com> X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 21:42:50 -0000 Hi Frank, On Sun, Oct 03, 2021 at 05:33:33PM -0400, Frank Ch. Eigler via Elfutils-devel wrote: > commit 0c634f243d266ce8841fd311433d5d79555fabf9 > Author: Frank Ch. Eigler > Date: Sun Oct 3 17:04:24 2021 -0400 > > PR27783: switch default debuginfod-urls to drop-in style files > > Rewrote and commented the /etc/profile.d csh and sh script fragments > to take the default $DEBUGINFOD_URLS from the union of drop-in files: > /etc/debuginfod/*.urls. Hand-tested with csh and bash, with > conditions including no prior $DEBUGINFOD_URLS, nonexistent .urls > files, multiple entries in .urls files. [...] > diff --git a/config/profile.csh.in b/config/profile.csh.in > index 0a2d6d162019..29e59a709450 100644 > --- a/config/profile.csh.in > +++ b/config/profile.csh.in > @@ -1,11 +1,16 @@ > -if ("@DEBUGINFOD_URLS@" != "") then > - if ($?DEBUGINFOD_URLS) then > - if ($%DEBUGINFOD_URLS) then > - setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS @DEBUGINFOD_URLS@" > - else > - setenv DEBUGINFOD_URLS "@DEBUGINFOD_URLS@" > - endif > - else > - setenv DEBUGINFOD_URLS "@DEBUGINFOD_URLS@" > - endif > + > +# $HOME/.login* or similar files may first set $DEBUGINFOD_URLS. > +# If $DEBUGINFOD_URLS is not set there, we set it from system *.url files. > +# $HOME/.*rc or similar files may then amend $DEBUGINFOD_URLS. > +# See also [man debuginfod-client-config] for other environment variables > +# such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS. > + > +if (! $?DEBUGINFOD_URLS) then > + set prefix="@prefix@" > + set debuginfod_urls=`find "@sysconfdir@/debuginfod/" -name '*.urls' | xargs cat | tr '\n' ' '` > + if ( "$debuginfod_urls" != "" ) then > + setenv DEBUGINFOD_URLS "$debuginfod_urls" > + endif > + unset debuginfod_urls > + unset prefix > endif > diff --git a/config/profile.sh.in b/config/profile.sh.in > index aa228a0dcd16..94b2983b9f90 100644 > --- a/config/profile.sh.in > +++ b/config/profile.sh.in > @@ -1,4 +1,17 @@ > -if [ -n "@DEBUGINFOD_URLS@" ]; then > - DEBUGINFOD_URLS="${DEBUGINFOD_URLS-}${DEBUGINFOD_URLS:+ }@DEBUGINFOD_URLS@" > - export DEBUGINFOD_URLS > + > +# $HOME/.profile* or similar files may first set $DEBUGINFOD_URLS. > +# If $DEBUGINFOD_URLS is not set there, we set it from system *.url files. > +# $HOME/.*rc or similar files may then amend $DEBUGINFOD_URLS. > +# See also [man debuginfod-client-config] for other environment variables > +# such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS. > + > +if [ -z "$DEBUGINFOD_URLS" ]; then > + prefix="@prefix@" > + debuginfod_urls=`find "@sysconfdir@/debuginfod/" -name '*.urls' | xargs cat | tr '\n' ' '` > + if [ -n "$debuginfod_urls" ]; then > + DEBUGINFOD_URLS="$debuginfod_urls" > + export DEBUGINFOD_URLS > + fi > + unset debuginfod_urls > + unset prefix > fi Is there any particular reason to assign (and unset) prefix? -- ldv