Erroring libsixel package's bash completions for img2sixel

  • Open
  • quality assurance status badge
Details
3 participants
  • Einar Largenius
  • elaexuotee
  • Hilton Chain
Owner
unassigned
Submitted by
elaexuotee
Severity
normal
E
E
elaexuotee wrote on 9 Sep 14:11 +0200
(address . bug-guix@gnu.org)
37BSQ0CKS192A.3M5HQPK7W2K9L@wilsonb.com
Hey!

The recent move of libsixel into mpv's propagated-inputs surfaced a bug in
our libsixel's bash completions. My bash sessions now start with an error:

-bash: have: Command not found

This was introduced in commit 43df0d83 from https://issues.guix.gnu.org/72180.
In particular, tracing with `set -o xtrace' show that it originates in the
first command of share/bash-completion/completions/img2sixel:

have img2sixel

Our configuration step might need to set --with-bashcompltiondir.

- BW
E
E
elaexuotee wrote on 9 Sep 20:42 +0200
(address . 73142@debbugs.gnu.org)
3Q597EW4C0AXG.355WR8HAEA657@wilsonb.com
It appears that share/bash-compltion/bash_completion performs an
`unset -f have' at the end of the script. This means that only the scripts
under /etc/bash_completion.d/ have access to `have', but said directory doesn't
even exist in our case.

That said, `have' is deprecated in favor of `_have' in 2.11, anyway. I have let
upstream libsixel know, but we could work around the issue with a
single-character patch:

Toggle diff (12 lines)
diff --git a/converters/shell-completion/bash/img2sixel b/converters/shell-completion/bash/img2sixel
index 028651b..d96a326 100644
--- a/converters/shell-completion/bash/img2sixel
+++ b/converters/shell-completion/bash/img2sixel
@@ -1,6 +1,6 @@
# bash completion for img2sixel

-have img2sixel &&
+_have img2sixel &&
_img2sixel()
{
local cur prev
H
H
Hilton Chain wrote 5 days ago
[PATCH] gnu: libsixel: Fix bash completion.
(address . 73142@debbugs.gnu.org)
87h67g59np.wl-hako@ultrarare.space
* gnu/packages/image.scm (libsixel)[source]: Fix bash completion.

Reported-By: elaexuotee@wilsonb.com
Reported-by: Einar Largenius <einar.largenius@gmail.com>
Change-Id: I7e30bfa4ad6efcf27b2e89a42c34802b53bd30e0
---

Does this patch fix the issue?

gnu/packages/image.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Toggle diff (25 lines)
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 7337a27b88..0367c08994 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -2831,7 +2831,12 @@ (define-public libsixel
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1nny4295ipy4ajcxmmh04c796hcds0y7z7rv3qd17mj70y8j0r2d"))))
+ (base32 "1nny4295ipy4ajcxmmh04c796hcds0y7z7rv3qd17mj70y8j0r2d"))
+ (modules '((guix build utils)))
+ (snippet
+ ;; https://github.com/libsixel/libsixel/issues/81
+ #~(substitute* "converters/shell-completion/bash/img2sixel"
+ (("have") "_have")))))
(build-system meson-build-system)
(arguments
(list

base-commit: 006679d1e6ca7acea0629b4f019c8cf89cde08be
prerequisite-patch-id: f132b4af7b85df465998e4f459bf729f8b66f320
prerequisite-patch-id: 71423f8b55ad6f04c3f3d647cbd9d42c6c332e06
prerequisite-patch-id: be124126488f174ea7e3bff735083a3edc09619a
prerequisite-patch-id: 244ca7d9a3430a90876970592a78d05207ee1893
prerequisite-patch-id: 53dc53cf4e9f0bb6e2f2c55194f3bc75a7381106
--
2.46.0
E
E
Einar Largenius wrote 2 days ago
(name . Hilton Chain)(address . hako@ultrarare.space)
87ikrtfc11.fsf@gmail.com
Hi,

It turned out I sourced my completion incorrectly. When I changed my setup as per Nilss suggestion the issue stopped. I assume by sourcing it this way this issue is already taken into account and resolved elsewhere.

lördag den 07 december 2024 skrev Hilton Chain:

Toggle quote (11 lines)
> * gnu/packages/image.scm (libsixel)[source]: Fix bash completion.
>
> Fixes: https://issues.guix.gnu.org/73142
> Reported-By: elaexuotee@wilsonb.com
> Fixes: https://mail.gnu.org/archive/html/help-guix/2024-12/msg00029.html
> Reported-by: Einar Largenius <einar.largenius@gmail.com>
> Change-Id: I7e30bfa4ad6efcf27b2e89a42c34802b53bd30e0
> ---
>
> Does this patch fix the issue?

--
Med vänliga hälsningar Einar
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 73142@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 73142
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch