public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Mark Wielaard <mark@klomp.org>
Cc: "Frank Ch. Eigler" <fche@redhat.com>,
	Vitaly Chikunov <vt@altlinux.org>,
	elfutils-devel@sourceware.org
Subject: Re: [PATCH] config: Conditionalize on LIBDEBUGINFOD instead of DEBUGINFOD
Date: Wed, 4 Nov 2020 01:20:08 +0300	[thread overview]
Message-ID: <20201103222008.GA10598@altlinux.org> (raw)
In-Reply-To: <0cf2d2b046ab154c505d3c70deee613f809ea6df.camel@klomp.org>

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

  parent reply	other threads:[~2020-11-03 22:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02  8:00 Dmitry V. Levin
2020-11-03 16:58 ` Mark Wielaard
2020-11-03 17:07   ` Frank Ch. Eigler
2020-11-03 17:26     ` Mark Wielaard
2020-11-03 17:32       ` Frank Ch. Eigler
2020-11-03 22:20       ` Dmitry V. Levin [this message]
2020-11-04 11:47         ` Frank Ch. Eigler
2020-11-04  8:00 ` [PATCH 2/1] config: do not define DEBUGINFOD_URLS environment variable unnecessarily Dmitry V. Levin
2020-11-09 13:31   ` Mark Wielaard
2020-11-09 13:30 ` [PATCH] config: Conditionalize on LIBDEBUGINFOD instead of DEBUGINFOD Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201103222008.GA10598@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    --cc=mark@klomp.org \
    --cc=vt@altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).