PATCH: PR27784 debuginfod: notify interactive clients one time about usage

Mark Wielaard mark@klomp.org
Thu May 6 09:52:59 GMT 2021


Hi Frank,

On Wed, May 05, 2021 at 04:20:36PM -0400, Frank Ch. Eigler wrote:
> OK, how about this?

I like this a lot better than doing it in the library code.

Maybe the notify_p file should be stored under
${XDG_CONFIG_HOME-$HOME/.config} instead, because it isn't really a
cache file. And maybe s/This system/Your user profile/? But those are
just nitpicks and not objections to what you proposed.

Cheers,

Mark

> diff --git a/config/profile.sh.in b/config/profile.sh.in
> index aa228a0dcd16..aec9e7df30f3 100644
> --- a/config/profile.sh.in
> +++ b/config/profile.sh.in
> @@ -1,4 +1,18 @@
>  if [ -n "@DEBUGINFOD_URLS@" ]; then
> -	DEBUGINFOD_URLS="${DEBUGINFOD_URLS-}${DEBUGINFOD_URLS:+ }@DEBUGINFOD_URLS@"
> -	export DEBUGINFOD_URLS
> +    DEBUGINFOD_URLS="${DEBUGINFOD_URLS-}${DEBUGINFOD_URLS:+ }@DEBUGINFOD_URLS@"
> +    debuginfod_cachedir="${XDG_CACHE_HOME-$HOME/.cache}/debuginfod_client"
> +    notify_p="$debuginfod_cachedir"/notify_p
> +    if [ ! -f "$notify_p" ]; then
> +        msg="NOTICE: This system is configured to auto-download debuginfo from:
> +$DEBUGINFOD_URLS
> +NOTICE: Set your \$DEBUGINFOD_URLS differently if desired."
> +        if [ -x /usr/bin/notify-send -a -n "$DISPLAY" ]; then
> +            /usr/bin/notify-send "$msg"
> +	fi
> +        echo "$msg" >&2
> +        mkdir -p "$debuginfod_cachedir"
> +	touch "$notify_p"
> +    fi
> +    unset debuginfod_cachedir notify_p msg
> +    export DEBUGINFOD_URLS
>  fi
> 


More information about the Elfutils-devel mailing list