]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
config: fix globing error for zsh
authorRocketDev <marocketbd@gmail.com>
Sat, 26 Oct 2024 14:18:09 +0000 (22:18 +0800)
committerAaron Merey <amerey@redhat.com>
Tue, 29 Oct 2024 17:12:06 +0000 (13:12 -0400)
Zsh treat unmatched glob as error while bash treat that as the original
string. Substitute globing with find to solve.

    * config/profile.sh.in: Fix globing error for zsh

Signed-off-by: RocketDev <marocketbd@gmail.com>
config/profile.sh.in

index 5e86f43366c057d1b7f0b0b0ee390407f83d25c7..9f3e415a38ec08b42e4f921d5e923f6562887933 100644 (file)
@@ -6,12 +6,12 @@
 
 prefix="@prefix@"
 if [ -z "$DEBUGINFOD_URLS" ]; then
-    DEBUGINFOD_URLS=$(cat /dev/null "@sysconfdir@/debuginfod"/*.urls 2>/dev/null | tr '\n' ' ' || :)
+    DEBUGINFOD_URLS=$(find "@sysconfdir@/debuginfod" -name "*.urls" -print0 2>/dev/null | xargs -0 cat 2>/dev/null | tr '\n' ' ' || :)
     [ -n "$DEBUGINFOD_URLS" ] && export DEBUGINFOD_URLS || unset DEBUGINFOD_URLS
 fi
 
 if [ -z "$DEBUGINFOD_IMA_CERT_PATH" ]; then
-    DEBUGINFOD_IMA_CERT_PATH=$(cat /dev/null "@sysconfdir@/debuginfod"/*.certpath 2>/dev/null | tr '\n' ':' || :)
+    DEBUGINFOD_IMA_CERT_PATH=$(find "@sysconfdir@/debuginfod" -name "*.certpath" -print0 2>/dev/null | xargs -0 cat 2>/dev/null | tr '\n' ':' || :)
     [ -n "$DEBUGINFOD_IMA_CERT_PATH" ] && export DEBUGINFOD_IMA_CERT_PATH || unset DEBUGINFOD_IMA_CERT_PATH
 fi
 unset prefix