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]

[PATCH] Setup postinstall logging - take X+1


On Sun, 16 Mar 2003, Robert Collins wrote:

> Igor Pechtchanski wrote:
> > Sorry for the '?' in the subject - I think I lost track...

Starting a new count here... :-)

> > On 15 Mar 2003, Robert Collins wrote:
>
> >>Don't worry. What would be good would be to make it start minimized.
>
> ...
>
> > Ok, I've figured out how to hide the console altogether (see attached
> > patch, though the CREATE_NO_WINDOW is probably overkill).  Could someone
> > familiar with the Windows CreateProcess mechanism make sure this is ok?
> > Also, this needs testing on Win95 again.  Brian?
> >
> > On another note, now that the window is not shown at all, setup simply
> > seems to hang while long-running postinstall scripts (e.g., post-texmf.sh,
> > with run-time of ~2 minutes!) are executed.  Perhaps we should a) run
> > postinstall scripts from a separate thread, so that setup at least reacts
> > to Windows events, such as REPAINT, and b) have another dialog saying
> > "Running postinstall scripts", perhaps even with a progress bar (even if
> > the bar only reflects progress by scripts executed rather than time -- I'm
> > not sure if it's even possible to correctly reflect temporal progress).
>
> That would be nice. A trivial step to take is to minimize, not hide, the
> window. Then the user will see flicky things happening in their tool
> bar, which may reduce the panic.

Ok, done.  The windows won't be "flicky", though (a long-running script
window will still look hung), and they won't show anything.  Good enough
for now, I guess.

> > The new one conflicts both with the above and with the cleanup patch I
> > posted today...  Unless some of them are committed, it's going to get
> > hairy fast, eh, Rob? ;-)
>
> Nay. You'll want to merge in the HEAD script.cc changes though.

Yep.

> >>>      If to_log, redirect output to temporary file.
> >>>      (openOutputLog): New helper function.
> >>
> >>This should return void and throw an exception on failure...
> >>OR
> >>use a class and set a status member.
> >
> > Ok.  I've created an OutputLog class that encapsulates this behavior.
> > I've put the Close() into the destructor.  Hopefully this is what you
> > meant.
>
> Yep, looking good.
>
> >>The define BUFLEN should be a static const member of the class.
> >
> > Umm, which class?  It's only used in static functions.  I left it as a
> > #define for now.
>
> Err just realised. log.h and log.cc are deprecated. Thats why they have
> the foo_bar naming style and no classes. It's probably best as an
> operator for OutputLog (given that it's a layer on top of the log
> infrastructure) - i.e.
> LogSingleton::GetInstance()(LOG_PLAIN) << file_out;
> And removing the logfile then becomes part of OutputLog::~OutputLog. Hey
> this is starting to be too easy :}.

Done.  Also upgraded to call the current interface instead of the
deprecated one.

> > Thanks, but I think this needs testing on Win95 again (for the
> > CreateProcess magic).
>
> Ok.
>
> Can you make the window minimized, not hidden? Otherwise we should put
> the requisite UI changes in place first.
> Rob

Did that.  However, I've "#if 0"'d the correct code, and left a TODO
there -- I'd like to keep that in place until the UI changes are in.
An orthogonal change would be to run the scripts from another thread.
I'll look into that (separately).  This patch is ready to go in as-is,
though (the non-"#if 0"'d portion *should* work on Win95, according to
MSDN).
	Igor
==============================================================================
ChangeLog:
2003-03-18  Igor Pechtchanski <pechtcha at cs dot nyu dot edu>

	* script.cc (run): Add file_out parameter.
	Redirect output of subprocess to file, creating the
	path if necessary.  Minimize the script window.
	(run_script): Add optional to_log boolean parameter.
	If to_log, redirect output to temporary file and then
	import it into LOG_BABBLE.
	(OutputLog): New helper class.
	(operator<<): New operation on OutputLog.
	* script.h (run_script): Add optional to_log parameter.
	* postinstall.cc (RunFindVisitor::visitFile): Instruct
	run_script() to log script output.
	(do_postinstall): Ditto.

-- 
				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]