[Debian-ha-maintainers] Bug#582874: [PATCH] debian/rules: force bash for configure (#582874)

Simon Horman horms at verge.net.au
Mon Jun 7 08:01:04 UTC 2010


On Wed, May 26, 2010 at 06:04:38PM +0900, Simon Horman wrote:
> [CCed bug]
> 
> On Wed, May 26, 2010 at 08:38:52AM +0200, Florian Haas wrote:
> > On 05/26/2010 02:00 AM, Simon Horman wrote:
> > > On Tue, May 25, 2010 at 12:32:57PM +0200, Florian Haas wrote:
> > >> # HG changeset patch
> > >> # User Florian Haas <florian.haas at linbit.com>
> > >> # Date 1274778576 -7200
> > >> # Branch sid
> > >> # Node ID 8c7e088098feba1d4bae115acb3d646b743e2462
> > >> # Parent  01459d573bc597a83911cdb78deba704dea0ad79
> > >> debian/rules: force bash for configure (#582874)
> > >>
> > >> Fix debian/rules to explicitly invoke bash for running configure (see
> > >> BTS #582874).
> > > 
> > > Is forcing bash the best solution to this problem?
> > 
> > I figured it was, as it was one of the suggested solutions mentioned in
> > the bug report. But other reporters apparently mentioned that "export
> > CONFIG_SHELL=/bin/bash" worked better for them. As for whether "export
> > -n" in that autoconf script is actually needed I'm not certain -- please
> > look into it, that part is from you. :)
> 
> Point taken.
> 
> I'm surprised that if fails given that the line in question is
> 
> export -n CFLAGS || true

Hi,

I propose the following patch as a solution to this problem:

unset CFLAGS in a dash-friendly way

According to the dash man page, the only way to unexport a variable
is to unset it. This also works in bash.

For the record, the reason that CFLAGS is exported from the environment to
configure and configure appends -Werror to the CFLAGS then it will be
re-exported by configure and has been observed to cause trouble when
configure runs a separate configure is the libltdl directory.

Signed-off-by: Simon Horman <horms at verge.net.au>

diff -r cc74c5d2e9f3 configure.ac
--- a/configure.ac	Sun May 16 21:10:59 2010 +0200
+++ b/configure.ac	Mon Jun 07 16:55:53 2010 +0900
@@ -1140,7 +1140,10 @@
 CC_EXTRAS=""
 
 if export | fgrep " CFLAGS=" > /dev/null; then
-	export -n CFLAGS || true # We don't want to bomb out if this fails
+	SAVED_CFLAGS="$CFLAGS"
+	unset CFLAGS
+	CFLAGS="$SAVED_CFLAGS"
+	unset SAVED_CFLAGS
 fi
 
 if test "$GCC" != yes; then







More information about the Debian-ha-maintainers mailing list