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

Hiya,

On 6 December 2024 21:59:12 UTC, Einar Largenius <einar.largenius@gmail.com> wrote:
>fredag den 06 december 2024 skrev Tobias Geerinckx-Rice:
>> Do you have any idea which package added this (broken) code?
>
>No idea, how can I tell which package adds img2sixel?

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.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.


  reply	other threads:[~2024-12-06 22:59 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 [this message]
2024-12-09  9:16       ` Einar Largenius
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=76B20702-4119-4000-B3DF-D75BB0120576@tobias.gr \
    --to=me@tobias.gr \
    --cc=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).