Date: Fri, 25 Jul 2003 16:08:39 -0700 From: Gordon Tetlow <gordont@gnf.org> To: arch@FreeBSD.org Subject: Patch to crunchgen to fix errors using make -P Message-ID: <20030725230839.GR12996@roark.gnf.org>
next in thread | raw e-mail | index | archive | help
--o+XGOUgEmmuBaVbd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Bill Fenner reported a problem with crunchgen relating to the use of make -j # -P when building rescue. By running make -j # -P in src/rescue/rescue you get the following type of error: crunchgen: make error: Remaking `crunchgen_objs' =09 crunchgen: make error: Results of making crunchgen_objs: =09 crunchgen: make error:=20 =09 crunchgen: make error: Remaking `loop' =09 crunchgen: make error: Results of making loop: =09 crunchgen: make error:=20 This stems from the problem that crunchgen itself invokes make(1) to do some work and the extra output generated by the -P flag confuses crunchgen. I have a quick patch that I'd like to commit, but I was wondering if anyone had any objections or reason to keep the MAKEFLAGS environment variable. -gordon --- //depot/vendor/freebsd/src/usr.sbin/crunch/crunchgen/crunchgen.c 200= 3/04/22 21:37:08 +++ //depot/user/gordon/dynamic/src/usr.sbin/crunch/crunchgen/crunchgen.c20= 03/07/25 16:02:35 @@ -700,6 +700,12 @@ =20 fclose(f); =20 + /* + * We need to whack the MAKEFLAGs env variable to protect crunchgen + * from dangerous flags like -P that influence the resulting output. + */ + unsetenv("MAKEFLAGS"); + snprintf(line, MAXLINELEN, "cd %s && make -f %s crunchgen_objs 2>&1= ", p->srcdir, tempfname); if ((f =3D popen(line, "r")) =3D=3D NULL) { --o+XGOUgEmmuBaVbd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE/Ibh3Ru2t9DV9ZfsRAuI1AKC54oiWeKjIzqVRTiTDhTOFaummcQCgi8rg HrA9IKkKlrwktHvYHm371xY= =67k0 -----END PGP SIGNATURE----- --o+XGOUgEmmuBaVbd--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030725230839.GR12996>