Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
adding mkdir to _store_cache
- X-seq: zsh-workers 17640
- From: Felix Rosencrantz <f_rosencrantz@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: adding mkdir to _store_cache
- Date: Mon, 9 Sep 2002 07:43:47 -0700 (PDT)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Would anyone object to adding an additional mkdir to the _store_cache function.
This would allow a cache identifier to contain slashes, basically a simple
attempt at having caches that can be per file.
Here is the suggested patch.
-FR.
Index: Completion/Base/Utility/_store_cache
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_store_cache,v
retrieving revision 1.2
diff -u -r1.2 _store_cache
--- Completion/Base/Utility/_store_cache 16 Apr 2002 07:48:45 -0000 1.2
+++ Completion/Base/Utility/_store_cache 9 Sep 2002 02:19:26 -0000
@@ -2,7 +2,7 @@
#
# Storage component of completions caching layer
-local _cache_ident
+local _cache_ident _cache_ident_dir
_cache_ident="$1"
if zstyle -t ":completion:${curcontext}:" use-cache; then
@@ -20,6 +20,21 @@
fi
fi
fi
+ _cache_ident_dir="$_cache_dir/$_cache_ident"
+ _cache_ident_dir="$_cache_ident_dir:h"
+
+ if [[ ! -d "$_cache_ident_dir" ]]; then
+ if [[ -e "$_cache_ident_dir" ]]; then
+ _message "cache ident dir points to a non-directory:$_cache_ident_dir"
+ else
+ mkdir -p "$_cache_ident_dir"
+ if [[ ! -d "$_cache_ident_dir" ]]; then
+ _message "couldn't create cache-ident_dir $_cache_ident_dir"
+ return 1
+ fi
+ fi
+ fi
+
shift
for var; do
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author