Date: Sat, 22 Mar 2003 01:40:15 -0800 (PST) From: Ceri Davies <ceri@FreeBSD.org> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/50106: Make 'make release' more flexible behind FWs and local patches Message-ID: <200303220940.h2M9eFjv028711@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/50106; it has been noted by GNATS. From: Ceri Davies <ceri@FreeBSD.org> To: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org> Cc: Subject: Re: misc/50106: Make 'make release' more flexible behind FWs and local patches Date: Sat, 22 Mar 2003 09:30:36 +0000 Adding to audit trail, from pending/50137 : Message-Id: <200303200648.HAA17570@marabu.marabu.ch> Date: Thu, 20 Mar 2003 07:48:27 +0100 From: Adrian Steinmann <ast@marabu.ch> To: freebsd-gnats-submit@FreeBSD.org, ast@marabu.ch As it stood in its first version, PR 50106 was kind of suboptimal for two reasons: 1) it expected LOCAL_PATCHES to be relative to CHROOTDIR and not CHROOTDIR/usr/src, which is the traditional root for src patches. 2) if say, NOPORTS=yes was specified, make release failed because when the patch was applied it returns non-zero when it tried to patch a nonexisting file (in spite of PATCH_FLAGS=--batch). I work around this by not using the LOCAL_PATCHES hook at all but doing the local patching in the moved-down LOCAL_SCRIPT like this: patch ${PATCH_FLAGS} < ${MY_LOCAL_PATCHES} || true making sure that MY_LOCAL_PATCHES is exported into in the 'make release' environment, and hence the LOCAL_SCRIPT. Attached is a slightly modified patch which just "moves down" running of the LOCAL_SCRIPT and leaves the traditional LOCAL_PATCHES where it has always been, respecting the POLA. Another approach would be to have a third hook LOCAL_PORT_PATCHES which are relative to CHROOTDIR/usr/ports, those would be protected by the existing .if ! defined (NOPORTS) ... .endif clauses within release/Makefile. Nevertheless, I advocate having LOCAL_SCRIPT after all checkouts are done, i.e. please commit at least that part of the patch! Index: usr/src/release/Makefile =================================================================== RCS file: /usr/cvs/src/release/Makefile,v retrieving revision 1.536.2.106 diff -u -r1.536.2.106 Makefile --- usr/src/release/Makefile 17 Mar 2003 05:50:32 -0000 1.536.2.106 +++ usr/src/release/Makefile 19 Mar 2003 21:57:08 -0000 @@ -288,9 +288,6 @@ .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES}) cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES} .endif -.if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT}) - cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} -.endif .if !defined(NOPORTS) .if defined(PORTSRELEASETAG) cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${PORTSRELEASETAG} ${RELEASEPORTSMODULE} @@ -325,6 +322,9 @@ .endif .endif .endif +.if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT}) + cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} +.endif .if make(rerelease) .if !defined(RELEASENOUPDATE) .if !defined(RELEASETAG) @@ -356,6 +356,8 @@ echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk echo "export MODULES_WITH_WORLD=YES" >> ${CHROOTDIR}/mk .for var in \ + OSREL \ + OSVERSION \ AUTO_KEYBOARD_DETECT \ BOOT_CONFIG \ BUILDNAME \ @@ -826,6 +828,8 @@ @for i in ${DOCPORTS}; do \ cd /usr/ports/$$i && \ env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \ + OSREL=$${OSREL} OSVERSION=$${OSVERSION} \ + HTTP_PROXY=$${HTTP_PROXY} FTP_PROXY=$${FTP_PROXY} \ make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \ WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \ done To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303220940.h2M9eFjv028711>