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 DEED439BA43F for ; Tue, 3 Nov 2020 22:20:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DEED439BA43F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ldv@altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 090D872C8B0; Wed, 4 Nov 2020 01:20:09 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id EFBDD7CC819; Wed, 4 Nov 2020 01:20:08 +0300 (MSK) Date: Wed, 4 Nov 2020 01:20:08 +0300 From: "Dmitry V. Levin" To: Mark Wielaard Cc: "Frank Ch. Eigler" , Vitaly Chikunov , elfutils-devel@sourceware.org Subject: Re: [PATCH] config: Conditionalize on LIBDEBUGINFOD instead of DEBUGINFOD Message-ID: <20201103222008.GA10598@altlinux.org> References: <20201102080000.GA22615@altlinux.org> <20201103170739.GD22258@redhat.com> <0cf2d2b046ab154c505d3c70deee613f809ea6df.camel@klomp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0cf2d2b046ab154c505d3c70deee613f809ea6df.camel@klomp.org> X-Spam-Status: No, score=-11.3 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 03 Nov 2020 22:20:11 -0000 Hi, On Tue, Nov 03, 2020 at 06:26:07PM +0100, Mark Wielaard wrote: > Hi Frank, > > On Tue, 2020-11-03 at 12:07 -0500, Frank Ch. Eigler via Elfutils-devel > wrote: > > > While packaging I noticed that we install the profiles.d files even > > > when the DEBUGINFOD_URLS is empty. I think we should avoid that. > > > > I think we should install them anyway. They give a sysadmin an easy > > knob to set a systemwide default, even if the distro build didn't. > > That is a good point. But I think the default setting is wrong if it > isn't actually used/setup. As the profile shell snippets are now they > define the DEBUGINFOD_URLS environment variable as an non-empty string > (although just containing spaces), which makes anything using > libdw/libdebuginfod do extra work because we have to assume there is > some server defined. > > Is there a way to make it so that even if the profiles are installed > the DEBUGINFOD_URLS is not defined or is the empty string if --enable- > debuginfod-urls isn't given? Something like this? diff --git a/config/profile.sh.in b/config/profile.sh.in index 8a022489..aa228a0d 100644 --- a/config/profile.sh.in +++ b/config/profile.sh.in @@ -1,3 +1,4 @@ - -DEBUGINFOD_URLS="$DEBUGINFOD_URLS @DEBUGINFOD_URLS@" -export DEBUGINFOD_URLS +if [ -n "@DEBUGINFOD_URLS@" ]; then + DEBUGINFOD_URLS="${DEBUGINFOD_URLS-}${DEBUGINFOD_URLS:+ }@DEBUGINFOD_URLS@" + export DEBUGINFOD_URLS +fi -- ldv