public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Vitaly Chikunov <vt@altlinux.org>
To: "Frank Ch. Eigler" <fche@redhat.com>, elfutils-devel@sourceware.org
Subject: Re: [patch] PR27783: default debuginfod-urls profile rework
Date: Thu, 11 Nov 2021 01:42:59 +0300	[thread overview]
Message-ID: <20211110224259.ltidgisedhyb4k25@altlinux.org> (raw)
In-Reply-To: <20211110214247.GA3988@altlinux.org>

Frank,

On Thu, Nov 11, 2021 at 12:42:47AM +0300, Dmitry V. Levin wrote:
> On Sun, Oct 03, 2021 at 05:33:33PM -0400, Frank Ch. Eigler via Elfutils-devel wrote:
> > commit 0c634f243d266ce8841fd311433d5d79555fabf9
> > Author: Frank Ch. Eigler <fche@redhat.com>
> > 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.
> [...]
> > +# $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 *.urls file does not contain "\n" at the EOF its url will be
concatenated to another without separator making multiple urls invalid.

I'd suggest you don't use find (supporting subdirectories, why?) with
xargs cat ..., but just `for x in *.urls` cycle.

Also, running find, xargs, cat, tr, always (even if there is no urls,
you can optimize calling cat with xargs -r) Calling so much binaries on
login will slow down login to a loaded box, so 'for' cycle perhaps would
be faster.

If you still going to use so complicated processing would be beneficial
to support commentaries in .urls files too, so people can add some
description, or comment out some url (there can be many implied by
'urls' name).

Thanks,

  parent reply	other threads:[~2021-11-10 22:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03 21:33 Frank Ch. Eigler
2021-10-06 21:23 ` Mark Wielaard
2021-10-06 23:25   ` Frank Ch. Eigler
2021-10-07  9:10     ` Mark Wielaard
2021-11-10 21:42 ` Dmitry V. Levin
2021-11-10 22:20   ` Dmitry V. Levin
2021-11-10 22:41   ` Dmitry V. Levin
2021-11-10 22:42   ` Vitaly Chikunov [this message]
2021-11-10 23:04   ` Frank Ch. Eigler

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=20211110224259.ltidgisedhyb4k25@altlinux.org \
    --to=vt@altlinux.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    /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).