[PATCH] setup: fix abnormal exit test for postinstall scripts

Igor Peshansky pechtcha@cs.nyu.edu
Thu Mar 9 23:49:00 GMT 2006

On Thu, 9 Mar 2006, Dave Korn wrote:

> On 09 March 2006 23:14, Max Bowsher wrote:
> >>> 	* script.cc (Script::run): Fix inverted test for abnormal exit.
> >>> 	Do not rename to ".done" unless completed successfully.
> >>
> >> And ping (attached as "setup-script-exit-code-fix.patch").
> >
> > Do we necessarily want to try to re-run failed scripts the next time
> > setup installs some packages?

Why not?  It would make recovery from a hosed install because of in-use
DLLs easy enough -- just re-run setup and select "Keep", which will only
rerun the postinstall scripts.

> > Perhaps renaming to ".failed" would be better that not renaming.
> >
> > Max.
>   Perhaps setup should check when you first start it up whether there
> are any postinstall scripts left lying around from last time and offer
> to run them for you then and there?  Failed postinstalls should be run
> to completion *before* next updating the package!

Why?  I'm not so certain.  So your preremove will fail -- who cares, it
would also fail if "cygwin" is upgraded and is uninstalled before the
preremove script is run.  Next time you upgrade, it'll be like the initial
install all over again, and the *new* postinstall will run.  If you didn't
touch the package, however, the postinstall that failed before will be
re-run.  If it failed because of something in the environment when setup
was run (e.g., a stale DLL in memory), it will now succeed and will be
renamed to .done.  If it fails again, we'll know something was wrong, and
will recommend looking at the output in setup.log.full.
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

More information about the Cygwin-apps mailing list