Package: crystal-lang
Version: 0.34.0+dfsg-1
Severity: normal
Tags: patch

Dear Maintainer,

The crystal-lang package currently installs a bash-completion script to
/usr/share/bash-completion/completions/crystal-lang/completion.bash
Unfortunately, it will not be used because bash-completion dynamically
loads completion scripts from
/usr/share/bash-completion/completions/$cmd, so completions for crystal
must be installed as /usr/share/bash-completion/completions/crystal.

I assume zsh has the same issue and
/usr/share/zsh/vendor-completions/_crystal-lang/completion.zsh must be
/usr/share/zsh/vendor-completions/_crystal.

The attached patch should fix both.

Thanks for considering,
Kevin
From 271285e4b9130f2ca17d8f702b3cc6ef2caff01f Mon Sep 17 00:00:00 2001
Message-Id: 
<271285e4b9130f2ca17d8f702b3cc6ef2caff01f.1615418709.git.ke...@kevinlocke.name>
From: Kevin Locke <ke...@kevinlocke.name>
Date: Wed, 10 Mar 2021 16:23:11 -0700
Subject: [PATCH] install shell completions to correct locations

bash-completion loads completion scripts dynamically from
/usr/share/bash-completion/completions/$cmd, so completions for the
crystal command must be installed as
/usr/share/bash-completion/completions/crystal, rather than
/usr/share/bash-completion/completions/crystal-lang/completion.bash
as they currently are.

I assume the same is true for ZSH.

Signed-off-by: Kevin Locke <ke...@kevinlocke.name>
---
 debian/control              | 1 +
 debian/crystal-lang.install | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 debian/crystal-lang.install

diff --git a/debian/control b/debian/control
index 43e09b1..445f090 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: devel
 Priority: optional
 Maintainer: David Suárez <david.sephi...@gmail.com>
 Build-Depends: debhelper-compat (= 12),
+               dh-exec,
                git,
                libbsd-dev,
                libedit-dev,
diff --git a/debian/crystal-lang.install b/debian/crystal-lang.install
old mode 100644
new mode 100755
index 7dcc686..a47dfa9
--- a/debian/crystal-lang.install
+++ b/debian/crystal-lang.install
@@ -1,7 +1,9 @@
+#!/usr/bin/dh-exec
+
 .build/crystal /usr/bin
 
 # TODO: multiarch for /usr/lib/crystal/lib/{ext/libcrystal.a, 
llvm/ext/llvm_ext.a}
 src/* /usr/lib/crystal/lib
 
-etc/completion.bash /usr/share/bash-completion/completions/crystal-lang
-etc/completion.zsh /usr/share/zsh/vendor-completions/_crystal-lang
+etc/completion.bash => /usr/share/bash-completion/completions/crystal
+etc/completion.zsh => /usr/share/zsh/vendor-completions/_crystal
-- 
2.30.1

Reply via email to