zsh-workers
 help / color / mirror / code / Atom feed
* RE: PATCH: Re: z(re)compile and deleted files
@ 2000-05-03 12:27 Sven Wischnowsky
  0 siblings, 0 replies; 5+ messages in thread
From: Sven Wischnowsky @ 2000-05-03 12:27 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> X-Seq: 11111

;-)

> > I said "completion" not "manual" :-) Patch follows. "examine wordcode
> > file" is not probably the best description - any takers?
> > 
> 
> Ehem ... was the patch wrong? Else would somebody commit it?

I've committed it now with a slightly different description because we 
tried to avoid the word `wordcode'. In most places. I think.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: PATCH: Re: z(re)compile and deleted files
  2000-05-02 12:16 ` Andrej Borsenkow
@ 2000-05-03 12:17   ` Andrej Borsenkow
  0 siblings, 0 replies; 5+ messages in thread
From: Andrej Borsenkow @ 2000-05-03 12:17 UTC (permalink / raw)
  To: zsh-workers

> 
> I said "completion" not "manual" :-) Patch follows. "examine wordcode
> file" is not probably the best description - any takers?
> 

Ehem ... was the patch wrong? Else would somebody commit it?

thnx

-andrej


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Re: z(re)compile and deleted files
  2000-05-02 11:31 Sven Wischnowsky
  2000-05-02 12:16 ` Andrej Borsenkow
@ 2000-05-02 17:44 ` Bart Schaefer
  1 sibling, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2000-05-02 17:44 UTC (permalink / raw)
  To: zsh-workers

On May 2,  1:31pm, Sven Wischnowsky wrote:
} Subject: PATCH: Re: z(re)compile and deleted files
}
} Eh? From builtins.yo:
} 
} The third form, with the tt(-t) option, examines an existing
} compiled file.  [...]
} 
} The itemised list contains only `other options'.
} 
} Bye
}  Sven `it wasn't me, Bart wrote that ;-)' W.

I was tempted to treat it the way "zmodload" is done with sub-headings for
each form, but ... I didn't.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: PATCH: Re: z(re)compile and deleted files
  2000-05-02 11:31 Sven Wischnowsky
@ 2000-05-02 12:16 ` Andrej Borsenkow
  2000-05-03 12:17   ` Andrej Borsenkow
  2000-05-02 17:44 ` Bart Schaefer
  1 sibling, 1 reply; 5+ messages in thread
From: Andrej Borsenkow @ 2000-05-02 12:16 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

>
> 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.
>

And if somebody adds one file while removing the other? O.K. new one
should be newer than wordcode file ... let's see.

> > BTW completion for zcompile does not list -t option (at least).
>
> Eh? From builtins.yo:
>

I said "completion" not "manual" :-) Patch follows. "examine wordcode
file" is not probably the best description - any takers?


[-- Attachment #2: _zcompile.diff --]
[-- Type: application/octet-stream, Size: 1057 bytes --]

--- Completion/Builtins/_zcompile.org	Tue Apr 11 12:59:19 2000
+++ Completion/Builtins/_zcompile	Tue May  2 16:07:29 2000
@@ -4,14 +4,15 @@
 typeset -A opt_args
 
 _arguments -s \
-    '(-c -m -a)-U[don'\''t expand aliases]' \
-    '(-M)-R[mark as read]' \
-    '(-R)-M[mark as mapped]' \
-    '(-c -z -m -a)-k[ksh-style autoloading]' \
-    '(-c -k -m -a)-z[zsh-style autoloading]' \
-    '(-U -z -k)-c[currently defined functions]' \
-    '(-U -z -k)-m[use names as patterns]' \
-    '(-U -z -k)-a[write autoload functions]' \
+    '(-t -c -m -a)-U[don'\''t expand aliases]' \
+    '(-t -M)-R[mark as read]' \
+    '(-t -R)-M[mark as mapped]' \
+    '(-t -c -z -m -a)-k[ksh-style autoloading]' \
+    '(-t -c -k -m -a)-z[zsh-style autoloading]' \
+    '(-t -U -z -k)-c[currently defined functions]' \
+    '(-t -U -z -k)-m[use names as patterns]' \
+    '(-t -U -z -k)-a[write autoload functions]' \
+    '(-M -R -U -z -k -a -c -m)-t[examine wordcode file]' \
     ':zwc file:_files' \
     '*:function:->function' && return 0
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* PATCH: Re: z(re)compile and deleted files
@ 2000-05-02 11:31 Sven Wischnowsky
  2000-05-02 12:16 ` Andrej Borsenkow
  2000-05-02 17:44 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Sven Wischnowsky @ 2000-05-02 11:31 UTC (permalink / raw)
  To: zsh-workers


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-05-03 12:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-03 12:27 PATCH: Re: z(re)compile and deleted files Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-05-02 11:31 Sven Wischnowsky
2000-05-02 12:16 ` Andrej Borsenkow
2000-05-03 12:17   ` Andrej Borsenkow
2000-05-02 17:44 ` Bart Schaefer

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).