Subject: Re: Check for "test ... == ..." in configure scripts
To: Roland Illig <rillig@NetBSD.org>
From: Quentin Garnier <cube@cubidou.net>
List: tech-pkg
Date: 09/23/2006 08:15:07
--z20Z95FJiBb6FirT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Sep 23, 2006 at 07:41:00AM +0200, Roland Illig wrote:
> there's a discussion on tech-userlevel about accepting the "=3D=3D" opera=
tor=20
> in test(1). But even if NetBSD changes its implementation, others will=20
> not do that. So pkgsrc continues with having to deal with those=20
> non-portable shell scripts.

Thanks :)

> To solve this, I have written a _very_ simple change to=20
> mk/configure/configure.mk that just looks if any line of a configure=20
> script contains the regular expression "test.*=3D=3D". I hope that this w=
ill=20
> catch a few of the problems.
>=20
> By default, this check would be enabled (maybe on Linux it doesn't need=
=20
> to), but can be disabled by both the pkgsrc user and by each individual=
=20
> package.

configure scripts are not the only things to check, and you're not
checking "[ ... =3D=3D", which is more likely because autoconf itself
doesn't generate "=3D=3D".

Though to be honest, between something that fails and a check that
everbody has to run all the time...  Granted, the check can be done
even on platforms where "=3D=3D" is sadly accepted.

> +	case `sed '1q' < ${CONFIGURE_SCRIPT}` in			\
> +	"#! /bin/sh")							\
> +		if grep "test.*=3D=3D" < ${CONFIGURE_SCRIPT}; then		\
> +			${ERROR_MSG} "[configure.mk] Found test ... =3D=3D test in configure =
script."; \
> +			exit 1;						\
> +		fi;							\
> +		;;							\
> +	*)	;;							\
> +	esac
> +.endfor


--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.

--z20Z95FJiBb6FirT
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iQEVAwUBRRTQ69goQloHrPnoAQJBjAf+J89xFLIc4CywLfecBV3DezjjuoIRMgFG
E0YqrVuDzITSeiKENoKGAjmAMhQlWVGdejwonb/ZGg/Mkk/fWp/XfK4aHbCH2l94
GrGSCShEUKiVkzSHTL4nrPPpiHtfEglVYnCYJmWb29iFduLpem4SahsyetrG3w+b
RAkirFitwXGqHhox7Z+chppGCsrQ5Izyj0yuBMv/ADj1phjGSMXF24sjEDInFt0M
7bR0jatquB+AuegHl3GGxvqipD+NcbWkDk5Qb9Lm4w1iBibheibHiDKvErfmZG7Y
S0kZ/eXGhWoBpjE0AxDSZAiGIKG4Xx3H5ho6yddYV3elnAn9WiP/+Q==
=ff5+
-----END PGP SIGNATURE-----

--z20Z95FJiBb6FirT--