From: Dmitry V. Levin Date: Wed, 4 Nov 2020 08:00:00 +0000 (+0000) Subject: config: do not define DEBUGINFOD_URLS environment variable unnecessarily X-Git-Tag: elfutils-0.183~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=911ac29b9eed3c66bba60eda6af8e5de62607e5c;p=thirdparty%2Felfutils.git config: do not define DEBUGINFOD_URLS environment variable unnecessarily Before this change, when elfutils was configured without --enable-debuginfod-urls, the installed profile.d/debuginfod.sh and profile.d/debuginfod.csh scripts used to define the DEBUGINFOD_URLS environment variable as an non-empty string containing spaces, making all libdebuginfod users do extra work. Change these scripts to avoid defining the DEBUGINFOD_URLS environment variable unless configured using --enable-debuginfod-urls. Signed-off-by: Dmitry V. Levin --- diff --git a/config/ChangeLog b/config/ChangeLog index e69e7e214..e4da0ebc5 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2020-11-04 Dmitry V. Levin + + * profile.sh.in, profile.csh.in: Do not define $DEBUGINFOD_URLS unless + configured using --enable-debuginfod-urls. + 2020-11-02 Dmitry V. Levin * Makefile.am (pkgconfig_DATA, install-data-local, uninstall-local): diff --git a/config/profile.csh.in b/config/profile.csh.in index 4f25896d1..0a2d6d162 100644 --- a/config/profile.csh.in +++ b/config/profile.csh.in @@ -1,2 +1,11 @@ - -setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS @DEBUGINFOD_URLS@" +if ("@DEBUGINFOD_URLS@" != "") then + if ($?DEBUGINFOD_URLS) then + if ($%DEBUGINFOD_URLS) then + setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS @DEBUGINFOD_URLS@" + else + setenv DEBUGINFOD_URLS "@DEBUGINFOD_URLS@" + endif + else + setenv DEBUGINFOD_URLS "@DEBUGINFOD_URLS@" + endif +endif diff --git a/config/profile.sh.in b/config/profile.sh.in index 8a022489e..aa228a0dc 100644 --- a/config/profile.sh.in +++ b/config/profile.sh.in @@ -1,3 +1,4 @@ - -DEBUGINFOD_URLS="$DEBUGINFOD_URLS @DEBUGINFOD_URLS@" -export DEBUGINFOD_URLS +if [ -n "@DEBUGINFOD_URLS@" ]; then + DEBUGINFOD_URLS="${DEBUGINFOD_URLS-}${DEBUGINFOD_URLS:+ }@DEBUGINFOD_URLS@" + export DEBUGINFOD_URLS +fi