[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: quitting from install scripts



On Thu, Feb 22, 2001 at 11:01:15PM -0500, Matt Zimmerman wrote:
> > > 
> > > I asked a variation on the same question on -devel a few weeks ago, and got
> > > zero responses.  Aborting in the preinst is the only way to do anything
> > > even close, but it makes a bit of a mess.
> > If you want to quit a script, use exit. exit 0 means everything ok, any other
> > value means error.  normally the exit value of the script is the value of the
> > last command which was run, but to be sure to exit cleany you can add exit 0
> > at the end of the script.  Nothing more should you do to 'Error unwind'
> > something, the rest is done by dpkg.
> 
> Yes.  The question was not one of shell programming syntax, it was one of
> Debian packaging.  If a preinst script exits with nonzero status, other
> packages can be left unpacked and unconfigured, and other such unpleasantness.
> 

That's right.  If preinst exits with nonzero, then dpkg unwinds by running
postrm abort-upgrade or abort-install.  I guess you'd have to handle those
cases carefully to wind back the upgrade properly.  Sounds messy to me.

I asked at debian-devel this week and got a response which convinced me not
too provide a "quit" option in the install scripts.  At least in my case, I
don't really need it.

Drew

-- 
PGP public key available at http://dparsons.webjump.com/drewskey.txt
Fingerprint: A110 EAE1 D7D2 8076 5FE0  EC0A B6CE 7041 6412 4E4A



Reply to: