[PC-BSD Commits] r8092 - pcbsd/current/src-sh/pbi-manager

svn at pcbsd.org svn at pcbsd.org
Tue Nov 30 09:28:36 PST 2010


Author: kris
Date: 2010-11-30 09:28:36 -0800 (Tue, 30 Nov 2010)
New Revision: 8092

Modified:
   pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:

Do the PBI_CONFDIR check after we've overridden for chroot, and also cleanup
any chroot dirs before starting new build



Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2010-11-30 17:03:42 UTC (rev 8091)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2010-11-30 17:28:36 UTC (rev 8092)
@@ -871,9 +871,6 @@
                         shift
 			get_abspath "$1"
 			PBI_CONFDIR="$_ABSPATH"
-			if [ ! -d "${PBI_CONFDIR}" ] ; then
-				exit_err "Invalid confdir (${PBI_CONFDIR})"
-			fi
                         ;;
                 -d)
                         if [ $# -eq 1 ]; then usage_make_pbi; fi
@@ -924,6 +921,11 @@
 		exit_err "No port (${PORTSDIR}/${PBI_MAKEPORT})"
 	fi
 
+	# Make sure we have a valid PBI_CONFDIR
+	if [ ! -d "${PBI_CONFDIR}" ] ; then
+		exit_err "Invalid confdir (${PBI_CONFDIR})"
+	fi
+
 	# Source the config file
 	if [ ! -z "${PBI_CONFDIR}" ]; then load_pbi_conffile ; fi
 
@@ -1157,10 +1159,11 @@
 	if [ "${PBI_KEEPBUILDFILES}" = "YES" ] ; then return ; fi
 	if [ -z "${PBI_PROGDIRPATH}" ] ; then return ; fi
 	if [ "`basename $0`" = "pbi_makeport_chroot" -a -d "${PBI_PROGDIRPATH}" ] ; then 
+		echo "Cleaning ${PBI_PBIPROGDIRPATH}"
 		rm -rf "${PBI_PROGDIRPATH}" 
 	fi
 	if [ -z "$PBI_CHROOTDIR" ] ; then return ; fi
-	rm -rf "${PBI_CHROOTDIR}"
+	chroot_make_cleanup
 }
 
 # Load PBI conf options
@@ -4706,6 +4709,7 @@
 	if [ "${PBI_CHROOTDIR}" = "/" ] ; then return ; fi
 	
 	# Unmount /dev if mounted
+	echo "Cleaning $PBI_CHROOTDIR"
 	umount ${PBI_CHROOTDIR}/dev >/dev/null 2>/dev/null
 	umount ${PBI_CHROOTDIR}/usr/ports/distfiles >/dev/null 2>/dev/null
 	rm -rf "${PBI_CHROOTDIR}" >/dev/null 2>/dev/null
@@ -4719,8 +4723,13 @@
 	# If no chroot file exists, make it first
 	if [ ! -e "${PBI_CHROOTFILE}" ] ; then mk_chroot_file ; fi
 
+	# Set the chroot path
 	PBI_CHROOTDIR="${PBI_PROGDIRPATH}.chroot"
 	export PBI_CHROOTDIR
+	
+	# See if there is old chroot to clean first
+	chroot_make_cleanup
+
 	mkdir -p "${PBI_CHROOTDIR}"
 	echo "Extracting chroot environment..."
 	tar xvf ${PBI_CHROOTFILE} -C "${PBI_CHROOTDIR}" >/dev/null 2>/dev/null



More information about the Commits mailing list