Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2011 08:18:00 +0000 (UTC)
From:      Florent Thoumie <flz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r221056 - in projects/portbuild: conf scripts
Message-ID:  <201104260818.p3Q8I0TF013696@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: flz
Date: Tue Apr 26 08:18:00 2011
New Revision: 221056
URL: http://svn.freebsd.org/changeset/base/221056

Log:
  Don't hardcode CVS all over the place.

Modified:
  projects/portbuild/conf/server.conf
  projects/portbuild/scripts/dopackages
  projects/portbuild/scripts/makeworld
  projects/portbuild/scripts/processfail
  projects/portbuild/scripts/processlogs
  projects/portbuild/scripts/processlogs2

Modified: projects/portbuild/conf/server.conf
==============================================================================
--- projects/portbuild/conf/server.conf	Tue Apr 26 07:30:52 2011	(r221055)
+++ projects/portbuild/conf/server.conf	Tue Apr 26 08:18:00 2011	(r221056)
@@ -100,6 +100,18 @@ UPLOAD_USER="portmgr"
 MASTER_URL="pointyhat.FreeBSD.org"
 
 #
+# vcs-specific definitions
+#
+
+VCS="cvs"
+
+VCS_UPDATE_DATE="-Rq update -PdA -D"
+VCS_UPDATE_TAG="-Rq update -PdA -r"
+
+VCSWEB="http://cvsweb.freebsd.org"
+
+#
 # www definitions (see processfail)
 #
+
 WWW_DIRECTORY=/usr/local/www/data/

Modified: projects/portbuild/scripts/dopackages
==============================================================================
--- projects/portbuild/scripts/dopackages	Tue Apr 26 07:30:52 2011	(r221055)
+++ projects/portbuild/scripts/dopackages	Tue Apr 26 08:18:00 2011	(r221056)
@@ -14,7 +14,7 @@ umask 002
 journalname="journal"
 
 usage () {
-    echo "usage: arch branch buildid datestamp [-incremental] [-continue] [-restart] [-nofinish] [-finish] [-nocleanup] [-keep] [-nobuild] [-noindex] [-noduds] [-norestr] [-nochecksubdirs] [-nosrc] [-srccvs] [-noports] [-portscvs] [-noplistcheck] [-nodistfiles] [-fetch-original] [-cdrom] [-trybroken]"
+    echo "usage: arch branch buildid datestamp [-incremental] [-continue] [-restart] [-nofinish] [-finish] [-nocleanup] [-keep] [-nobuild] [-noindex] [-noduds] [-norestr] [-nochecksubdirs] [-nosrc] [-srcvcs] [-noports] [-portsvcs] [-noplistcheck] [-nodistfiles] [-fetch-original] [-cdrom] [-trybroken]"
 # XXX MCL I think it's going to be too hard to move the create in here, now.
     echo "       -incremental     : Start a new incremental build"
     echo "       -continue        : Restart an interrupted build, skipping failed ports"
@@ -29,9 +29,9 @@ usage () {
     echo "       -nochecksubdirs  : Do not check the SUBDIRS"
     echo "       -norestr         : Do not build the restricted.sh file"
     echo "       -nosrc           : Do not update the src tree"
-    echo "       -srccvs          : Update the src tree via CVS, don't use a pre-existing snapshot"
+    echo "       -srcvcs          : Update the src tree via CVS, don't use a pre-existing snapshot"
     echo "       -noports         : Do not update the ports tree"
-    echo "       -portscvs        : Update the ports tree via CVS, don't use a pre-existing snapshot"
+    echo "       -portsvcs        : Update the ports tree via CVS, don't use a pre-existing snapshot"
     echo "       -noplistcheck    : Don't check the plist during the build"
     echo "       -nodistfiles     : Don't collect distfiles"
     echo "       -fetch-original  : Fetch from original MASTER_SITE"
@@ -272,9 +272,9 @@ nobuild=0
 noindex=0
 noduds=0
 nosrc=0
-srccvs=0
+srcvcs=0
 noports=0
-portscvs=0
+portsvcs=0
 norestr=0
 nochecksubdirs=0
 noplistcheck=0
@@ -308,14 +308,14 @@ while [ $# -gt 0 ]; do
 	x-nosrc)
 	    nosrc=1
 	    ;;
-	x-srccvs)
-	    srccvs=1
+	x-srccvs|x-srcvcs)
+	    srcvcs=1
 	    ;;
 	x-noports)
 	    noports=1
 	    ;;
-	x-portscvs)
-	    portscvs=1
+	x-portscvs|x-portsvcs)
+	    portsvcs=1
 	    ;;
 	x-norestr)
 	    norestr=1
@@ -370,7 +370,7 @@ else
     skipstart=0
 fi
 
-# XXX check for conflict between -noports and -portscvs etc
+# XXX check for conflict between -noports and -portsvcs etc
 
 # We have valid options, start the build
 
@@ -447,14 +447,14 @@ if [ "$skipstart" = 0 ]; then
     fi
 
     if [ ${noports} -eq 0 ]; then
-	if [ -L ${builddir}/ports -o ${portscvs} -eq 1 ]; then
+	if [ -L ${builddir}/ports -o ${portsvcs} -eq 1 ]; then
 	    echo "================================================"
-	    echo "running cvs update -PAd on ${PORTSDIR}"
+	    echo "updating ${PORTSDIR} from ${VCS}"
 	    echo "================================================"
 	    cd ${PORTSDIR}
-	    updated=$(date)
+	    updated=$(date '+%Y/%m/%d %H:%M')
 	    echo ${updated} > ${builddir}/.updated
-	    cvs -Rq update -PdA -D "${updated}"
+	    ${VCS} ${VCS_UPDATE_DATE} "${updated}"
 	    # XXX Check for conflicts
 	else
 	    # echo "XXX at build portsupdate portsupdate ${arch} ${branch} ${buildid} $@ "
@@ -474,13 +474,13 @@ if [ "$skipstart" = 0 ]; then
     # Create tarballs for distributing to clients.  Should not cause
     # much extra delay because we will do this in conjunction with
     # recursing over the ports tree anyway just below, and might have
-    # just finished cvs updating, so it is likely to be in cache.
+    # just finished vcs updating, so it is likely to be in cache.
     portstar &
 
     if [ ${nosrc} -eq 0 ]; then
-	if [ -L ${builddir}/src -o ${srccvs} -eq 1 ]; then
+	if [ -L ${builddir}/src -o ${srcvcs} -eq 1 ]; then
 	    echo "================================================"
-	    echo "running cvs update -PAd on ${SRC_BASE}"
+	    echo "updating ${SRC_BASE} from ${VCS}"
 	    echo "================================================"
 	    cd ${SRC_BASE}
 	    if [ -z "${updated}" ]; then
@@ -488,7 +488,7 @@ if [ "$skipstart" = 0 ]; then
 		# with the ports update
 		updated=$(date)
 	    fi
-	    cvs -Rq update -PdA -D "${updated}"
+	    ${VCS} ${VCS_UPDATE_ARGS} "${updated}"
 	    # XXX Check for conflicts
 	else
 	    build srcupdate ${arch} ${branch} ${buildid} $@ 

Modified: projects/portbuild/scripts/makeworld
==============================================================================
--- projects/portbuild/scripts/makeworld	Tue Apr 26 07:30:52 2011	(r221055)
+++ projects/portbuild/scripts/makeworld	Tue Apr 26 08:18:00 2011	(r221056)
@@ -29,7 +29,7 @@ export TARGET_ARCH=${arch}
 export NO_FSCHG=1
 
 client=0
-nocvs=0
+novcs=0
 
 # optional arguments
 while [ $# -gt 0 ]; do
@@ -37,8 +37,8 @@ while [ $# -gt 0 ]; do
     -client)
       client=1
       ;;
-    -nocvs)
-      nocvs=1
+    -nocvs|-novcs)
+      novcs=1
       ;;
     *)
       args="$1 ${args}"
@@ -57,10 +57,10 @@ else
 fi
 cd ${SRC_BASE}
 
-if [ "$nocvs" = "0" ]; then
+if [ "$novcs" = "0" ]; then
 	echo "==> Updating source tree"
 	eval tag=\$SRC_BRANCH_${branch}_TAG
-  	cvs -Rq update -PdA -r ${tag} || exit $?
+  	${VCS} ${VCS_UPDATE_TAG} ${tag} || exit $?
 fi
 
 echo "==> Starting make buildworld"

Modified: projects/portbuild/scripts/processfail
==============================================================================
--- projects/portbuild/scripts/processfail	Tue Apr 26 07:30:52 2011	(r221055)
+++ projects/portbuild/scripts/processfail	Tue Apr 26 08:18:00 2011	(r221056)
@@ -58,7 +58,7 @@ sort -r -n -k 4 -t \| failure > newfailu
 IFS='|'
 while read dir name ver date last count; do
     echo "<tr>" >> $of
-    echo "<td><a href=\"http://cvsweb.freebsd.org/ports/$dir\">$dir</a></td>" >> $of
+    echo "<td><a href=\"${VCSWEB}/ports/$dir\">$dir</a></td>" >> $of
     if [ -L ${pb}/${arch}/${branch}/latest/${dir} ]; then
       err=$(readlink ${pb}/${arch}/${branch}/latest/${dir})
       echo "<td><a href=\"${arch}-errorlogs/$(basename $(dirname ${err}))/$(basename ${err})\">$ver</a></td>" >> $of
@@ -67,7 +67,7 @@ while read dir name ver date last count;
     fi
 
 #    echo "<td align=\"right\">$affby</td><td align=\"right\">$4 Kb</td>" >> $of
-#    echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
+#    echo "<td><a href=\"${VCSWEB}/ports/$5\">$5</a></td>" >> $of
 #    echo "<td><a href=\"mailto:$6\">$6</a></td>" >> $of
 #    echo "<td>" >> $of
 

Modified: projects/portbuild/scripts/processlogs
==============================================================================
--- projects/portbuild/scripts/processlogs	Tue Apr 26 07:30:52 2011	(r221055)
+++ projects/portbuild/scripts/processlogs	Tue Apr 26 08:18:00 2011	(r221056)
@@ -175,7 +175,7 @@ sort .logs/.all | while read line; do
     affby="$3"
     test "${affby}" = "0" -o "${affby}" = "-1" && affby="&nbsp;"
     echo "<td align=\"right\">${affby}</td><td align=\"right\">$4 Kb</td>" >> $of
-    echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
+    echo "<td><a href=\"${VCSWEB}/ports/$5\">$5</a></td>" >> $of
     echo "<td>$mailto</td>" >> $of
     echo "<td>" >> $of
 
@@ -211,7 +211,7 @@ sort -t \| +4 .logs/.all | while read li
 
     echo "<tr>" >> $of
 
-    echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
+    echo "<td><a href=\"${VCSWEB}/ports/$5\">$5</a></td>" >> $of
 
     affby="$3"
     test "${affby}" = "0" -o "${affby}" = "-1" && affby="&nbsp;"
@@ -258,7 +258,7 @@ sort -t \| +5 .logs/.all | while read li
     affby="$3"
     test "${affby}" = "0" -o "${affby}" = "-1" && affby="&nbsp;"
     echo "<td align=\"right\">${affby}</td><td align=\"right\">$4 Kb</td>" >> $of
-    echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
+    echo "<td><a href=\"${VCSWEB}/ports/$5\">$5</a></td>" >> $of
 
     echo "<td>" >> $of
     test "$9" = "broken" && echo "<font color=\"red\">[B]</font>" >> $of
@@ -304,7 +304,7 @@ sort -t \| +7 .logs/.all | while read li
     affby="$3"
     test "${affby}" = "0" -o "${affby}" = "-1" && affby="&nbsp;"
     echo "<td align=\"right\">${affby}</td><td align=\"right\">$4 Kb</td>" >> $of
-    echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
+    echo "<td><a href=\"${VCSWEB}/ports/$5\">$5</a></td>" >> $of
     echo "<td>$mailto</td>" >> $of
 
     date=`echo ${10} | sed -e "s/_/ /g"`
@@ -343,7 +343,7 @@ sort -t \| +9 .logs/.all | while read li
     affby="$3"
     test "${affby}" = "0" -o "${affby}" = "-1" && affby="&nbsp;"
     echo "<td align=\"right\">${affby}</td><td align=\"right\">$4 Kb</td>" >> $of
-    echo "<td><a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$5\">$5</a></td>" >> $of
+    echo "<td><a href=\"${VCSWEB}/ports/$5\">$5</a></td>" >> $of
     echo "<td>$mailto</td>" >> $of
 
     echo "<td>" >> $of

Modified: projects/portbuild/scripts/processlogs2
==============================================================================
--- projects/portbuild/scripts/processlogs2	Tue Apr 26 07:30:52 2011	(r221055)
+++ projects/portbuild/scripts/processlogs2	Tue Apr 26 08:18:00 2011	(r221056)
@@ -38,7 +38,7 @@ else
     echo -n "$size KB" >>$of
     echo -n "</td><td valign=\"top\">" >>$of
     dir=$(sed -n -e '5p' $log.log | awk '{print $3}' | sed -e 's,^/[^/]*/[^/]*/,,')
-    echo -n "<a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$dir\">$dir</a>" >>$of
+    echo -n "<a href=\"${VCSWEB}/ports/$dir\">$dir</a>" >>$of
     echo -n "</td><td valign=\"top\">" >>$of
     maint=$(sed -n -e '4p' $log.log | awk '{print $3}')
     maints="$maints $maint"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104260818.p3Q8I0TF013696>