zsh-workers
 help / color / mirror / code / Atom feed
* zrecompile not verbose enough on failure?
@ 2001-10-21 20:42 Adam Spiers
  2001-10-22  1:59 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Spiers @ 2001-10-21 20:42 UTC (permalink / raw)
  To: zsh workers mailing list

Seen in zrecompile:

        if { [[ ! -f $zwc ]] || mv $zwc ${zwc}.old } &&
             zcompile $map $tmp $zwc $files 2> /dev/null; then
          [[ -z $quiet ]] && print succeeded
        else
          [[ -z $quiet ]] && print failed
          ret=1
        fi

Why does zrecompile redirect STDERR to /dev/null when running
zcompile?  It means that if you're doing something like

  zrecompile ... -M -U ~/.zsh/functions.zwc ~/.zsh/functions/*(*)

then if something in ~/.zsh/functions has a syntax error, you just get 

  re-compiling /nfs-home/adams/.zsh/functions.zwc: failed

with no indication of which file was the culprit.


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

* Re: zrecompile not verbose enough on failure?
  2001-10-21 20:42 zrecompile not verbose enough on failure? Adam Spiers
@ 2001-10-22  1:59 ` Bart Schaefer
  2001-10-22 11:29   ` Sven Wischnowsky
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2001-10-22  1:59 UTC (permalink / raw)
  To: zsh-workers

On Oct 21,  9:42pm, Adam Spiers wrote:
}
} Why does zrecompile redirect STDERR to /dev/null when running
} zcompile?

Probably to suppress warning-only messages like

	zcompile: functions will use zsh style autoloading

because zrecompile is intended to run unobtrusively from a .zshrc or the
like; but I agree that it would be nice to see more of the *real* failure
messages from zcompile.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: zrecompile not verbose enough on failure?
  2001-10-22  1:59 ` Bart Schaefer
@ 2001-10-22 11:29   ` Sven Wischnowsky
  2002-03-06 14:43     ` Adam Spiers
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2001-10-22 11:29 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Oct 21,  9:42pm, Adam Spiers wrote:
> }
> } Why does zrecompile redirect STDERR to /dev/null when running
> } zcompile?
> 
> Probably to suppress warning-only messages like
> 
> 	zcompile: functions will use zsh style autoloading
> 
> because zrecompile is intended to run unobtrusively from a .zshrc or the
> like; but I agree that it would be nice to see more of the *real* failure
> messages from zcompile.

Should we make it depend on the -q option?


Bye
  Sven

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


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

* Re: zrecompile not verbose enough on failure?
  2001-10-22 11:29   ` Sven Wischnowsky
@ 2002-03-06 14:43     ` Adam Spiers
  2002-03-07  8:27       ` Sven Wischnowsky
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Spiers @ 2002-03-06 14:43 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky (wischnow@informatik.hu-berlin.de) wrote:
> Bart Schaefer wrote:
> 
> > On Oct 21,  9:42pm, Adam Spiers wrote:
> > }
> > } Why does zrecompile redirect STDERR to /dev/null when running
> > } zcompile?
> > 
> > Probably to suppress warning-only messages like
> > 
> > 	zcompile: functions will use zsh style autoloading
> > 
> > because zrecompile is intended to run unobtrusively from a .zshrc or the
> > like; but I agree that it would be nice to see more of the *real* failure
> > messages from zcompile.
> 
> Should we make it depend on the -q option?

Yes, that would be nicer than my solution, which was

Index: Functions/Misc/zrecompile
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Misc/zrecompile,v
retrieving revision 1.8
diff -u -r1.8 zrecompile
--- Functions/Misc/zrecompile	29 May 2001 17:54:39 -0000	1.8
+++ Functions/Misc/zrecompile	6 Mar 2002 14:40:54 -0000
@@ -129,7 +129,7 @@
 	# old file by renaming it.
 
 	if { [[ ! -f $zwc ]] || mv $zwc ${zwc}.old } &&
-             zcompile $map $tmp $zwc $files 2> /dev/null; then
+             zcompile $map $tmp $zwc $files; then
           [[ -z $quiet ]] && print succeeded
         else
           [[ -z $quiet ]] && print failed


How best to make it depend on -q?  Is it possible to redirect STDERR
to a variable?


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

* Re: zrecompile not verbose enough on failure?
  2002-03-06 14:43     ` Adam Spiers
@ 2002-03-07  8:27       ` Sven Wischnowsky
  2002-03-07 11:43         ` Adam Spiers
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2002-03-07  8:27 UTC (permalink / raw)
  To: zsh-workers


Adam Spiers wrote:

> Sven Wischnowsky (wischnow@informatik.hu-berlin.de) wrote:
> > Bart Schaefer wrote:
> > 
> > > On Oct 21,  9:42pm, Adam Spiers wrote:
> > > }
> > > } Why does zrecompile redirect STDERR to /dev/null when running
> > > } zcompile?
> > > 
> > > Probably to suppress warning-only messages like
> > > 
> > > 	zcompile: functions will use zsh style autoloading
> > > 
> > > because zrecompile is intended to run unobtrusively from a .zshrc or the
> > > like; but I agree that it would be nice to see more of the *real* failure
> > > messages from zcompile.
> > 
> > Should we make it depend on the -q option?
> 
> Yes, that would be nicer than my solution, which was

So, here is my suggestion.  Message printing gets a bit confused in
case of errors from zcompile, but personally, I don't care too much.

Bye
  Sven

Index: Functions/Misc/zrecompile
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Misc/zrecompile,v
retrieving revision 1.8
diff -u -r1.8 zrecompile
--- Functions/Misc/zrecompile	29 May 2001 17:54:39 -0000	1.8
+++ Functions/Misc/zrecompile	7 Mar 2002 08:27:29 -0000
@@ -128,11 +128,13 @@
         # If the file is mapped, it might be mapped right now, so keep the
 	# old file by renaming it.
 
-	if { [[ ! -f $zwc ]] || mv $zwc ${zwc}.old } &&
-             zcompile $map $tmp $zwc $files 2> /dev/null; then
-          [[ -z $quiet ]] && print succeeded
-        else
-          [[ -z $quiet ]] && print failed
+	if [[ -z "$quiet" ]] &&
+           { [[ ! -f $zwc ]] || mv $zwc ${zwc}.old } &&
+           zcompile $map $tmp $zwc $files; then
+          print succeeded
+	elif ! { { [[ ! -f $zwc ]] || mv $zwc ${zwc}.old } &&
+                 zcompile $map $tmp $zwc $files 2> /dev/null } then
+          [[ -z $quiet ]] && print "re-compiling ${zwc}: failed"
           ret=1
         fi
       fi
@@ -230,10 +232,13 @@
         # If the file is mapped, it might be mapped right now, so keep the
 	# old file by renaming it.
 
-	if mv $zwc ${zwc}.old && zcompile $map $zwc $files 2> /dev/null; then
-          [[ -z $quiet ]] && print $mesg
-        else
-          [[ -z $quiet ]] && print failed
+	if [[ -z "$quiet" ]] &&
+           mv $zwc ${zwc}.old &&
+           zcompile $map $zwc $files; then
+          print $mesg
+	elif ! { mv $zwc ${zwc}.old &&
+                 zcompile $map $zwc $files 2> /dev/null } then
+          [[ -z $quiet ]] && print "re-compiling ${zwc}: failed"
           ret=1
         fi
       fi

-- 
Sven Wischnowsky                          wischnow@berkom.de


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

* Re: zrecompile not verbose enough on failure?
  2002-03-07  8:27       ` Sven Wischnowsky
@ 2002-03-07 11:43         ` Adam Spiers
  0 siblings, 0 replies; 6+ messages in thread
From: Adam Spiers @ 2002-03-07 11:43 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky (wischnow@berkom.de) wrote:
> So, here is my suggestion.  Message printing gets a bit confused in
> case of errors from zcompile, but personally, I don't care too much.

It's good enough for me too.  Thanks!


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

end of thread, other threads:[~2002-03-07 11:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-21 20:42 zrecompile not verbose enough on failure? Adam Spiers
2001-10-22  1:59 ` Bart Schaefer
2001-10-22 11:29   ` Sven Wischnowsky
2002-03-06 14:43     ` Adam Spiers
2002-03-07  8:27       ` Sven Wischnowsky
2002-03-07 11:43         ` Adam Spiers

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