Date: Thu, 5 Jun 2003 22:56:11 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: Marcel Moolenaar <marcel@xcllnt.net> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/release Makefile Message-ID: <20030605195611.GA2243@sunbay.com> In-Reply-To: <20030605170728.GA572@dhcp01.pn.xcllnt.net> References: <200306040517.h545HIY1051372@repoman.freebsd.org> <20030605100007.GA42986@sunbay.com> <20030605170728.GA572@dhcp01.pn.xcllnt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 05, 2003 at 10:07:28AM -0700, Marcel Moolenaar wrote: > On Thu, Jun 05, 2003 at 01:00:07PM +0300, Ruslan Ermilov wrote: > > On Tue, Jun 03, 2003 at 10:17:18PM -0700, Marcel Moolenaar wrote: > > > marcel 2003/06/03 22:17:18 PDT > > >=20 > > > FreeBSD src repository > > >=20 > > > Modified files: > > > release Makefile=20 > > > Log: > > > Have the port readmes follow the same logic as buildworld. We skip > > > doing make readmes if /tmp/.skip_ports exists. This file is created > > > after a complete run, which avoids that we do the lengthy operation > > > again for a rerelease. > > > When NOPORTS or NOPORTREADMES are defined, we create the file prior > > > to starting the release. > > > =20 > > > Revision Changes Path > > > 1.781 +5 -5 src/release/Makefile > > >=20 > > I think this is not quite right. Instead, the /tmp/.ports_done > > should be created, similar to /tmp/.world_done, when ports are > > really done. >=20 > It is. The wording "complete run" is confusing. I meant a complete > run of the make readmes, not of the release itself. >=20 Not quite. You also create it when NOPORTREADMES is set. Ports (readmes) aren't created in this case. Er, and I meant /tmp/.readmes_done of course. > > When NOPORTS or NOPORTREADMES are defined, we should just not be > > doing the relevant parts of "make release". >=20 > Which is exactly what happens. By making the different parts of > a release cycle optional by checking for the existence of files, > you can more easily interfere by creating files or removing them. > Files are also a good way to maintain state across make invocations. >=20 What bugs me here is that we also (ab)use the /tmp/.skip_ports for remembering "NOPORTS || NOPORTREADMES". > > And of course, it > > should be possible to run "make -DNOPORTS release" first, and be > > able to run "make rerelease" later, and get the ports built. >=20 > It's not that simple AFAICT. If you follow a release -DNOPORTS -DNODOC > with a rerelease -DRELEASENOUPDATE, you won't have a ports tree > at all so you cannot possibly expect to have all the readmes built. > Your rerelease will probably fail. >=20 We could check if /usr/ports/Makefile exists, but this case is a self-foot-shooting IMO. If you know you didn't check out ports sources with "make release", and expect "make rerelease" to build ports readmes, it should be clear that you don't want -DRELEASENOUPDATE. Or if you just want to rerelease the same release, you should pass it the same flags. There are other ways to shoot yourself in the foot. You can interrupt "make release" while it's doing "cvs co" of ports, and run "make rerelease" with -DRELEASENOUPDATE. You'll be shooted in the foot too. I'm actually thinking of getting rid of "rerelease", and instead adding the -DNOCLEAN knob to "make release" to replace it. The checkout/update operation of CVS could be guessed by checking if the target directory exists. > Also, if you follow a release -DNOPORTS -DNODOC with a rerelease > without -DRELEASENOUPDATE, it will fail too because it will try > to update a non-existing tree and CVS doesn't like that. >=20 Yeah, here my guessing of checkout/update would be handy. ;) > Yes, if you don't have -DRELEASENOUPDATE and you previously did > checkout the ports collection, you'll update the ports tree and > we should remove /tmp/.skip_ports, like we remove /tmp/.world_done > after updating the source tree. The following patch should > achieve that: >=20 > Index: Makefile > =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/release/Makefile,v > retrieving revision 1.782 > diff -u -r1.782 Makefile > --- Makefile 4 Jun 2003 22:24:43 -0000 1.782 > +++ Makefile 5 Jun 2003 17:06:23 -0000 > @@ -383,6 +383,7 @@ > rm -f ${CHROOTDIR}/tmp/.world_done > .if !defined(NOPORTS) > cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q up= date ${CVSCMDARGS} -P -d > + rm -f ${CHROOTDIR}/tmp/.skip_ports > .endif > .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} =3D=3D "YES" > for i in ${MINIMALDOCPORTS}; do \ >=20 Yes, this change is needed in either case. It means: if we update the ports sources, we should be regenerating readmes. How about this instead (without anti-footshooting measure)? %%% Index: Makefile =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/release/Makefile,v retrieving revision 1.782 diff -u -r1.782 Makefile --- Makefile 4 Jun 2003 22:24:43 -0000 1.782 +++ Makefile 5 Jun 2003 19:34:07 -0000 @@ -384,6 +384,7 @@ .if !defined(NOPORTS) cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${C= VSCMDARGS} -P -d .endif + rm -f ${CHROOTDIR}/tmp/.readmes_done .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} =3D=3D "YES" for i in ${MINIMALDOCPORTS}; do \ ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${= CVSCMDARGS} -P -d ) ; \ @@ -453,21 +454,20 @@ echo " ${CROSSMAKE} ${WORLD_FLAGS} -DNOCLEAN buildworld && \\" >> ${CHROO= TDIR}/mk echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk echo "fi" >> ${CHROOTDIR}/mk - echo "if [ ! -f /tmp/.skip_ports ]; then" >> ${CHROOTDIR}/mk +.if defined(NOPORTS) || defined(NOPORTREADMES) + echo "if [ ! -f /tmp/.readmes_done ]; then" >> ${CHROOTDIR}/mk echo " echo \">>> make readmes started on \`LC_ALL=3DC TZ=3DGMT date\`\""= >> ${CHROOTDIR}/mk echo " cd /usr/ports" >> ${CHROOTDIR}/mk echo " make ${PORTREADMES_FLAGS} readmes" >> ${CHROOTDIR}/mk - echo " touch /tmp/.skip_ports" >> ${CHROOTDIR}/mk + echo " touch /tmp/.readmes_done" >> ${CHROOTDIR}/mk echo " echo \">>> make readmes finished on \`LC_ALL=3DC TZ=3DGMT date\`\"= " >> ${CHROOTDIR}/mk echo "fi" >> ${CHROOTDIR}/mk +.endif echo "cd /usr/src/release" >> ${CHROOTDIR}/mk echo "make obj" >> ${CHROOTDIR}/mk echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=3DC T= Z=3DGMT date\`\"" >> ${CHROOTDIR}/mk chmod 755 ${CHROOTDIR}/mk -.if defined(NOPORTS) || defined(NOPORTREADMES) - touch ${CHROOTDIR}/tmp/.skip_ports -.endif # Ensure md.ko is loaded if md(4) is not statically compiled into the ker= nel -mdconfig 2>/dev/null env -i /usr/sbin/chroot ${CHROOTDIR} /mk %%% Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software Ltd, ru@FreeBSD.org FreeBSD committer --4Ckj6UjgE2iN1+kY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+36BaUkv4P6juNwoRArQaAKCHmnM3jcomWiHyrTxBk7mW2euG9gCfZ1g2 Auq2heGkE9z4Q7wK9YIOC2o= =T3pY -----END PGP SIGNATURE----- --4Ckj6UjgE2iN1+kY--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030605195611.GA2243>