[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "svn info" good return code on bad URL

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2005-10-11 16:21:01 CEST

On Tue, Oct 11, 2005 at 02:54:29PM +0200, Ph. Marek wrote:
> > If warnings yield 1, should errors yield 2?
> Please note that the return code is normally correlated to the system error
> that caused the error, ie.
> > Greg Hudson wrote:
> > > egyptian-gods% tar cvf foo.tar foo blob
> > > tar: foo: Cannot stat: No such file or directory
> > > blob/
> > > tar: Error exit delayed from previous errors
> > > egyptian-gods% echo $status
> > > 2
> 2 == ENOENT == File not found

Sorry, but that's rubbish. I've _never_ seen a program whose exit codes
are just the value of errno. Most follow the convention that "An exit
status of zero indicates success, and a nonzero value indicates failure",
and leave the rest undefined.

For example, tar generally returns zero for success, 2 if "something went
wrong", or 128 for "something remote went wrong". patch returns "0 if
all hunks are applied successfully, 1 if some hunks cannot be applied,
and 2 if there is more serious trouble."

We could either follow the "1 for warning, 2 for error" route that patch
does, or just use 1 for everything. Either would be valid.

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 11 16:22:01 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.