From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8046 invoked from network); 7 Mar 2002 08:29:50 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 7 Mar 2002 08:29:50 -0000 Received: (qmail 28021 invoked by alias); 7 Mar 2002 08:29:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16774 Received: (qmail 28009 invoked from network); 7 Mar 2002 08:29:40 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15495.9356.955445.827550@wischnow.berkom.de> Date: Thu, 7 Mar 2002 09:27:56 +0100 To: zsh-workers@sunsite.dk Subject: Re: zrecompile not verbose enough on failure? In-Reply-To: <20020306144310.A21102@corelli.new.ox.ac.uk> References: <20011021214251.A31530@thelonious.new.ox.ac.uk> <1011022015957.ZM15484@candle.brasslantern.com> <15316.806.28762.457890@gargle.gargle.HOWL> <20020306144310.A21102@corelli.new.ox.ac.uk> X-Mailer: VM 6.95 under 21.5 (patch 3) "asparagus" XEmacs Lucid 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