diff options
author | Aaron Merey <amerey@redhat.com> | 2024-04-16 11:49:43 -0400 |
---|---|---|
committer | Aaron Merey <amerey@redhat.com> | 2024-04-17 14:37:59 -0400 |
commit | eeea53b41b12dc9633ce6a3b1eb5c7d0ba0e057f (patch) | |
tree | c3dbe58099ddf5f86e58814e8b104c179ba59904 | |
parent | 24055ab8679d4edc949250b7eb38e49863a2a560 (diff) | |
download | elfutils-upstream-main.tar.gz |
config/profile.fish.in: Prevent bracketed variables and unmatched wildcard errorsupstream-main
Fish does not support bracketed variables in scripts. Remove brackets
from the variable ${prefix} in profile.fish before installation to
prevent this error.
Fish also raises an error for unmatched wildcards, except for special
cases like the set command. Use a wildcard to match .urls files using
the set command instead of cat to prevent an unmatched wildcard error
when no .urls files are found.
Signed-off-by: Aaron Merey <amerey@redhat.com>
-rw-r--r-- | config/Makefile.am | 1 | ||||
-rw-r--r-- | config/profile.fish.in | 3 | ||||
-rwxr-xr-x | tests/run-debuginfod-client-profile.sh | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/config/Makefile.am b/config/Makefile.am index ae14e625..fd41997f 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -41,6 +41,7 @@ pkgconfig_DATA += libdebuginfod.pc install-data-local: $(INSTALL_DATA) profile.sh -D $(DESTDIR)$(sysconfdir)/profile.d/debuginfod.sh $(INSTALL_DATA) profile.csh -D $(DESTDIR)$(sysconfdir)/profile.d/debuginfod.csh + sed -i 's/{prefix}/prefix/g' profile.fish $(INSTALL_DATA) profile.fish -D $(DESTDIR)$(datadir)/fish/vendor_conf.d/debuginfod.fish mkdir -p $(DESTDIR)$(sysconfdir)/debuginfod if [ -n "@DEBUGINFOD_URLS@" ]; then \ diff --git a/config/profile.fish.in b/config/profile.fish.in index 00e9ca59..c0a234db 100644 --- a/config/profile.fish.in +++ b/config/profile.fish.in @@ -7,7 +7,8 @@ if not set --query DEBUGINFOD_URLS # Use local variables so we don't need to manually unset them set --local prefix "@prefix@" - set --local DEBUGINFOD_URLS (cat /dev/null "@sysconfdir@/debuginfod"/*.urls 2>/dev/null | string replace '\n' ' ') + set --local files "@sysconfdir@/debuginfod/"*.urls + set --local DEBUGINFOD_URLS (cat /dev/null $files 2>/dev/null | string replace '\n' ' ') if test -n "$DEBUGINFOD_URLS" set --global --export DEBUGINFOD_URLS "$DEBUGINFOD_URLS" end diff --git a/tests/run-debuginfod-client-profile.sh b/tests/run-debuginfod-client-profile.sh index 141588d3..12f5a83b 100755 --- a/tests/run-debuginfod-client-profile.sh +++ b/tests/run-debuginfod-client-profile.sh @@ -25,3 +25,6 @@ set -e set -o pipefail source ${abs_top_builddir}/config/profile.sh + +type fish 2>/dev/null || (echo "no fish installed"; exit 77) +fish ${abs_top_builddir}/config/profile.fish |