This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Mon, 23 Jan 2006, Igor Peshansky wrote:

> Just noticed that the postinstall mechanism in setup inverts the test for
> abnormal exit.  The attached one-liner patch fixes that.  ChangeLog below.

Dave's advice in <http://cygwin.com/ml/cygwin/2006-01/msg01475.html>, made
me realize that setup will always rename the script to ".done", even if it
didn't complete properly (i.e., exited with a non-zero exit code).  Now
that we detect the code correctly, let's also use that to not rename
failed scripts for easier detection (patch attached).  ChangeLog below.

Note that this will put a bit of extra burden on package maintainers to
ensure that their scripts always return a zero exit code.  Most scripts
already do that, though.
	Igor
==============================================================================
2006-01-31  Igor Peshansky  <pechtcha@cs.nyu.edu>

	* script.cc (Script::run): Fix inverted test for abnormal exit.
	Do not rename to ".done" unless completed successfully.

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    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"

Attachment: setup-script-exit-code-fix.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]