From 9ca8f24189e50fa50cd6e7b566c2bc2f5894cf27 Mon Sep 17 00:00:00 2001 From: "Arav K." Date: Thu, 13 Jun 2024 09:11:34 +0200 Subject: [PATCH] Require 'bash-completion' >=v2.8 instead of v2.10 Debian 10 LTS only has 'bash-completion' v2.8, but support for it expires at the end of the month (2024-06-30). Still, this completion script apparently worked there, so there's no harm in reducing the version requirement, which I had previously picked arbitrarily. See https://github.com/beetbox/beets/pull/5301#issuecomment-2164297308. --- beets/ui/completion_base.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/beets/ui/completion_base.sh b/beets/ui/completion_base.sh index 9cc4f1906..e83f9d2c5 100644 --- a/beets/ui/completion_base.sh +++ b/beets/ui/completion_base.sh @@ -31,7 +31,7 @@ # plugins dynamically # # Currently, only Bash 3.2 and newer is supported and the -# `bash-completion` package (v2.10 or newer) is required. +# `bash-completion` package (v2.8 or newer) is required. # # TODO # ---- @@ -46,17 +46,20 @@ # * Support long options with `=`, e.g. `--config=file`. Debian's bash # completion package can handle this. # +# Note that 'bash-completion' v2.8 is a part of Debian 10, which is part of +# LTS until 2024-06-30. After this date, the minimum version requirement can +# be changed, and newer features can be used unconditionally. See PR#5301. +# if [[ ${BASH_COMPLETION_VERSINFO[0]} -ne 2 \ - || ${BASH_COMPLETION_VERSINFO[1]} -lt 10 ]]; then + || ${BASH_COMPLETION_VERSINFO[1]} -lt 8 ]]; then echo "Incompatible version of 'bash-completion'!" return 1 fi -# The following functions are introduced by bash-completion v2.12, and -# at the same time the functions they replace are deprecated. In order -# to avoid using deprecated functions, here are some forward-compatible -# aliases which use the deprecated functions when necessary. +# The later code relies on 'bash-completion' version 2.12, but older versions +# are still supported. Here, we provide implementations of the newer functions +# in terms of older ones, if 'bash-completion' is too old to have them. if [[ ${BASH_COMPLETION_VERSINFO[1]} -lt 12 ]]; then _comp_get_words() {