From laa@mx1.zsea.zp.ua  Thu Oct 11 04:51:23 2001
Return-Path: <laa@mx1.zsea.zp.ua>
Received: from mx1.zsea.zp.ua (ZSEA.zp.ua [212.8.40.5])
	by hub.freebsd.org (Postfix) with ESMTP id 9311B37B407
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Oct 2001 04:50:53 -0700 (PDT)
Received: (from laa@localhost)
	by mx1.zsea.zp.ua with  id f9BBoRT79283;
	Thu, 11 Oct 2001 14:50:27 +0300 (EEST)
	(envelope-from laa)
Message-Id: <200110111150.f9BBoRT79283@mx1.zsea.zp.ua>
Date: Thu, 11 Oct 2001 14:50:27 +0300 (EEST)
From: Alexandr Listopad <laa@laa.zp.ua>
Reply-To: Alexandr Listopad <laa@laa.zp.ua>
To: FreeBSD-gnats-submit@freebsd.org
Cc: laa@laa.zp.ua
Subject: How to build release from selected date
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         31218
>Category:       misc
>Synopsis:       How to build release from selected date
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    matusita
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 11 05:00:03 PDT 2001
>Closed-Date:    Fri May 03 05:57:24 PDT 2002
>Last-Modified:  Fri May 03 05:57:24 PDT 2002
>Originator:     Alexandr Listopad
>Release:        FreeBSD 4.4-SABLE i386
>Organization:
CIT ZSEA
>Environment:
System: FreeBSD Eagle.zgia.zp.ua 4.4-STABLE FreeBSD 4.4-STABLE #5: Wed Oct 3 09:36:26 EEST 2001 root@Eagle.zgia.zp.ua:/usr/obj/usr/src/sys/Eagle i386


>Description:

I write a patch for use cvs ``-D <date>'' feature in
src/release/Makefile.

This feature helps build releases with/from sources prior to selected
date. Now I can run cvsup with ``date='', rebuild system, reboot, and
make release if all fine.

This is my example:
[18:23:39] root@ns # make CHROOTDIR=/home/ftp/pub/FreeBSD/releases/
        BUILDNAME=4.4-20011003053200-STABLE \
        CVSROOT=/home/ncvs \
        RELEASETAG=RELENG_4 \
        NOPORTS=YES NODOC=YES \
        CVSDATE='10/03/2001 03:05:00 UTC' \
        CVSCMDARGS="-D $CVSDATE" \
        release > RELEASE.log 2>&1 &

So, this way I have a release from 03 Oct 2001 03:05:00 UTC.

>How-To-Repeat:

>Fix:

This is a patch for src/release/Makefile:

--- Makefile.orig	Wed Sep 26 16:53:38 2001
+++ Makefile	Mon Oct  8 18:28:08 2001
@@ -22,6 +22,12 @@
 BASE = 4.4
 BUILDNAME?=${BASE}-${DATE}-STABLE
 #
+# If you want to make release from sources prior to specified date
+# put CVSDATE and CVSCMDARGS to command line arguments.
+#CVSDATE="10/03/2001 03:05:00 UTC"
+#CVSCMDARGS="-D ${CVSDATE}"
+#
+#
 #CHROOTDIR=/junk/release
 # If this is a -stable snapshot, then set
 #RELEASETAG=RELENG_4
@@ -259,10 +265,11 @@
 	done
 .if !defined(RELEASETAG)
 	cd ${CHROOTDIR}/usr && rm -rf src && \
-		cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE}
+		cvs -R -d ${CVSROOT} co "${CVSCMDARGS}" -P ${RELEASESRCMODULE}
 .else
 	cd ${CHROOTDIR}/usr && rm -rf src && \
-		cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
+		cvs -R -d ${CVSROOT} co "${CVSCMDARGS}" -P -r ${RELEASETAG} \
+		${RELEASESRCMODULE}
 .endif
 .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
 	cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES}
@@ -272,22 +279,30 @@
 .endif
 .if !defined(NOPORTS)
 .if defined(PORTSRELEASETAG)
-	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${PORTSRELEASETAG} ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
+	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} \
+		co "${CVSCMDARGS}" -P -r ${PORTSRELEASETAG} \
+		${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
 .else
-	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
+	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} \
+		co "${CVSCMDARGS}" -P ${RELEASEPORTSMODULE} && cd ports \
+		&& ${MAKEREADMES}
 .endif
 .elif defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
 .if defined(PORTSRELEASETAG)
-	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${PORTSRELEASETAG} ${MINIMALDOCPORTS}
+	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} \
+		"${CVSCMDARGS}" co -P -r ${PORTSRELEASETAG} ${MINIMALDOCPORTS}
 .else
-	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${MINIMALDOCPORTS}
+	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} \
+		"${CVSCMDARGS}" co -P ${MINIMALDOCPORTS}
 .endif
 .endif
 .if !defined(NODOC)
 .if defined(DOCRELEASETAG)
-	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P -r ${DOCRELEASETAG} ${RELEASEDOCMODULE}
+	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} \
+		"${CVSCMDARGS}" co -P -r ${DOCRELEASETAG} ${RELEASEDOCMODULE}
 .else
-	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
+	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} \
+		"${CVSCMDARGS}" co -P ${RELEASEDOCMODULE}
 .endif
 	if [ -d ${DOCDISTFILES}/ ]; then \
 		cp -rp ${DOCDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
@@ -297,20 +312,22 @@
 .if make(rerelease)
 .if !defined(RELEASENOUPDATE)
 .if !defined(RELEASETAG)
-	cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d
+	cd ${CHROOTDIR}/usr/src && cvs -R -q up "${CVSCMDARGS}" -P -d
 .else
-	cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG}
+	cd ${CHROOTDIR}/usr/src && cvs -R -q up "${CVSCMDARGS}" -P -d \
+		-r ${RELEASETAG}
 .endif
 .if !defined(NOPORTS)
 	cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d
 .endif
 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
 	for i in ${MINIMALDOCPORTS}; do \
-		( cd ${CHROOTDIR}/usr/$$i && cvs -R -q update -P -d ) ; \
+		( cd ${CHROOTDIR}/usr/$$i && cvs -R -q up "${CVSCMDARGS}" \
+			-P -d ) ; \
 	done
 .endif
 .if !defined(NODOC)
-	cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d
+	cd ${CHROOTDIR}/usr/doc && cvs -R -q up "${CVSCMDARGS}" -P -d
 .endif
 .endif
 .endif


-- 
 Laa

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: matusita 
State-Changed-When: Sat Feb 23 19:02:24 PST 2002 
State-Changed-Why:  
"Specifying data when extracting sources" is a good idea, and it seems 
that this patch does implement that.  Tests are needed before committing. 


Responsible-Changed-From-To: freebsd-bugs->matusita 
Responsible-Changed-By: matusita 
Responsible-Changed-When: Sat Feb 23 19:02:24 PST 2002 
Responsible-Changed-Why:  
I'll take this since I'm very intersted in this PR. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31218 

From: Makoto Matsushita <matusita@jp.FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc: Alexandr Listopad <laa@laa.zp.ua>
Subject: Re: misc/31218: How to build release from selected date
Date: Sat, 27 Apr 2002 11:41:32 +0900

 I would like to modify your patch to be more clear.
 
 * I don't think the double-quote when using CVSCMDARGS, since you can
   quote anything if you set CVSCMDARGS just like this:
 
 	make release CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'" ...
 
   And, CVSCMDARGS can be used for other purpose; document it that this
   is an optional argument for cvs(1)
 
 * CVSCMDARGS is maybe for "CVS command-line argument for CVS
   commands," however, your patch uses this variable as "CVS
   command-line argument for CVS generic option," when extracting doc/
   modules.  I think it's your typo.
 
 Anyway, attached below is revised patch made from latest 5-current.
 Would you please check it?  Feel free to ask me if you really want a
 patch for 4-stable.
 
 -- -
 Makoto `MAR' Matsushita
 
 Index: Makefile
 ===================================================================
 RCS file: /home/ncvs/src/release/Makefile,v
 retrieving revision 1.673
 diff -u -r1.673 Makefile
 --- Makefile	26 Apr 2002 19:40:45 -0000	1.673
 +++ Makefile	27 Apr 2002 02:38:39 -0000
 @@ -32,6 +32,8 @@
  #CHROOTDIR=/junk/release
  # If this is a -stable snapshot, then set
  #RELEASETAG=RELENG_4
 +# If you want to add other options to CVS commands, then set
 +#CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'"
  #
  # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
  # are building an official release.  Otherwise, we are building for
 @@ -279,10 +281,10 @@
  	done
  .if !defined(RELEASETAG)
  	cd ${CHROOTDIR}/usr && rm -rf src && \
 -		cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE}
 +		cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P ${RELEASESRCMODULE}
  .else
  	cd ${CHROOTDIR}/usr && rm -rf src && \
 -		cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE}
 +		cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${RELEASETAG} ${RELEASESRCMODULE}
  .endif
  .if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
  	cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES}
 @@ -292,22 +294,22 @@
  .endif
  .if !defined(NOPORTS)
  .if defined(PORTSRELEASETAG)
 -	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${PORTSRELEASETAG} ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
 +	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${PORTSRELEASETAG} ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
  .else
 -	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
 +	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P ${RELEASEPORTSMODULE} && cd ports && ${MAKEREADMES}
  .endif
  .elif defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
  .if defined(PORTSRELEASETAG)
 -	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P -r ${PORTSRELEASETAG} ${MINIMALDOCPORTS}
 +	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${PORTSRELEASETAG} ${MINIMALDOCPORTS}
  .else
 -	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${MINIMALDOCPORTS}
 +	cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P ${MINIMALDOCPORTS}
  .endif
  .endif
  .if !defined(NODOC)
  .if defined(DOCRELEASETAG)
 -	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P -r ${DOCRELEASETAG} ${RELEASEDOCMODULE}
 +	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P -r ${DOCRELEASETAG} ${RELEASEDOCMODULE}
  .else
 -	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
 +	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co ${CVSCMDARGS} -P ${RELEASEDOCMODULE}
  .endif
  	if [ -d ${RELEASEDISTFILES}/ ]; then \
  		cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
 @@ -319,20 +321,20 @@
  .if make(rerelease)
  .if !defined(RELEASENOUPDATE)
  .if !defined(RELEASETAG)
 -	cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -A
 +	cd ${CHROOTDIR}/usr/src && cvs -R -q update ${CVSCMDARGS} -P -d -A
  .else
 -	cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG}
 +	cd ${CHROOTDIR}/usr/src && cvs -R -q update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
  .endif
  .if !defined(NOPORTS)
 -	cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d
 +	cd ${CHROOTDIR}/usr/ports && cvs -R -q update ${CVSCMDARGS} -P -d
  .endif
  .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
  	for i in ${MINIMALDOCPORTS}; do \
 -		( cd ${CHROOTDIR}/usr/$$i && cvs -R -q update -P -d ) ; \
 +		( cd ${CHROOTDIR}/usr/$$i && cvs -R -q update ${CVSCMDARGS} -P -d ) ; \
  	done
  .endif
  .if !defined(NODOC)
 -	cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d
 +	cd ${CHROOTDIR}/usr/doc && cvs -R -q update ${CVSCMDARGS} -P -d
  .endif
  .endif
  .endif

From: Makoto Matsushita <matusita@jp.FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc: Alexandr Listopad <laa@laa.zp.ua>
Subject: Re: misc/31218: How to build release from selected date
Date: Sat, 27 Apr 2002 11:56:00 +0900

 Gimme a chance to fix typo.  Sorry for inconvenience.
 
 matusita>  * I don't think the double-quote when using CVSCMDARGS,
              I think the double-quotes doesn't need when using CVSCMDARGS,
 matusita>  since you can quote anything if you set CVSCMDARGS just
 matusita>  like this:
 
 -- -
 Makoto `MAR' Matsushita

From: Alexandr Listopad <laa@laa.zp.ua>
To: Makoto Matsushita <matusita@jp.FreeBSD.org>
Cc: Alexandr Listopad <laa@laa.zp.ua>, bug-followup@FreeBSD.org
Subject: Re: misc/31218: How to build release from selected date
Date: Sat, 27 Apr 2002 12:33:40 +0300

 hi!
 
 On Sat, Apr 27, 2002 at 11:41:32AM +0900, Makoto Matsushita wrote:
 > I would like to modify your patch to be more clear.
 > 
 > * I don't think the double-quote when using CVSCMDARGS, since you can
 >   quote anything if you set CVSCMDARGS just like this:
 > 
 > 	make release CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'" ...
 > 
 >   And, CVSCMDARGS can be used for other purpose; document it that this
 >   is an optional argument for cvs(1)
 > 
 
 I agree with You, double-quote don't needed.
 
 > * CVSCMDARGS is maybe for "CVS command-line argument for CVS
 >   commands," however, your patch uses this variable as "CVS
 >   command-line argument for CVS generic option," when extracting doc/
 >   modules.  I think it's your typo.
 > 
 > Anyway, attached below is revised patch made from latest 5-current.
 
 Your patch looks fine. Thanks.
 Sorry, but I can't check it because I have no fbsd boxes for testing ;(
 
 > Would you please check it?  Feel free to ask me if you really want a
 > patch for 4-stable.
 
 Yes, I want to apply thsis patch for RELENG_4 before 4.6-REL. Can You
 do it?
 
 Thank you very much!
 
 -- 
  Laa

From: Makoto Matsushita <matusita@jp.FreeBSD.org>
To: laa@laa.zp.ua
Cc: bug-followup@FreeBSD.org
Subject: Re: misc/31218: How to build release from selected date
Date: Sat, 27 Apr 2002 22:54:23 +0900

 laa> I agree with You, double-quote don't needed.
 
 OK.  I'll commit this patch later.
 
 laa> Yes, I want to apply thsis patch for RELENG_4 before 4.6-REL. Can
 laa> You do it?
 
 The code-freeze date for 4.6-RELEASE, May/01/2002 is approaching.  I
 do not want to do MFC quickly since it's not trivial nor critical fix.
 I'll try asking re@ later; but at this time, I cannot promise you that
 this change appears in RELENG_4_6 branch.
 
 -- -
 Makoto `MAR' Matsushita
State-Changed-From-To: analyzed->patched 
State-Changed-By: matusita 
State-Changed-When: Sat Apr 27 07:23:41 PDT 2002 
State-Changed-Why:  
Commit a modified patch as src/release/Makefile rev 1.674, thanks. 
Awaiting MFC. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=31218 
State-Changed-From-To: patched->closed 
State-Changed-By: matusita 
State-Changed-When: Fri May 3 05:56:25 PDT 2002 
State-Changed-Why:  
I've MFCed just now.  Thank you! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=31218 
>Unformatted:
