From: Felix Rosencrantz <f_rosencrantz@yahoo.com>
To: zsh-workers@sunsite.auc.dk
Subject: adding mkdir to _store_cache
Date: Mon, 9 Sep 2002 07:43:47 -0700 (PDT) [thread overview]
Message-ID: <20020909144347.76540.qmail@web10403.mail.yahoo.com> (raw)
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
next reply other threads:[~2002-09-09 14:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-09 14:43 Felix Rosencrantz [this message]
2002-09-09 16:23 ` Bart Schaefer
2002-09-11 10:16 ` Felix Rosencrantz
2002-09-11 13:14 ` DervishD
2002-09-11 13:13 ` Peter Stephenson
2002-09-11 14:15 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020909144347.76540.qmail@web10403.mail.yahoo.com \
--to=f_rosencrantz@yahoo.com \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).