From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 769A838618FF for ; Thu, 6 May 2021 09:54:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 769A838618FF Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from librem (deer0x15.wildebeest.org [172.31.17.151]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 6C52E302BBED; Thu, 6 May 2021 11:54:22 +0200 (CEST) Received: by librem (Postfix, from userid 1000) id 54BB2C34A9; Thu, 6 May 2021 11:52:59 +0200 (CEST) Date: Thu, 6 May 2021 11:52:59 +0200 From: Mark Wielaard To: "Frank Ch. Eigler" Cc: elfutils-devel@sourceware.org Subject: Re: PATCH: PR27784 debuginfod: notify interactive clients one time about usage Message-ID: <20210506095259.GB4269@wildebeest.org> References: <20210429184412.GC6131@redhat.com> <4aa0e98c4393f9d30d50b7363b3edc15eb46cd92.camel@klomp.org> <20210505202036.GC22669@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210505202036.GC22669@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 09:54:24 -0000 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 >