diff mbox

[v2,1/1] configure: unset interfering variables

Message ID 1401273557-6578-2-git-send-email-cornelia.huck@de.ibm.com
State New
Headers show

Commit Message

Cornelia Huck May 28, 2014, 10:39 a.m. UTC
The check for big or little endianness relies on grep reporting
match/non-match on the generated binary. If the user specified
--binary-files=without-match in their GREP_OPTIONS, this will fail.

Let's follow what autoconf does and unset GREP_OPTIONS and CLICOLOR_FORCE
at the beginning of the script.

Reported-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 configure | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Eric Blake May 28, 2014, 12:19 p.m. UTC | #1
On 05/28/2014 04:39 AM, Cornelia Huck wrote:
> The check for big or little endianness relies on grep reporting
> match/non-match on the generated binary. If the user specified
> --binary-files=without-match in their GREP_OPTIONS, this will fail.
> 
> Let's follow what autoconf does and unset GREP_OPTIONS and CLICOLOR_FORCE
> at the beginning of the script.
> 
> Reported-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> ---
>  configure | 5 +++++
>  1 file changed, 5 insertions(+)

> 
> diff --git a/configure b/configure
> index 0e516f9..525da56 100755
> --- a/configure
> +++ b/configure
> @@ -3,6 +3,11 @@
>  # qemu configure script (c) 2003 Fabrice Bellard
>  #
>  
> +# Unset some variables known to interfere with behavior of common tools,
> +# just as autoconf does.
> +CLICOLOR_FORCE= GREP_OPTIONS=
> +unset CLICOLOR_FORCE GREP_OPTIONS

Autoconf does it in two steps to work around a bug in bash 2 where
unsetting a variable that is not set would crash bash.  But these days,
all shells on all systems where qemu is compiled don't have that bug.
You could drop the 'CLICOLOR_FORCE= GREP_OPTIONS=' line with no negative
effect, other than a future reader wondering why you differ from
autoconf.  So I don't care if you keep it in.

Reviewed-by: Eric Blake <eblake@redhat.com>
Cornelia Huck June 6, 2014, 7:41 a.m. UTC | #2
On Wed, 28 May 2014 12:39:17 +0200
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:

> The check for big or little endianness relies on grep reporting
> match/non-match on the generated binary. If the user specified
> --binary-files=without-match in their GREP_OPTIONS, this will fail.
> 
> Let's follow what autoconf does and unset GREP_OPTIONS and CLICOLOR_FORCE
> at the beginning of the script.
> 
> Reported-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
> Suggested-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> ---
>  configure | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/configure b/configure
> index 0e516f9..525da56 100755
> --- a/configure
> +++ b/configure
> @@ -3,6 +3,11 @@
>  # qemu configure script (c) 2003 Fabrice Bellard
>  #
> 
> +# Unset some variables known to interfere with behavior of common tools,
> +# just as autoconf does.
> +CLICOLOR_FORCE= GREP_OPTIONS=
> +unset CLICOLOR_FORCE GREP_OPTIONS
> +
>  # Temporary directory used for files created while
>  # configure runs. Since it is in the build directory
>  # we can safely blow away any previous version of it

Is there an obvious tree to merge configure changes through, or should
I just throw it into my next s390 pull request?
Paolo Bonzini June 6, 2014, 8:11 a.m. UTC | #3
Il 06/06/2014 09:41, Cornelia Huck ha scritto:
> On Wed, 28 May 2014 12:39:17 +0200
> Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
>
>> The check for big or little endianness relies on grep reporting
>> match/non-match on the generated binary. If the user specified
>> --binary-files=without-match in their GREP_OPTIONS, this will fail.
>>
>> Let's follow what autoconf does and unset GREP_OPTIONS and CLICOLOR_FORCE
>> at the beginning of the script.
>>
>> Reported-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
>> Suggested-by: Markus Armbruster <armbru@redhat.com>
>> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
>> ---
>>  configure | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/configure b/configure
>> index 0e516f9..525da56 100755
>> --- a/configure
>> +++ b/configure
>> @@ -3,6 +3,11 @@
>>  # qemu configure script (c) 2003 Fabrice Bellard
>>  #
>>
>> +# Unset some variables known to interfere with behavior of common tools,
>> +# just as autoconf does.
>> +CLICOLOR_FORCE= GREP_OPTIONS=
>> +unset CLICOLOR_FORCE GREP_OPTIONS
>> +
>>  # Temporary directory used for files created while
>>  # configure runs. Since it is in the build directory
>>  # we can safely blow away any previous version of it
>
> Is there an obvious tree to merge configure changes through, or should
> I just throw it into my next s390 pull request?

Hi,

I picked up this patch and will push it to a "configure" branch on github.

Paolo
Cornelia Huck June 6, 2014, 8:23 a.m. UTC | #4
On Fri, 06 Jun 2014 10:11:27 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:

> Il 06/06/2014 09:41, Cornelia Huck ha scritto:
> > On Wed, 28 May 2014 12:39:17 +0200
> > Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> >
> >> The check for big or little endianness relies on grep reporting
> >> match/non-match on the generated binary. If the user specified
> >> --binary-files=without-match in their GREP_OPTIONS, this will fail.
> >>
> >> Let's follow what autoconf does and unset GREP_OPTIONS and CLICOLOR_FORCE
> >> at the beginning of the script.
> >>
> >> Reported-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
> >> Suggested-by: Markus Armbruster <armbru@redhat.com>
> >> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> >> ---
> >>  configure | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/configure b/configure
> >> index 0e516f9..525da56 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -3,6 +3,11 @@
> >>  # qemu configure script (c) 2003 Fabrice Bellard
> >>  #
> >>
> >> +# Unset some variables known to interfere with behavior of common tools,
> >> +# just as autoconf does.
> >> +CLICOLOR_FORCE= GREP_OPTIONS=
> >> +unset CLICOLOR_FORCE GREP_OPTIONS
> >> +
> >>  # Temporary directory used for files created while
> >>  # configure runs. Since it is in the build directory
> >>  # we can safely blow away any previous version of it
> >
> > Is there an obvious tree to merge configure changes through, or should
> > I just throw it into my next s390 pull request?
> 
> Hi,
> 
> I picked up this patch and will push it to a "configure" branch on github.
> 
> Paolo
> 

Cool, thx!
diff mbox

Patch

diff --git a/configure b/configure
index 0e516f9..525da56 100755
--- a/configure
+++ b/configure
@@ -3,6 +3,11 @@ 
 # qemu configure script (c) 2003 Fabrice Bellard
 #
 
+# Unset some variables known to interfere with behavior of common tools,
+# just as autoconf does.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
 # Temporary directory used for files created while
 # configure runs. Since it is in the build directory
 # we can safely blow away any previous version of it