From: Martin Liska Date: Tue, 16 Aug 2022 13:14:26 +0000 (+0200) Subject: Support nullglob in profile.*.in files X-Git-Tag: elfutils-0.188~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=538f0c744dd4e1d931b98d01425b45137afcd9a4;p=platform%2Fupstream%2Felfutils.git Support nullglob in profile.*.in files 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) --- diff --git a/config/profile.csh.in b/config/profile.csh.in index 74c20c9..d962d96 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 bad20b1..3f4397d 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