Subject: Re: Check for "test ... == ..." in configure scripts
To: NetBSD Packages Technical Discussion List <>
From: Johnny Lam <>
List: tech-pkg
Date: 09/25/2006 09:39:03
Quentin Garnier wrote:
> On Sat, Sep 23, 2006 at 07:41:00AM +0200, Roland Illig wrote:
>> there's a discussion on tech-userlevel about accepting the "==" operator 
>> in test(1). But even if NetBSD changes its implementation, others will 
>> not do that. So pkgsrc continues with having to deal with those 
>> non-portable shell scripts.
> Thanks :)
>> To solve this, I have written a _very_ simple change to 
>> mk/configure/ that just looks if any line of a configure 
>> script contains the regular expression "test.*==". I hope that this will 
>> catch a few of the problems.
>> By default, this check would be enabled (maybe on Linux it doesn't need 
>> to), but can be disabled by both the pkgsrc user and by each individual 
>> package.
> configure scripts are not the only things to check, and you're not
> checking "[ ... ==", which is more likely because autoconf itself
> doesn't generate "==".

The "==" is part of the user-provided configure script templates, so if 
we find it in the configure scripts, we're likely to find it in the 
makefiles and the other shell scripts in the package.  I think Roland's 
approach of checking the configure scirpt and exiting with an error is 
sound, because that package basically demands an examination of all of 
these other files.  This approach is only useful in the 
PKG_DEVELOPER=yes case because you would need to generate patches to 
work around the use of "==", so I would certainly restrict it to only 


	-- Johnny Lam <>