From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 8A08A3858D28 for ; Thu, 21 Mar 2024 20:25:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A08A3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A08A3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711052748; cv=none; b=PVCKAQkieAco43yD+3olsqhtCIPOwBhFd0ifDIM1/4XHMo2hV5Qun8Hb45NjVPNoAf1YMTYCbf12ukzom1CdR0hV+lJKINhld/s6kcB15oe47il9yvdSeFh1rwZCV5xKKlIjz1gERuZ9Lyvi4j6uQxIB/XVlt1Wrzh1nSsgGwaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711052748; c=relaxed/simple; bh=Q72pdLwi4StIgOJHO5OgVOkPAqSnFYlGXPUgNUYjkcE=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=h82xekH59USs3N+kQJpFhdBxhN6NmcRu9AUiFmw/11O29eunPwCP2KpCB30cRCnABIMZ9isDsmjxN/kb0F+U7/fhFVtcj2AxjN3q9qdCXF1sbXDcobO97g1qkCadNs6GVVRunYVROCLC/hutkWhVJpvgpOPgxIg27Rg3FYkBaIg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by gnu.wildebeest.org (Postfix, from userid 1000) id 9EB923000472; Thu, 21 Mar 2024 21:25:36 +0100 (CET) Date: Thu, 21 Mar 2024 21:25:36 +0100 From: Mark Wielaard To: Frederik =?utf-8?B?4oCcRnJlc2/igJ0gUy4=?= Olesen Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] config: Add profile script for fish shell Message-ID: <20240321202536.GP8319@gnu.wildebeest.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-8.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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, On Thu, Mar 21, 2024 at 04:04:11PM +0100, Frederik “Freso” S. Olesen wrote: > Add support for setting $DEBUGINFOD_URLS automatically in the fish shell > similar to the profile scripts for POSIX and csh shells. > > Makefile is set to install this into fish’s $XDG_DATA_DIRS vendor > directory instead of under /etc: > https://fishshell.com/docs/current/language.html#configuration-files > > * config/profile.fish.in: Set $DEBUGINFOD_URLS in fish shells. > * config/Makefile.am: Include profile.fish in install and > uninstall targets. Very nice. I don't know fish, but this looks reasonable. Two small comments below. > Signed-off-by: Frederik “Freso” S. Olesen > --- > config/ChangeLog | 5 +++++ > config/Makefile.am | 5 ++++- > config/profile.fish.in | 14 ++++++++++++++ > 3 files changed, 23 insertions(+), 1 deletion(-) > create mode 100644 config/profile.fish.in > > diff --git a/config/ChangeLog b/config/ChangeLog > index ce1f74f6..7d88c071 100644 > --- a/config/ChangeLog > +++ b/config/ChangeLog > @@ -1,3 +1,8 @@ > +2024-03-21 Frederik “Freso” S. Olesen > + > + * profile.fish.in: Set $DEBUGINFOD_URLS in fish shells. > + * Makefile.am: Include profile.fish in install and uninstall targets. Since we have been putting the ChangeLog entry into the commit message it doesn't need to also go into the actual Changelog file. > 2023-02-21 Mark Wielaard > > * eu.am (USE_AFTER_FREE3_WARNING): Define. > diff --git a/config/Makefile.am b/config/Makefile.am > index 0d3ba164..ae14e625 100644 > --- a/config/Makefile.am > +++ b/config/Makefile.am > @@ -30,7 +30,8 @@ > ## > EXTRA_DIST = elfutils.spec.in known-dwarf.awk 10-default-yama-scope.conf \ > libelf.pc.in libdw.pc.in libdebuginfod.pc.in \ > - debuginfod.service debuginfod.sysconfig profile.sh.in profile.csh.in > + debuginfod.service debuginfod.sysconfig \ > + profile.sh.in profile.csh.in profile.fish.in > > pkgconfigdir = $(libdir)/pkgconfig > pkgconfig_DATA = libelf.pc libdw.pc > @@ -40,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 > + $(INSTALL_DATA) profile.fish -D $(DESTDIR)$(datadir)/fish/vendor_conf.d/debuginfod.fish > mkdir -p $(DESTDIR)$(sysconfdir)/debuginfod > if [ -n "@DEBUGINFOD_URLS@" ]; then \ > echo "@DEBUGINFOD_URLS@" > $(DESTDIR)$(sysconfdir)/debuginfod/elfutils.urls; \ > @@ -48,6 +50,7 @@ install-data-local: > uninstall-local: > rm -f $(DESTDIR)$(sysconfdir)/profile.d/debuginfod.sh > rm -f $(DESTDIR)$(sysconfdir)/profile.d/debuginfod.csh > + rm -f $(DESTDIR)$(datadir)/fish/vendor_conf.d/debuginfod.fish > rm -f $(DESTDIR)$(sysconfdir)/debuginfod/elfutils.urls > -rmdir $(DESTDIR)$(sysconfdir)/debuginfod > endif Right, with --prefix=/usr that expands to /usr/share/fish/vendor_conf.d which seems to match the default install location you pointed out above. Good. > diff --git a/config/profile.fish.in b/config/profile.fish.in > new file mode 100644 > index 00000000..34b1ab85 > --- /dev/null > +++ b/config/profile.fish.in > @@ -0,0 +1,14 @@ > +# $HOME/.profile* or similar files may first set $DEBUGINFOD_URLS. > +# If $DEBUGINFOD_URLS is not set there, we set it from system *.url files. > +# $HOME/.*rc or similar files may then amend $DEBUGINFOD_URLS. > +# See also [man debuginfod-client-config] for other environment variables > +# such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS. > + > +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' ' ') > + if test -n "$DEBUGINFOD_URLS" > + set --global --export DEBUGINFOD_URLS "$DEBUGINFOD_URLS" > + end > +end I don't know fish, but this looks OK. Note that to turn this profile.fish.in into profile.fish you need to mark it as a config file in configure.ac: diff --git a/configure.ac b/configure.ac index 098d13067ee6..a279bb5282c9 100644 --- a/configure.ac +++ b/configure.ac @@ -881,7 +881,7 @@ AC_ARG_ENABLE(debuginfod-urls, fi], [default_debuginfod_urls=""]) AC_SUBST(DEBUGINFOD_URLS, $default_debuginfod_urls) -AC_CONFIG_FILES([config/profile.sh config/profile.csh]) +AC_CONFIG_FILES([config/profile.sh config/profile.csh config/profile.fish]) AC_OUTPUT Could you sent a new patch with those two changes? Thanks, Mark