Setup patch to keep test version if test version installed

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Feb 4 10:20:00 GMT 2015


On Feb  4 10:01, Corinna Vinschen wrote:
> On Feb  3 22:27, Corinna Vinschen wrote:
> > On Feb  3 22:04, Corinna Vinschen wrote:
> > > On Feb  3 21:37, Achim Gratz wrote:
> > > > I'm not sure we're talking about the same thing.  I've recently added
> > > > code to print an error message along with the parameter usage when a
> > > > wrong option or other non-parseable stuff was given instead of simply
> > > > exiting with no indication other than the non-zero exit code.  The
> > > > changes you've just installed look good to me, but they don't touch the
> > > > exit path in question:
> > > > [...]
> > > > I guess with those changes one could now use Log (LOG_TIMESTAMP) instead
> > > > of cerr in that place and hopefully the output would appear again?  I
> > > > was pretty certain I tested that in both mintty and CMD, but maybe
> > > > not...
> > > 
> > > I was referring explicitely to the CMD prompt being too early.  I didn't
> > > test the situation when specifying a wrong option, sorry.  The point in
> > > the file where this occurs is somewhat early.  At this point the log
> > > stuff isn't initialized and AttachConsole hasn't been called.  I'll 
> > > look into that, maybe it can be fixed easily.
> > 
> > Try this:
> 
> On second thought, this is still unclean.  What bugs me is that the
> behaviour of LogFile::exit is not easier conditionalized.  I'm going
> to change LogFile::exit to something like this:
> 
>   LogFile::exit (int exit_code, bool show_end_of_install_msg)
> 
> This allows to separate printing the "Ending cygwin install" message
> from the exit_code and so we can exit with a non-zero exit code *and*
> skip showing the message.  Hang on for a bit...

I just applied a bigger patch, which not only changed exit, but the way
how the actual LogFile instance gets accessed in general.  I removed the
variable theLog entirely and now, rather than

  LogSingleton::GetInstance ().exit (1);

or

  extern LogFile *theLog;
  theLog->exit (1);

you can simply use the macro Logger:

  Logger ().exit (1);

I also moved the global variable exit_msg into the LogFile class as
static, protected variable, and now you access it via

  Logger ().setExitMsg (42);
  Logger ().getExitMsg ();

This is much cleaner IMHO.


Please give it a try.  For your convenience I created test releases again:

  https://cygwin.com/setup-test-x86.exe
  https://cygwin.com/setup-test-x86_64.exe


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20150204/0e03b876/attachment.sig>


More information about the Cygwin-apps mailing list