This is the mail archive of the cygwin-apps@cygwin.com 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]

Setup postinstall logging (was Re: Pending setup patches (issue 2))


On 10 Mar 2003, Robert Collins wrote:

> On Wed, 2003-03-05 at 11:52, Igor Pechtchanski wrote:
> > On 5 Mar 2003, Robert Collins wrote:
>
> > > Other than that, please expand to address all scripts.
> > > Rob
> >
> > Rob,
> >
> > There is a design issue here that I'd like to address before I work more
> > on this.  I recall your comment that this should be tied into the logging
> > subsystem.  Unfortunately, this would involve a much more complex code,
> > with pipes and forks.  The same is true if we want "tee"-like behavior,
> > i.e. windows popping up *and* output going to a file.  The way this is
> > implemented now is the output stream of the script process is tied to a
> > file, but the limitation is that the file is written right away.  Do we
> > want a more complex design now, or should I just allow running a generic
> > script with output going to a file (for the moment)?
> >       Igor
>
> Hmm, I'd like the following idiom:
> generate to a file.
> copy the file into the log buffer.
>
> That will get the postinstall scripts into the log.
>
> Howabout that?
> Rob

Ok, here's the next iteration of this patch.  It still pops a console with
nothing in it when running postinstall scripts -- I'm sure there's a way
to remove it, but can't find it at the moment.  It does, however,
correctly redirect the output of postinstall scripts into the LOG_BABBLE
file.  Most of the patch is OS-independent, but the output redirection
mechanism has been tested on Win95 by Brian Keener (see
<http://cygwin.com/ml/cygwin-apps/2003-03/msg00364.html>) and hasn't been
changed in this patch.
	Igor
P.S. Note that this patch conflicts slightly with my other patch
(postinstall script ordering).  Nothing a human can't fix, but both at
once will not apply cleanly OOTB.  Whichever one of them goes in first,
I'll regenerate and resubmit the other one.
==============================================================================
ChangeLog:
2003-03-13  Igor Pechtchanski <pechtcha at cs dot nyu dot edu>

	* script.cc (run): Add lname parameter.
	Redirect output of subprocess to file, creating the
	path if necessary.
	(run_script): Add optional to_log boolean parameter.
	If to_log, redirect output to temporary file.
	(openOutputLog): New helper function.
	(closeOutputLog): New helper function.
	(removeOutputLog): New helper function.
	* script.h (run_script): Add optional to_log parameter.
	* log.h (log_file): New function.
	* log.cc (log_file): New Function
	(BUFLEN): New #define.
	* postinstall.cc (RunFindVisitor::visitFile): Pass
	filename to run_script().

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha at cs dot nyu dot edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor at watson dot ibm dot com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune

Attachment: setup-postinstall-log.patch
Description: Text document


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