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

Frank Ch. Eigler fche@redhat.com
Wed May 5 20:20:36 GMT 2021


Hi -

OK, how about this?


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