Fix: use is-at-least function to check program version

This commit is contained in:
Alexandre Pujol 2018-01-03 14:46:23 +00:00
parent bc963cd1ae
commit b20daeea6f
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
2 changed files with 3 additions and 2 deletions

View File

@ -3,10 +3,11 @@
export test_description="Tomb regression tests"
source ./setup
autoload -U is-at-least
TOMB_VERSION=("2.3" "2.2" "2.0.1" "2.1")
zshversion=$(zsh --version | awk 'NR==1 {print $2}')
[[ $zshversion =~ "5.3" ]] && TOMB_VERSION=("2.3")
{ is-at-least "5.3" $zshversion } && TOMB_VERSION=("2.3")
for version in "${TOMB_VERSION[@]}"; do
URL="https://files.dyne.org/tomb/old-releases/Tomb-$version.tar.gz"

2
tomb
View File

@ -1002,7 +1002,7 @@ gpg_decrypt() {
gpgpopt=(--yes)
# GPG option '--try-secret-key' exist since GPG 2.1
{ option_is_set -R } && [[ $gpgver =~ "2.1." ]] && {
{ option_is_set -R } && { autoload -U is-at-least && is-at-least "2.1" $gpgver } && {
typeset -a recipients
recipients=(${(s:,:)$(option_value -R)})
{ is_valid_recipients $recipients } || {