From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: z(re)compile and deleted files
Date: Tue, 2 May 2000 13:31:17 +0200 (MET DST) [thread overview]
Message-ID: <200005021131.NAA02737@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Tue, 2 May 2000 13:41:52 +0400
Andrej Borsenkow wrote:
> Once again - there is currently no easy way to remove defenition of
> deleted function from wordcode file. I'm using zrecompile -p as
> suggested - and just now I deleted _bunzip2, run zrecompile (with small
> wrapper) - and of course, _bunzip2 remained in wordcode file.
>
> my function is:
>
> #!/tools/bin/zsh -f
> autoload -U zrecompile
> zrecompile -p -- ~/.zsh.d/std-$ZSH_VERSION.zwc
> /tools/share/zsh/$ZSH_VERSION/functions/*/*(^/)
>
> and when I run it nothing happens at all.
Uh oh. Yes. Forgot that.
This will make it recompile the zwc file if the number of files in it
is different from the number of files that should go in it.
> BTW completion for zcompile does not list -t option (at least).
Eh? From builtins.yo:
The third form, with the tt(-t) option, examines an existing
compiled file. Without further arguments, the names of the original
files compiled into it are listed. The first line of output tells
the version of the shell which compiled the file and how the file
will be used (mapping or reading the file). With arguments, nothing
is output and the return value is set to zero if em(all) var(name)s
name files contained in the wordcode file, and non-zero if at least
one var(name) is not contained in it.
The itemised list contains only `other options'.
Bye
Sven `it wasn't me, Bart wrote that ;-)' W.
Index: Functions/Misc/zrecompile
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Misc/zrecompile,v
retrieving revision 1.3
diff -u -r1.3 zrecompile
--- Functions/Misc/zrecompile 2000/04/20 12:45:21 1.3
+++ Functions/Misc/zrecompile 2000/05/02 11:28:09
@@ -53,7 +53,7 @@
fi
if [[ -n $pats ]]; then
- local end
+ local end num
while (( $# )); do
end=$argv[(i)--]
@@ -84,13 +84,18 @@
(( $#files )) || files=( ${zwc%.zwc} )
if [[ -f $zwc ]]; then
- re=
- for file in $files; do
- if [[ $file -nt $zwc ]]; then
- re=yes
- break
- fi
- done
+ num=$(zcompile -t $zwc | wc -l)
+ if [[ num-1 -ne $#files ]]; then
+ re=yes
+ else
+ re=
+ for file in $files; do
+ if [[ $file -nt $zwc ]]; then
+ re=yes
+ break
+ fi
+ done
+ fi
else
re=yes
fi
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-05-02 11:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-02 11:31 Sven Wischnowsky [this message]
2000-05-02 12:16 ` Andrej Borsenkow
2000-05-03 12:17 ` Andrej Borsenkow
2000-05-02 17:44 ` Bart Schaefer
2000-05-03 12:27 Sven Wischnowsky
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=200005021131.NAA02737@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--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).