From: "Martin Liška" <mliska@suse.cz>
To: elfutils-devel@sourceware.org
Cc: "Frank Ch. Eigler" <fche@elastic.org>
Subject: [PATCH] Support nullglob in profile.*.in files
Date: Tue, 16 Aug 2022 15:17:42 +0200 [thread overview]
Message-ID: <a6ba4301-c95d-14d2-7892-6acb0e79cf72@suse.cz> (raw)
In openSUSE we have the following RPM checker that uses
shopt -s nullglob:
https://github.com/openSUSE/post-build-checks/blob/master/checks/50-check-libtool-deps#L31
The script loads all /etc/profile.d/*.sh files via source $FILE which
can end up by stuck cat (with no arguments):
shopt -s nullglob ; cat "/etc/debuginfod"/*.urls
(stuck)
---
config/profile.csh.in | 2 +-
config/profile.sh.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/profile.csh.in b/config/profile.csh.in
index 74c20c99..d962d969 100644
--- a/config/profile.csh.in
+++ b/config/profile.csh.in
@@ -6,7 +6,7 @@
if (! $?DEBUGINFOD_URLS) then
set prefix="@prefix@"
- set DEBUGINFOD_URLS=`sh -c 'cat "$0"/*.urls 2>/dev/null; :' "@sysconfdir@/debuginfod" | tr '\n' ' '`
+ set DEBUGINFOD_URLS=`sh -c 'cat /dev/null "$0"/*.urls 2>/dev/null; :' "@sysconfdir@/debuginfod" | tr '\n' ' '`
if ( "$DEBUGINFOD_URLS" != "" ) then
setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS"
else
diff --git a/config/profile.sh.in b/config/profile.sh.in
index bad20b1e..3f4397dc 100644
--- a/config/profile.sh.in
+++ b/config/profile.sh.in
@@ -6,7 +6,7 @@
if [ -z "$DEBUGINFOD_URLS" ]; then
prefix="@prefix@"
- DEBUGINFOD_URLS=$(cat "@sysconfdir@/debuginfod"/*.urls 2>/dev/null | tr '\n' ' ')
+ DEBUGINFOD_URLS=$(cat /dev/null "@sysconfdir@/debuginfod"/*.urls 2>/dev/null | tr '\n' ' ')
[ -n "$DEBUGINFOD_URLS" ] && export DEBUGINFOD_URLS || unset DEBUGINFOD_URLS
unset prefix
fi
--
2.37.1
next reply other threads:[~2022-08-16 13:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-16 13:17 Martin Liška [this message]
2022-08-16 13:20 ` 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=a6ba4301-c95d-14d2-7892-6acb0e79cf72@suse.cz \
--to=mliska@suse.cz \
--cc=elfutils-devel@sourceware.org \
--cc=fche@elastic.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).