Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2012 17:54:29 +0000 (UTC)
From:      Poul-Henning Kamp <phk@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244269 - head/tools/tools/sysbuild
Message-ID:  <201212151754.qBFHsT5D008579@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: phk
Date: Sat Dec 15 17:54:29 2012
New Revision: 244269
URL: http://svnweb.freebsd.org/changeset/base/244269

Log:
  Update to the new and brighter pkg world

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==============================================================================
--- head/tools/tools/sysbuild/sysbuild.sh	Sat Dec 15 17:19:36 2012	(r244268)
+++ head/tools/tools/sysbuild/sysbuild.sh	Sat Dec 15 17:54:29 2012	(r244269)
@@ -225,37 +225,49 @@ ports_build() (
 	# Now build & install them
 	for p in `cat /tmp/_.plist`
 	do
+		b=`echo $p | tr / _`
 		t=`echo $p | sed 's,/usr/ports/,,'`
 		pn=`cd $p && make package-name`
-		if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.tbz ] ; then
-			if [ "x$use_pkg" = "x-p" ] ; then
-				log_it "install $p from ${PKG_DIR}/$pn.tbz"
-				pkg_add ${PKG_DIR}/$pn.tbz
-			fi
+
+		if pkg info $pn > /dev/null 2>&1 ; then
+			log_it "Already installed: $t ($pn)"
+			continue
 		fi
-		i=`pkg_info -qO $t`
-		if [ -z "$i" ] ; then
-			log_it "build $p"
-			b=`echo $p | tr / _`
+
+		if [ "x$p" == "x/usr/ports/ports-mgmt/pkg" ] ; then
+			log_it "Very Special: $t ($pn)"
 			(
-				set -x
-				cd /usr/ports
-				cd $p
-				set +e
-				make clean ${PORTS_OPTS}
-				if make install ${PORTS_OPTS} ; then
-					if [ "x${PKG_DIR}" != "x" ] ; then
-						make package ${PORTS_OPTS}
-						mkdir -p ${PKG_DIR}
-						mv *.tbz ${PKG_DIR}
-					fi
-				else
-					log_it FAIL build $p
-				fi
-				make clean
+			cd $p
+			make clean all install ${PORTS_OPTS}
 			) > _.$b 2>&1 < /dev/null
-			date
+			continue
+		fi
+
+		if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.txz ] ; then
+			if [ "x$use_pkg" = "x-p" ] ; then
+				log_it "Install $t ($pn)"
+				(
+				set +e
+				pkg add ${PKG_DIR}/$pn.txz || true
+				) > _.$b 2>&1 < /dev/null
+				continue
+			fi
 		fi
+
+		log_it "build $pn ($p)"
+		(
+			set +e
+			cd $p
+			make clean ${PORTS_OPTS}
+			if make install ${PORTS_OPTS} ; then
+				if [ "x${PKG_DIR}" != "x" ] ; then
+					make package ${PORTS_OPTS}
+				fi
+			else
+				log_it FAIL build $p
+			fi
+			make clean
+		) > _.$b 2>&1 < /dev/null
 	done
 )
 
@@ -463,7 +475,7 @@ export PORTS_OPTS
 #######################################################################
 
 log_it Prepare destination partition
-newfs -O2 -U /dev/${TARGET_PART} > /dev/null
+newfs -t -E -O2 -U /dev/${TARGET_PART} > /dev/null
 mount /dev/${TARGET_PART} ${SBMNT}
 mkdir -p ${SBMNT}/dev
 mount -t devfs devfs ${SBMNT}/dev
@@ -564,7 +576,7 @@ sed "/[ 	]\/[ 	]/s;^[^ 	]*[ 	];/dev/${TA
 	/etc/fstab > ${SBMNT}/etc/fstab
 
 log_it build ports
-pwd
+
 cp $0 ${SBMNT}/root
 cp /tmp/_sb_log ${SBMNT}/tmp
 b=`basename $0`



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