automake-patches
[Top][All Lists]
Advanced

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

Re: 1.12 bugfix: unset local var to prevent env influence


From: Stefano Lattarini
Subject: Re: 1.12 bugfix: unset local var to prevent env influence
Date: Thu, 26 Apr 2012 12:33:08 +0200

Hi Thien-Thi, thanks for the report and the patch.

On 04/26/2012 11:45 AM, Thien-Thi Nguyen wrote:
> Automake 1.12 "make check" reported only one FAIL, which I traced
> to a strange value for var 'd' in t/remake11.sh, leaking in from
> the environment.
>
Do you have an environment variable named 'd'?  I like minimalism, but
this seems a little over-the-top ;-)

Anyway, you're right that this is a testsuite weakness, and your fix is
correct (with a minor caveat below).

> Anyway, here's the trivial patch:
> 
> diff -u t/remake11.sh\~ t/remake11.sh
> --- t/remake11.sh~    2012-04-21 16:38:05.000000000 +0200
> +++ t/remake11.sh     2012-04-26 11:31:18.000000000 +0200
> @@ -30,6 +30,7 @@
>
>   echo "@FOO@" > bar.in
>   echo "AC_CONFIG_FILES([bar])" >> configure.ac
> + unset d
>   for i in 0 1 2 3 4 5 6 7 8 9; do
>     d=${d+"$d/"}sub$i
>     echo "SUBDIRS = sub$i" > Makefile.am
> 
Unfortunately, the Korn shell and the POSIX shell on Solaris, as well
as some older bash versions, have an 'unset' builtin that returns exit
status '1' when it tries to unset an already-unset variable; so we
need a little correction to your patch:

   echo "AC_CONFIG_FILES([bar])" >> configure.ac
  +d=; unset d # Avoid unduly interferences from the environment.
   for i in 0 1 2 3 4 5 6 7 8 9; do

> and a suitable ChangeLog entry:
> 
>         tests: unset local var to prevent env influence
>         * t/remake11.sh: Unset 'd' before first use.
>
I used this slightly modified message:

       tests: avoid yet another spurious environment influence
       * t/remake11.sh: Unset 'd' before first use.

and applied the patch in your name.  Attached is what I've pushed.

> Probably the entire suite should be audited for this class of bug.
>
This seems like overkill, since such bugs are pretty unlikely, involve
the testsuite only (not the actual automake program), and are and very
easy to fix once revealed.  But if you feel like wanting to do some
auditing yourself anyway, please be my guest :-)

> Anyway, now I can happily move on to "make install"...
>
And you might want to run the 'installcheck' target thereafter (yes, now
automake has a real 'installcheck' target!)

Thanks,
  Stefano

Attachment: 0001-tests-avoid-yet-another-spurious-environment-influen.patch
Description: Text Data


reply via email to

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