From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11781 invoked from network); 2 May 2000 11:31:55 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 May 2000 11:31:55 -0000 Received: (qmail 12260 invoked by alias); 2 May 2000 11:31:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11061 Received: (qmail 12209 invoked from network); 2 May 2000 11:31:29 -0000 Date: Tue, 2 May 2000 13:31:17 +0200 (MET DST) Message-Id: <200005021131.NAA02737@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Tue, 2 May 2000 13:41:52 +0400 Subject: PATCH: Re: z(re)compile and deleted files 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