From 6711985b4bff41f622d96e02f7dc62485f21fe3c Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 24 Jul 2019 18:28:23 +0300 Subject: gitlab !11: luarocks: Fix/improve logic of cache validation Also: Remove unnecessary quoting of helper function calls. --- Completion/Unix/Command/_luarocks | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Completion/Unix/Command/_luarocks') diff --git a/Completion/Unix/Command/_luarocks b/Completion/Unix/Command/_luarocks index 5c8ebdc92..c73a75a03 100644 --- a/Completion/Unix/Command/_luarocks +++ b/Completion/Unix/Command/_luarocks @@ -173,16 +173,16 @@ ___luarocks_installed_rocks_cache_policy(){ local user_manifest_file="${configured_user_tree}/lib/luarocks/rocks-${configured_lua_version}/manifest" local system_manifest_file="${configured_system_tree}/lib/luarocks/rocks-${configured_lua_version}/manifest" - local cache_status=1 + local cache_status=0 if [[ -f ${cache_file} ]]; then if [[ -f ${user_manifest_file} ]]; then - if [[ ${user_manifest_file} -nt ${cache_file} ]]; then - cache_status=0 + if [[ ${cache_file} -nt ${user_manifest_file} ]]; then + cache_status=1 fi fi if [[ -f ${system_manifest_file} ]]; then - if [[ ${system_manifest_file} -nt ${cache_file} ]]; then - cache_status=0 + if [[ ${cache_file} -nt ${system_manifest_file} ]]; then + cache_status=1 fi fi fi @@ -402,7 +402,7 @@ local doc_command_options=( _luarocks_doc(){ _arguments \ "${doc_command_options[@]}" \ - '1: :{__luarocks_rock "installed" '"${opt_args[--tree]}"'}' + "1: :{__luarocks_rock installed ${opt_args[--tree]}}" } # arguments: # - must: external only rockspec @@ -524,8 +524,8 @@ local remove_command_options=( _luarocks_remove(){ _arguments -A "-*" \ "${remove_command_options[@]}" \ - '1: :{__luarocks_rock "installed" '"${opt_args[--tree]}"'}' \ - '2:: :{__luarocks_rock_version "installed" '"${opt_args[--tree]}"'}' + "1: :{__luarocks_rock installed ${opt_args[--tree]}}" \ + "2:: :{__luarocks_rock_version installed ${opt_args[--tree]}}" } # arguments: # - must: string as a search query @@ -558,8 +558,8 @@ local show_command_options=( _luarocks_show(){ _arguments \ "${show_command_options[@]}" \ - "1: :{__luarocks_rock 'installed' "${opt_args[--tree]}"}" \ - '2:: :{__luarocks_rock_version "installed" '"${opt_args[--tree]}"'}' + "1: :{__luarocks_rock installed "${opt_args[--tree]}"}" \ + "2:: :{__luarocks_rock_version installed ${opt_args[--tree]}}" } (( $+functions[_luarocks_test] )) || -- cgit 1.4.1