Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 23/25] Improve `___luarocks_installed_rocks_cache_policy`.
- X-seq: zsh-workers 42851
- From: doron.behar@xxxxxxxxx
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 23/25] Improve `___luarocks_installed_rocks_cache_policy`.
- Date: Sat, 26 May 2018 18:06:32 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=lmvQjQEGAEf3w6GqaMR2dScS272Wuz/Crdl5GGVZ6G4=; b=XkJrZnLYp1i1T7e7SBaXK5K2tSGNSy+S03lJTGzfj/MdCqjkuJDnTbYkMT60TjULOS /NScurwkbnfRu78U4oDehQeMHwG9kJz3uqgQ8r+uYikhdbnpjjB6spJSeJiQTe0G0jBs HmkgpBch66x/WU1utdPGjC07JvPHaREj2g+fbMvC1/2GXAwpAuohkmJtX+TO2OS2zoBc wdmdfpn6PUrXztfLrHadQNJe7ZqJbtNVqVFnHS4lEOzhue02YPpyq5rzEFzvLliYB5Gy Ho0e1GZYx6J/gzgFDvurpyl3NA64IfJs3g02Ocuq87VuzI2vmLZUpB0pQ9c4jA9ulkAD CP1A==
- In-reply-to: <20180526150634.15683-1-doron.behar@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180526150634.15683-1-doron.behar@gmail.com>
From: Doron Behar <doron.behar@xxxxxxxxx>
Handle multiple trees when evaluating installed rocks cache validity -
both system wide and user's.
---
Completion/Unix/Command/_luarocks | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Completion/Unix/Command/_luarocks b/Completion/Unix/Command/_luarocks
index cb42d1b36..8de95c188 100644
--- a/Completion/Unix/Command/_luarocks
+++ b/Completion/Unix/Command/_luarocks
@@ -87,14 +87,14 @@ __luarocks_lua_versions(){
# {{{ helper: installed rocks cache policy
(( $+functions[___luarocks_installed_rocks_cache_policy] )) ||
___luarocks_installed_rocks_cache_policy(){
- # TODO enable the user to configure manifests file that will be checked here with zstyle
- # the number of seconds since 1970-01-01 the manifest file was modified
- local manifest_last_date_modified="$(date -r ~/.luarocks/lib/luarocks/rocks-5.3/manifest +%s 2>/dev/null)"
+ # the number of seconds since 1970-01-01 the manifest files were modified
+ local user_manifest_last_date_modified="$(date -r ${HOME}/.luarocks/lib/luarocks/rocks-5.3/manifest +%s 2>/dev/null)"
+ local system_manifest_last_date_modified="$(date -r /usr/lib/luarocks/rocks-5.3/manifest +%s 2>/dev/null)"
# the number of seconds since 1970-01-01 the cache file was modified
local cache_last_date_modified="$(date -r $1 +%s 2>/dev/null)"
- if [[ ! -z ${cache_last_date_modified} && ! -z ${manifest_last_date_modified} ]]; then
+ if [[ ! -z ${cache_last_date_modified} && ! -z ${user_manifest_last_date_modified} && ! -z ${system_manifest_last_date_modified} ]]; then
# if the manifest file is newer then the cache:
- if [ ${manifest_last_date_modified} -ge ${cache_last_date_modified} ]; then
+ if [ ${user_manifest_last_date_modified} -ge ${cache_last_date_modified} ] || [ ${system_manifest_last_date_modified} -ge ${cache_last_date_modified} ]; then
(( 1 ))
else
(( 0 ))
--
2.17.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author