From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by sourceware.org (Postfix) with ESMTP id 245483858D3C for ; Mon, 17 Jan 2022 16:22:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 245483858D3C Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 90B602D88 for ; Mon, 17 Jan 2022 17:22:20 +0100 (CET) Date: Mon, 17 Jan 2022 17:22:19 +0100 From: =?utf-8?B?0L3QsNCx?= To: elfutils-devel@sourceware.org Subject: [PATCH] config: simplify profile.*sh.in Message-ID: <20220117162219.fqt7heu4j67fzq35@tarta.nabijaczleweli.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="po46mefjcdf7pvuw" Content-Disposition: inline User-Agent: NeoMutt/20211029 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP, GIT_PATCH_0, KAM_INFOUSMEBIZ, PDS_OTHER_BAD_TLD, PDS_RDNS_DYNAMIC_FP, RDNS_DYNAMIC, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Mon, 17 Jan 2022 16:22:26 -0000 --po46mefjcdf7pvuw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 1. Remove needless profile=3D@profile@ 2. Simplify needless sh -c "cat glob 2>/dev/null" into cat glob 2>/dev/null 3. Use $( instead of ` under sh 4. Assign to D_U directly and either export it or unset it Signed-off-by: Ahelenia Ziemia=C5=84ska --- Please keep me in CC, as I'm not subscribed config/profile.csh.in | 12 +++++------- config/profile.sh.in | 11 ++--------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/config/profile.csh.in b/config/profile.csh.in index 01f7c2f2..2495aaa0 100644 --- a/config/profile.csh.in +++ b/config/profile.csh.in @@ -1,4 +1,3 @@ - # $HOME/.login* 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. @@ -6,11 +5,10 @@ # such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS. =20 if (! $?DEBUGINFOD_URLS) then - set prefix=3D"@prefix@" - set debuginfod_urls=3D`sh -c "cat @sysconfdir@/debuginfod/*.urls 2>/de= v/null" | tr '\n' ' '` - if ( "$debuginfod_urls" !=3D "" ) then - setenv DEBUGINFOD_URLS "$debuginfod_urls" + set DEBUGINFOD_URLS=3D`cat @sysconfdir@/debuginfod/*.urls 2>/dev/null = | tr '\n' ' '` + if ( "$DEBUGINFOD_URLS" !=3D "" ) then + setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS" + else + unset DEBUGINFOD_URLS endif - unset debuginfod_urls - unset prefix endif diff --git a/config/profile.sh.in b/config/profile.sh.in index afce3963..1fc6d6ed 100644 --- a/config/profile.sh.in +++ b/config/profile.sh.in @@ -1,4 +1,3 @@ - # $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. @@ -6,12 +5,6 @@ # such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS. =20 if [ -z "$DEBUGINFOD_URLS" ]; then - prefix=3D"@prefix@" - debuginfod_urls=3D`sh -c "cat @sysconfdir@/debuginfod/*.urls 2>/dev/nu= ll" | tr '\n' ' '` - if [ -n "$debuginfod_urls" ]; then - DEBUGINFOD_URLS=3D"$debuginfod_urls" - export DEBUGINFOD_URLS - fi - unset debuginfod_urls - unset prefix + DEBUGINFOD_URLS=3D$(cat @sysconfdir@/debuginfod/*.urls 2>/dev/null | t= r '\n' ' ') + [ -n "$DEBUGINFOD_URLS" ] && export DEBUGINFOD_URLS || unset DEBUGINFO= D_URLS fi --=20 2.34.1 --po46mefjcdf7pvuw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmHll7gACgkQvP0LAY0m WPF1axAAjsoxlBvlBRbiUriz5q/ttj28wjfLqtXDJKieq92seztqhXToh3AwomWm ztQ2ePgohNuauZuj3eMqyL3G2AmbJHbC7EBmm8KYJUhtzv0MS3Uh0dx/SOqwMMzX 9d9X/ye9/W26JfNlHP58cqfpzxzlyX/Rt1cUxtGSaAQadbnTN8pX/al9nBQpwMBS aOa23bj7QPxidKTP5jMbIVQbCqYYrRMUSKxJpBBAXpAGH/5NSk9+r4S7zRcCFceY upG7tPe2Z6ClKvbU+k2cr2Qk5XiUSOerZvqoRJPTGDPTFVlPuFH6kVP4kK4jGahj 6dsNcn9XVCsVE5Hs76pYau4FqECZIWbzSRfhnu9dgAeFdKM8TG5dE9a1EkQW1dj2 PhktU/W15/jF6xqGgfnqwJu+hf6BWD2OdeYccKeid23kUPstUyEb4y6DYDZenvx/ p66V+Rx2oEyg7sSAR8EOII45YhgF4adUTZkE8kTGL4blADR7vFzjssNTZhB696jN UTjCD+CMzwBpnzg27LsbDf2k3pm9grSlKf/l65MgDkZdmTrmi66UmrZys8kvB+q/ UwnqpU6vpVe1Gfa5/yExRjWA3xmwYqhf9rDJ7pM8T96/NSvdJzbFDHjNFQIAYCB/ snFmEV90rhFmw+2TyuwvXdPWs8/b3NuxQHpZgL1lyw+uzkNd8yk= =35Oe -----END PGP SIGNATURE----- --po46mefjcdf7pvuw--