public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: наб <nabijaczleweli@nabijaczleweli.xyz>,
	"Frank Ch. Eigler" <fche@redhat.com>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH v2] config: simplify profile.*sh.in
Date: Fri, 15 Apr 2022 13:48:23 +0200	[thread overview]
Message-ID: <0ece9dd6488f5a995ef4e0bf26710d31cdfc0197.camel@klomp.org> (raw)
In-Reply-To: <20220119123135.kb76gutv42itxant@tarta.nabijaczleweli.xyz>

Hi,

On Wed, 2022-01-19 at 13:31 +0100, наб via Elfutils-devel wrote:
> On Tue, Jan 18, 2022 at 11:13:28AM -0500, Frank Ch. Eigler wrote:
> > You mean "prefix=@prefix@".  And it's not needless,
> > because @sysconfdir@ often expands to "$prefix/something",
> > which requires a prefix var to be set for evaluation.
> 
> I did, and yeah, that's right. Guess it was so outlandish that I
> completely missed it. Dropped.
> 
> > > 2. Simplify needless sh -c "cat glob 2>/dev/null"
> > >    into cat glob 2>/dev/null
> > 
> > This is not needless, but I forget the exact details.  It probably
> > has
> > to do with the $prefix expansion just above, or perhaps glob
> > non-matching error handling.
> 
> Well, no, as-written, it is needless. It's also incorrect,
> since it's subject to word-splitting (=> a broken glob) again.
> 
> But, yeah, turns out csh does have "glob non-matching error handing",
> which is both news to me and a blast from a V3-era past.
> That being said, it was also broken, because under csh
>   false | cat
> fails, for some inexplicable reason, and if the glob "fails",
> so does cat, so so does sh.
> 
> I've restored it, in a fashion that isn't subject to re-splitting,
> and actually protects -e mode, for csh.
> 
> v2 scissor-patch below.
> 
> Please keep me in CC, as I'm not subscribed,
> наб
> 
> -- >8 --
> 1. Simplify needless sh -c "cat glob 2>/dev/null"
>    into cat glob 2>/dev/null under sh
>    and fix re-expansion/-e protection under csh
> 2. Use $( instead of ` under sh
> 3. Assign to D_U directly and either export it or unset it

This seems reasonable to me, but I did have to lookup the exact
workings of sh -c to make sense of it.

  -c string
   If the -c option is present, then commands are read from
   string.  If there are arguments after the string, they are
   assigned to the positional parameters, starting with $0.

I have added a ChangeLog entry:

2022-01-19  Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>

       * profile.csh.in: Set DEBUGINFOD_URLS directly. Use "$0" and :
       in sh -c.
       * profile.sh.in: Set DEBUGINFOD_URLS directly. Don't use sh -c.
       Use $() instead of ``.

Full commit at:
https://code.wildebeest.org/git/user/mjw/elfutils/commit/?h=simplify-profile

Frank, do you have any more concerns with this patch?
Ahelenia, under which shells have you tested this?

Thanks,

Mark

  reply	other threads:[~2022-04-15 11:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 16:22 [PATCH] " наб
2022-01-18 16:13 ` Frank Ch. Eigler
2022-01-19 12:31   ` [PATCH v2] " наб
2022-04-15 11:48     ` Mark Wielaard [this message]
2022-04-15 12:12       ` наб
2022-04-23  0:32         ` 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=0ece9dd6488f5a995ef4e0bf26710d31cdfc0197.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    --cc=nabijaczleweli@nabijaczleweli.xyz \
    /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).