Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jun 2014 17:54:54 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r267288 - user/nwhitehorn/condorports
Message-ID:  <201406091754.s59HssFR045409@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Mon Jun  9 17:54:53 2014
New Revision: 267288
URL: http://svnweb.freebsd.org/changeset/base/267288

Log:
  Make sure OSVERSION is set correctly when building a different-release
  package set.

Modified:
  user/nwhitehorn/condorports/buildport.sh
  user/nwhitehorn/condorports/buildportsdag.sh
  user/nwhitehorn/condorports/stagebuildfiles.sh

Modified: user/nwhitehorn/condorports/buildport.sh
==============================================================================
--- user/nwhitehorn/condorports/buildport.sh	Mon Jun  9 17:22:49 2014	(r267287)
+++ user/nwhitehorn/condorports/buildport.sh	Mon Jun  9 17:54:53 2014	(r267288)
@@ -13,6 +13,7 @@ portsdir=$5
 scratchdir=$(pwd)
 
 echo Building $pkg \(origin $port\) for $release on `hostname`
+# XXX: set UNAME_r?
 
 set -e
 sudo /pkgscripts/prepbuildjail $_CONDOR_SLOT $release $portsdir
@@ -21,6 +22,8 @@ cat $tarballname | sudo jexec $_CONDOR_S
 # XXX: work around bug in pkg
 sudo jexec $_CONDOR_SLOT /etc/rc.d/ldconfig start
 
+portsdir=/buildshare/ports/$portsdir
+
 echo 'Make depends'
 sudo jexec $_CONDOR_SLOT make -C $port depends USE_PACKAGE_DEPENDS=true BATCH=true WRKDIRPREFIX=/obj DISABLE_MAKE_JOBS=true PKGREPOSITORY=/packages PACKAGES=/packages DISTDIR=/distfiles PORTSDIR=$portsdir PACKAGE_BUILDING=1
 echo 'Make install'

Modified: user/nwhitehorn/condorports/buildportsdag.sh
==============================================================================
--- user/nwhitehorn/condorports/buildportsdag.sh	Mon Jun  9 17:22:49 2014	(r267287)
+++ user/nwhitehorn/condorports/buildportsdag.sh	Mon Jun  9 17:54:53 2014	(r267288)
@@ -1,4 +1,11 @@
 #!/bin/sh
+
+# Example:
+# DISTHORDE=/scratch/horde ARCH=powerpc RELEASE=powerpc-10-0 PKGSDIR=/scratch/output/powerpc ./buildportsdag.sh 355755 ports-ppc.dag
+
+
+export PORTSDIR=/buildshare/ports/$1
+
 : ${PKGSDIR=$PORTSDIR/packages}
 : ${DISTHORDE=$PORTSDIR/distfiles}
 : ${ARCH=`uname -p`}
@@ -7,17 +14,20 @@
 : ${__MAKE_CONF=/dev/null}; export __MAKE_CONF
 
 export PORT_DBDIR=/var/empty # Avoid host contamination
-PORTSDIR=$1
+OUTDAG=$2
+PORTSET=$1
 
 mkdir -p $STAGEDIR
 
+export OSVERSION=$(tar xOf /buildshare/releases/$RELEASE.tar usr/include/sys/param.h | awk '/^\#define[[:blank:]]__FreeBSD_version/ {print $3}')
+
 dagjobs=$(pwd)/ports.dagjobs
 dagdeps=$(pwd)/ports.dagdeps
-dag=$(pwd)/ports.dag
+dag=$(pwd)/$OUTDAG
 rm -f $dagjobs $dagdeps
-for category in $(make -C /buildshare/ports/$PORTSDIR -V SUBDIR); do for port in $(make -C /buildshare/ports/$PORTSDIR/$category -V SUBDIR); do
+for category in $(make -C $PORTSDIR -V SUBDIR); do for port in $(make -C $PORTSDIR/$category -V SUBDIR); do
 	echo $category/$port
-	job=/buildshare/ports/$PORTSDIR/$category/$port
+	job=$PORTSDIR/$category/$port
 	cd $job
 	echo JOB $job package.sub >> $dagjobs
 	# One fetch for all archs with dummy fetch job?
@@ -25,13 +35,13 @@ for category in $(make -C /buildshare/po
 	export UNAME_p=$ARCH
 	PKGNAME=$(make package-name)
 	TARBALL=$STAGEDIR/stage-$category-$port.tar
-	echo SCRIPT PRE $job stagebuildfiles.sh $job $PKGSDIR $ARCH $TARBALL $DISTHORDE /buildshare/ports/$PORTSDIR >> $dagjobs
+	echo SCRIPT PRE $job stagebuildfiles.sh $job $PKGSDIR $ARCH $OSVERSION $TARBALL $DISTHORDE $PORTSDIR >> $dagjobs
 	echo SCRIPT POST $job postbuild.sh $TARBALL \$RETURN >> $dagjobs
 	echo VARS $job BuildArch=\"$ARCH\" >> $dagjobs
 	echo VARS $job port=\"$job\" >> $dagjobs
 	echo VARS $job pkg=\"$PKGNAME.txz\" >> $dagjobs
 	echo VARS $job pkgdir=\"$PKGSDIR/All\" >> $dagjobs
-	echo VARS $job portsdir=\"$PORTSDIR\" >> $dagjobs
+	echo VARS $job portsdir=\"$PORTSET\" >> $dagjobs
 	echo VARS $job stagetarball=\"$TARBALL\" >> $dagjobs
 	echo VARS $job release=\"$RELEASE\" >> $dagjobs
 	deps=$(make -V _DEPEND_DIRS LOCALBASE=/var/empty)
@@ -41,4 +51,5 @@ for category in $(make -C /buildshare/po
 done; done
 
 cat $dagjobs $dagdeps > $dag
+echo JOBSTATE_LOG $dag.joblog >> $dag
 rm -f $dagjobs $dagdeps

Modified: user/nwhitehorn/condorports/stagebuildfiles.sh
==============================================================================
--- user/nwhitehorn/condorports/stagebuildfiles.sh	Mon Jun  9 17:22:49 2014	(r267287)
+++ user/nwhitehorn/condorports/stagebuildfiles.sh	Mon Jun  9 17:54:53 2014	(r267288)
@@ -3,19 +3,24 @@
 # Build tarball of interesting subset of ports tree, relevant distfiles,
 # dependent packages?
 
+mkdir -p $(dirname $5)
+exec 2>&1
+exec 1>$5.log
+
 set -e
 export UNAME_p=$3
 export __MAKE_CONF=/dev/null
-DISTHORDE=$5
+export OSVERSION=$4
+DISTHORDE=$6
 
 export PORT_DBDIR=/var/empty
-export PORTSDIR=$6
+export PORTSDIR=$7
 export PACKAGE_BUILDING=1
 
 # Fetch distfiles if unfetched
 cd $1
-make -DBATCH checksum DISTDIR=$DISTHORDE
-make -DBATCH package-links PACKAGES=$2
+make -d e -DBATCH checksum DISTDIR=$DISTHORDE
+make -d e -DBATCH package-links PACKAGES=$2
 mkdir -p $2/All
 
 export LOCALBASE=/var/empty # Delay this since make checksum and package-links depend on pkg
@@ -24,7 +29,7 @@ export LOCALBASE=/var/empty # Delay this
 # relevant sections of the ports tree, all dependent packages
 # Need POST script to clean up
 
-TARBALL=$4
+TARBALL=$5
 mkdir -p $(dirname $TARBALL)
 
 # Find distfiles
@@ -43,7 +48,9 @@ fi
 if [ -n "$PKGLIST" ]; then
 	ln -s $PKGLIST $TARBALL-dir/packages
 fi
+echo 'Building tarball'
 tar -c -C $TARBALL-dir -v -L -f $TARBALL distfiles packages
 rm -rf $TARBALL-dir
 set +e
 
+rm $5.log



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