From ast@marabu.ch  Fri Mar 21 04:56:11 2003
Return-Path: <ast@marabu.ch>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 646F437B401
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Mar 2003 04:56:11 -0800 (PST)
Received: from oneplusone.ch (oneplusone.ch [212.55.208.170])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A54BB43FA3
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Mar 2003 04:56:09 -0800 (PST)
	(envelope-from ast@marabu.ch)
Received: from oneplusone.ch (localhost [127.0.0.1])
	by oneplusone.ch (8.12.6/8.12.3) with ESMTP id h2LCu2Zt008980
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Mar 2003 13:56:02 +0100 (MET)
	(envelope-from ast@marabu.ch)
Received: (from uucp@localhost)
	by oneplusone.ch (8.12.6/8.12.3/Submit) with UUCP id h2LCu2qQ008979
	for freebsd-gnats-submit@FreeBSD.org; Fri, 21 Mar 2003 13:56:02 +0100 (MET)
Received: from marabu.marabu.ch (marabu.marabu.ch [192.168.21.3])
	by marabu.ch (8.11.6/8.11.6) with ESMTP id h2LCorF96131
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Mar 2003 13:50:53 +0100 (MET)
	(envelope-from ast@marabu.ch)
Received: by marabu.marabu.ch (8.7.5/20001028-ast-8.3) id NAA20437; Fri, 21 Mar 2003 13:50:51 +0100 (CET)
Received: by NeXT.Mailer (1.124.8483.6)
Message-Id: <200303211250.NAA20437@marabu.marabu.ch>
Date: Fri, 21 Mar 2003 13:50:50 +0100
From: Adrian Steinmann <ast@marabu.ch>
To: freebsd-gnats-submit@FreeBSD.org, ast@marabu.ch
Subject: Re: Problem Report misc/50106: Make 'make release' more flexible
	behind FWs and local patches

>Number:         50167
>Category:       misc
>Synopsis:       Re: Problem Report misc/50106: Make 'make release' more flexible
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ceri
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 21 05:00:28 PST 2003
>Closed-Date:    Sat Mar 22 01:34:25 PST 2003
>Last-Modified:  Sat Mar 22 01:34:25 PST 2003
>Originator:     Adrian Steinmann <ast@marabu.ch>
>Release:        
>Organization:
>Environment:
>Description:
 subject=Re: misc/50106: Make 'make release' more flexible behind FWs and local patches
 
 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
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ceri 
State-Changed-When: Sat Mar 22 01:33:03 PST 2003 
State-Changed-Why:  
Misfiled followup to misc/50106. 
Content not migrated as misc/50137 contains the exact same patch and the 
content has been copied from there already. 


Responsible-Changed-From-To: gnats-admin->ceri 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Sat Mar 22 01:33:03 PST 2003 
Responsible-Changed-Why:  
Take from gnats-admin. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=50167 
>Unformatted:
 	behind FWs and local patches
