[Aptitude-devel] Please review: proposed changes to aptitude error reporting

Roger Leigh rleigh at codelibre.net
Fri Jun 8 15:15:36 BST 2012


On Fri, Jun 08, 2012 at 09:55:03PM +0800, Daniel Hartwig wrote:
> Effectively, all errors are now reported and the exit status is well-defined:
> 
>  0: success
>  1: user aborted or no matches (with search, for example)
>  2: error, but not fatal; some actions may have been effective
>  255: fatal error; no actions effective

This is a big improvement, thanks.

> For example, aptitude install may fail to download some packages but
> still manage to install others.  In this case a non-fatal error has
> occured (non-fatal because some actions did succeed) and the exit
> status is 2.  However, the exit status of 2 does not indicate that any
> actions did succeed, only that some may have.

This is still, from my POV a fatal error.  It failed to do what I
asked.  From the sbuild POV, when we ask aptitude to install
build dependencies, we only want success when every one of those
is installed and configured.  Anything less than that is a failure.
If it managed to install some of them, that's great, but it's still
a failure.  Having a special return code for this situation is fine,
so long as it's not success ;-)

(Currently in sbuild we can't use the aptitude resolver due to this
unreliability--we have no way of detecting failure until the build
fails at some point, which can even result in silent misbuilds if
it's not fatal.)

> The alternative to this, as suggested by one commenter, is to copy
> apt-get exit codes:
> 
>  0: success or no matches (apt-cache search)
>  1: user aborted
>  100: any kind of error
> 
> This is useful, but does not distinguish between fatal and non-fatal
> errors where some actions have succeeded (such as with apt-get install
> --fix-missing).

I'm happy with either arrangement, since for sbuild we really only
care about complete success or failure, which both schemes satisfy
nicely.


Thanks for all your effort on this,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800



More information about the Aptitude-devel mailing list