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]

Re: [PATCH] Allow logging of {pre,post}remove scripts


On 1 Apr 2003, Robert Collins wrote:

> On Tue, 2003-04-01 at 09:31, Igor Pechtchanski wrote:
>
> > Rob,
> >
> > The reason I wanted to keep the to_log parameter is that I wanted to keep
> > the code around that directs output to console.  If there are no
> > objections, I'll just make the default value of to_log TRUE, and remove
> > the third parameter from the calls.  I'd like to keep the parameter for
> > now, though.
>
> We're not using that plain code today.
>
> CVS will keep it forever, but I don't want setup kept more complex than
> it needs to be.
>
> Here are some options I'll accept:
> option A) Make output a Strategy of the script object. Allow the output
> strategy to determine window sizing and logging (or not). (This would
> probably be three patchs:
> patch 1)
>  - Extend Script to have more responsibilities from the non OOP script
> code.
> patch 2)
>  - Give it a base strategy class for logging, containing the current if
> (to_log) conditionals, and a boolean in the constructor.
> patch 3)
>  - Create a subclass of the strategy for logging to files.
>  - Create another subclass for logging to console.
>  - Make the base strategy methods pure virtual as appropriate.
>  - Only link in the log to file strategy.
>
> option B) Strip out the unused code.
>
> Leaving the code there, simply so that it's there doesn't make sense.
> I'll accept 'leave it there so we can do X in the future' - in which
> case option A above is an easy path to separate out the two bits of code
> and allow X. But leaving it there for no purpose doesn't make sense to
> me.
>
> Rob

I agree with the sentiment above.  I also think that moving all the static
functionality into the Script class is the way to go.  However, as spare
time is sparse these days, I probably won't get to it for a bit.  In the
meantime, the attached patch provides logging for preremove script in a
minimal way.
	Igor
==============================================================================
ChangeLog:
2003-03-31  Igor Pechtchanski  <pechtcha at cs dot nyu dot edu>

	* script.cc (try_run_script): Pass TRUE 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!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II

Attachment: setup-preremove-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]