unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Einar Largenius <einar.largenius@gmail.com>
To: help-guix <help-guix@gnu.org>
Subject: Re: bash: have: command not found
Date: Mon, 09 Dec 2024 10:16:19 +0100	[thread overview]
Message-ID: <87r06hfc7w.fsf@gmail.com> (raw)
In-Reply-To: <76B20702-4119-4000-B3DF-D75BB0120576@tobias.gr> (Tobias Geerinckx-Rice's message of "Fri, 06 Dec 2024 22:58:23 +0000")

fredag den 06 december 2024 skrev Tobias Geerinckx-Rice:

> libsixel, through mpv, but you misunderstand me, there's nothing
> wrong with it. It's the canary in the coal mine.
>
> The 'broken code' I meant is this
>
>>for f in "$HOME"/.guix-profile/etc/bash_completion.d/* ; do
>>        . "$f"
>>done
>
> Origin aside, it's broken. Completion files aren't written to be
> sourced this way. They'll get none of the library functions normally
> available to them–such as 'have'. Hence the error. There is no bug.
>
> The correct solution is to let the bash-completion package take care
> of bash completion, by sourcing etc/profile.d/bash_completion.sh at
> shell startup.
>
> Guix System *does* explictly check for it! I'd missed that. Well
> spotted:
> <https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system.scm#n1134>
>
> You'll have to do the same, but with $HOME/.guix-profile substituted
> for /run/current-system/profile.

That seems to have resolved the issue. I added the above lines to have access to completion for the packages I have installed in my user-profile.

I changed my config to:

    # Profile-specific completion
    if [ -f  "$HOME"/.guix-profile/etc/profile.d/bash_completion.sh ]; then
        source "$HOME"/.guix-profile/etc/profile.d/bash_completion.sh
    fi

Its unfortunate that this needs to be added manually on foreign distros.

-- 
Med vänliga hälsningar Einar


  reply	other threads:[~2024-12-09 10:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06 14:14 bash: have: command not found Einar Largenius
2024-12-06 19:17 ` Tobias Geerinckx-Rice
2024-12-06 21:59   ` Einar Largenius
2024-12-06 22:58     ` Tobias Geerinckx-Rice
2024-12-09  9:16       ` Einar Largenius [this message]
2024-12-07  4:01 ` Nils Landt
2024-12-07  5:44   ` [PATCH] gnu: libsixel: Fix bash completion Hilton Chain
2024-12-09  9:20     ` Einar Largenius
2024-12-09  9:20       ` bug#73142: " Einar Largenius

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r06hfc7w.fsf@gmail.com \
    --to=einar.largenius@gmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).