Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2002 16:13:15 +0200
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        AlanE <alane@geeksrus.net>
Cc:        Warner Losh <imp@FreeBSD.org>, current@FreeBSD.org
Subject:   Re: changes to make(1)
Message-ID:  <20021031141315.GB55353@sunbay.com>
In-Reply-To: <20021031093732.GA531@wwweasel.geeksrus.net>
References:  <20021030145502.GC39721@starjuice.net> <20021030145753.GA54447@wwweasel.geeksrus.net> <20021030152046.GA93680@sunbay.com> <20021030161329.GC72564@wwweasel.geeksrus.net> <20021030204920.L38444@freebsdmall.com> <20021031060320.GB87766@wwweasel.geeksrus.net> <20021031060820.GA19819@dragon.nuxi.com> <20021031061246.GA45936@wwweasel.geeksrus.net> <20021031092026.GA23436@sunbay.com> <20021031093732.GA531@wwweasel.geeksrus.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--JP+T4n/bALQSJXh8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 31, 2002 at 04:37:32AM -0500, AlanE wrote:
> On Thu, Oct 31, 2002 at 11:20:26AM +0200, Ruslan Ermilov wrote:
> >On Thu, Oct 31, 2002 at 01:12:46AM -0500, AlanE wrote:
> >> On Wed, Oct 30, 2002 at 10:08:20PM -0800, David O'Brien wrote:
> >> >On Thu, Oct 31, 2002 at 01:03:20AM -0500, AlanE wrote:
> >> >> There is also an expression parser bug that I would like to fix; it=
 is
> >> >> a confusing error that causes make(1) to reject perfectly legitimate
> >> >> conditional expressions. We'll see about that one when I get to it;=
 I
> >> >> suspect it should wait until after 5.0-RELEASE.
> >> >
> >> >If "make release" isn't broken, it should 100% wait until after
> >> >5.0-RELEASE.
> >>=20
> >> I tend to agree here. No existing Makefiles are broken, so it can=20
> >> wait. (Besides, I haven't even begun to investigate the problem...)
> >>=20
> >What is this problem you're talking about?  I might have already
> >looked at it recently.
>=20
> This code works correctly.
>=20
> .if ${PERL_MAJOR} < 5 || ${PERL_MAJOR} =3D=3D 5 && ${PERL_MINOR} < 8
> ${ECHO_CMD} This port might need the p5-File-Spec port.
> .endif # ${PERL_MAJOR} < 5 || ${PERL_MAJOR} =3D=3D 5 && ${PERL_MINOR} < 8
>=20
> This code, differing only in the use of ()'s to group the expressions,
> causes make(1) to think it is doing *string* comparisons, and then
> complain very loudly about only using =3D=3D and !=3D in said comparison.
>=20
> .if (${PERL_MAJOR} < 5) || (${PERL_MAJOR} =3D=3D 5 && ${PERL_MINOR} < 8)
> ${ECHO_CMD} This port might need the p5-File-Spec port.
> .endif # (${PERL_MAJOR} < 5) || (${PERL_MAJOR} =3D=3D 5 && ${PERL_MINOR} =
< 8)
>=20
Heh, I wondered about that too when I first these strange lines in
bsd.port.mk with spaces surronding parentheses -- it also works if
you insert spaces after digits before right parentheses:

=2Eif (${PERL_MAJOR} < 5 ) || (${PERL_MAJOR} =3D=3D 5 && ${PERL_MINOR} < 8 )

Here is the fix:

%%%
Index: cond.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/usr.bin/make/cond.c,v
retrieving revision 1.25
diff -u -p -r1.25 cond.c
--- cond.c	23 Oct 2002 23:16:42 -0000	1.25
+++ cond.c	31 Oct 2002 13:10:13 -0000
@@ -688,14 +688,15 @@ do_string_compare:
 			}
 		    } else {
 			char *c =3D CondCvtArg(rhs, &right);
-			if (*c !=3D '\0' && !isspace((unsigned char) *c))
+			if (*c !=3D '\0' && *c !=3D ')' &&
+			    !isspace((unsigned char) *c))
 			    goto do_string_compare;
 			if (rhs =3D=3D condExpr) {
 			    /*
 			     * Skip over the right-hand side
 			     */
 			    while(!isspace((unsigned char) *condExpr) &&
-				  (*condExpr !=3D '\0')) {
+				  *condExpr !=3D ')' && *condExpr !=3D '\0') {
 				condExpr++;
 			    }
 			}
%%%

ports/devel/pmake is also vulnerable to this (even the latest beta),
and unless I'm dreadfully mistaken, OpenBSD's make(1) too.


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--JP+T4n/bALQSJXh8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE9wTp7Ukv4P6juNwoRAl6UAJ9Qke9LXAoNAHQP8D5pnetVa/K4swCfRjny
1VG1blK/O/SUlm/dKMWMFHM=
=ZqLb
-----END PGP SIGNATURE-----

--JP+T4n/bALQSJXh8--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021031141315.GB55353>