Re: [Maria-developers] Rev 2746: Fix mysql-test-run on windows: in file:///home/psergey/bzr-new/mysql-5.1-maria-contd4/

2009-09-17 Thread Kristian Nielsen
Sergey Petrunya pser...@askmonty.org writes:

 At file:///home/psergey/bzr-new/mysql-5.1-maria-contd4/

 
 revno: 2746
 revision-id: pser...@askmonty.org-20090917001350-pyxja2suxylxhez1
 parent: pser...@askmonty.org-20090916190503-kgckwua1roxhonsy
 committer: Sergey Petrunya pser...@askmonty.org
 branch nick: mysql-5.1-maria-contd4
 timestamp: Thu 2009-09-17 04:13:50 +0400
 message:
   Fix mysql-test-run on windows:
   - Make it not to add '--console' when '--log-error' option is present
 === modified file 'mysql-test/mysql-test-run.pl'
 --- a/mysql-test/mysql-test-run.pl2009-09-15 10:46:35 +
 +++ b/mysql-test/mysql-test-run.pl2009-09-17 00:13:50 +
 @@ -4433,7 +4433,9 @@
if (IS_WINDOWS)
{
  # Trick the server to send output to stderr, with --console
 -mtr_add_arg($args, --console);
 +if (!(join(' ', @$args) =~ /--log-error/)) {
 +  mtr_add_arg($args, --console);
 +}

There is no need to create a joined string to grep here. It can be simplified
like this:

if (!(grep(/^--log-error/, @$args))) { ... }

or, if you really want to catch _all_ occurences of --log-error (including
--tmpdir=/var/--log-error/tmp), then this:

if (!(grep(/--log-error/, @$args))) { ... }

Hope this helps,

 - Kristian.

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Rev 2746: Fix mysql-test-run on windows: in file:///home/psergey/bzr-new/mysql-5.1-maria-contd4/

2009-09-17 Thread Sergey Petrunya
On Thu, Sep 17, 2009 at 08:24:42AM +0200, Kristian Nielsen wrote:
 Sergey Petrunya pser...@askmonty.org writes:
 
  At file:///home/psergey/bzr-new/mysql-5.1-maria-contd4/
 
  
  revno: 2746
  revision-id: pser...@askmonty.org-20090917001350-pyxja2suxylxhez1
  parent: pser...@askmonty.org-20090916190503-kgckwua1roxhonsy
  committer: Sergey Petrunya pser...@askmonty.org
  branch nick: mysql-5.1-maria-contd4
  timestamp: Thu 2009-09-17 04:13:50 +0400
  message:
Fix mysql-test-run on windows:
- Make it not to add '--console' when '--log-error' option is present
  === modified file 'mysql-test/mysql-test-run.pl'
  --- a/mysql-test/mysql-test-run.pl  2009-09-15 10:46:35 +
  +++ b/mysql-test/mysql-test-run.pl  2009-09-17 00:13:50 +
  @@ -4433,7 +4433,9 @@
 if (IS_WINDOWS)
 {
   # Trick the server to send output to stderr, with --console
  -mtr_add_arg($args, --console);
  +if (!(join(' ', @$args) =~ /--log-error/)) {
  +  mtr_add_arg($args, --console);
  +}
 
 There is no need to create a joined string to grep here. It can be simplified
 like this:
 
 if (!(grep(/^--log-error/, @$args))) { ... }
 
 or, if you really want to catch _all_ occurences of --log-error (including
 --tmpdir=/var/--log-error/tmp), then this:
 
 if (!(grep(/--log-error/, @$args))) { ... }

Addressed, thanks.

BR
 Sergey
-- 
Sergey Petrunia, Software Developer
Monty Program AB, http://askmonty.org
Blog: http://s.petrunia.net/blog

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp