bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cygwin results and help-version


From: Jim Meyering
Subject: Re: cygwin results and help-version
Date: Thu, 18 Mar 2010 18:26:22 +0100

Paolo Bonzini wrote:
> Since I had to reboot to Windows I gave a try at the grep snapshot
> under Cygwin.  I have Cygwin 1.5.25.  All grep tests passed except:
>
> - fmbtest.sh and euc-mb which were skipped

Thanks for checking!

> - help-version which failed because the sleep process created when
> setting up kill_args keeps the $tmp directory busy and then it
> cannot be removed.
>
> The attached patch fixes this, using shell functions to do any
> required setup only as requested.  Would it be ok for coreutils?

Thanks for the testing, though note that in general we avoid
spending time catering to older Cygwin, mainly because it's
so easy to tell people to upgrade.

I do like the idea of using per-program functions, rather than
per-program shell variables.
However, the current set-up does not require one to define prog_args,
but your revised usage does require that there exist a prog_setup
function for each "prog":

    ./misc/help-version: line 508: base64_setup: command not found
    base64: extra operand `:'
    Try `base64 --help' for more information.
    FAIL: base64
    ./misc/help-version: line 508: cat_setup: command not found
    ./misc/help-version: line 508: cksum_setup: command not found
    ./misc/help-version: line 508: date_setup: command not found
    date: `1': No such file or directory
    FAIL: date
    0+1 records in
    0+1 records out
    ./misc/help-version: line 508: dir_setup: command not found
    ./misc/help-version: line 508: dircolors_setup: command not found
    ./misc/help-version: line 508: du_setup: command not found
    ./misc/help-version: line 508: echo_setup: command not found
    ./misc/help-version: line 508: env_setup: command not found
    ...

If you address that and reformat definitions
so that they're still one-liners, like this:

    comm_setup () { args="$tmp_in $tmp_in"; }

it'll look a lot more like an improvement over the original.

> diff --git a/tests/help-version b/tests/help-version
> index 21841e4..065bb05 100755
> --- a/tests/help-version
> +++ b/tests/help-version
> @@ -116,107 +116,375 @@ tmp_out=out-$$
>  mkdir $tmp || fail=1
>  cd $tmp || fail=1
>
> -comm_args="$tmp_in $tmp_in"
> -csplit_args="$tmp_in //"
> -cut_args='-f 1'
> -join_args="$tmp_in $tmp_in"
> -tr_args='a a'
> +comm_setup ()
> +{
> +  args="$tmp_in $tmp_in"
> +}
> +
> +csplit_setup ()
> +{
> +  args="$tmp_in //"
> +}
> +
> +cut_setup ()
> +{
> +  args='-f 1'
> +}
> +
> +join_setup ()
> +{
> +  args="$tmp_in $tmp_in"
> +}
> +
> +tr_setup ()
> +{
> +  args='a a'
> +}
> +
> +
> +chmod_setup ()
> +{
> +  args="a+x $tmp_in"
> +}
...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]