From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 0C0273857C4E for ; Fri, 15 Apr 2022 11:48:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C0273857C4E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id C4D2530002FC; Fri, 15 Apr 2022 13:48:23 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 37580413CD15; Fri, 15 Apr 2022 13:48:23 +0200 (CEST) Message-ID: <0ece9dd6488f5a995ef4e0bf26710d31cdfc0197.camel@klomp.org> Subject: Re: [PATCH v2] config: simplify profile.*sh.in From: Mark Wielaard To: =?UTF-8?Q?=D0=BD=D0=B0=D0=B1?= , "Frank Ch. Eigler" Cc: elfutils-devel@sourceware.org Date: Fri, 15 Apr 2022 13:48:23 +0200 In-Reply-To: <20220119123135.kb76gutv42itxant@tarta.nabijaczleweli.xyz> References: <20220117162219.fqt7heu4j67fzq35@tarta.nabijaczleweli.xyz> <20220118161328.GB21016@redhat.com> <20220119123135.kb76gutv42itxant@tarta.nabijaczleweli.xyz> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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: Fri, 15 Apr 2022 11:48:28 -0000 Hi, On Wed, 2022-01-19 at 13:31 +0100, =D0=BD=D0=B0=D0=B1 via Elfutils-devel wr= ote: > On Tue, Jan 18, 2022 at 11:13:28AM -0500, Frank Ch. Eigler wrote: > > You mean "prefix=3D@prefix@". And it's not needless, > > because @sysconfdir@ often expands to "$prefix/something", > > which requires a prefix var to be set for evaluation. >=20 > I did, and yeah, that's right. Guess it was so outlandish that I > completely missed it. Dropped. >=20 > > > 2. Simplify needless sh -c "cat glob 2>/dev/null" > > > into cat glob 2>/dev/null > >=20 > > 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. >=20 > Well, no, as-written, it is needless. It's also incorrect, > since it's subject to word-splitting (=3D> a broken glob) again. >=20 > 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. >=20 > I've restored it, in a fashion that isn't subject to re-splitting, > and actually protects -e mode, for csh. >=20 > v2 scissor-patch below. >=20 > Please keep me in CC, as I'm not subscribed, > =D0=BD=D0=B0=D0=B1 >=20 > -- >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=C5=84ska * 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=3Dsimplify-prof= ile Frank, do you have any more concerns with this patch? Ahelenia, under which shells have you tested this? Thanks, Mark