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

svn at pcbsd.org svn at pcbsd.org
Thu Nov 3 12:09:01 PDT 2011


Author: kris
Date: 2011-11-03 12:09:01 -0700 (Thu, 03 Nov 2011)
New Revision: 13700

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

Do some cleanup of how we remove stage dir and handle build-only pbi_makeport




Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-11-03 17:40:38 UTC (rev 13699)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-11-03 19:09:01 UTC (rev 13700)
@@ -3741,7 +3741,11 @@
 mk_stage_dir() {
 	PBI_STAGEDIR="${PBI_PROGDIRPATH}/.stagedir"
 	echo "Creating Stage Dir: ${PBI_STAGEDIR}"
-	if [ -e "${PBI_STAGEDIR}" ] ; then rm -rf "${PBI_STAGEDIR}" ; fi
+	if [ -e "${PBI_STAGEDIR}" ] ; then 
+		rm -rf "${PBI_STAGEDIR}" 2>/dev/null
+		chflags -R noschg ${PBI_STAGEDIR} 2>/dev/null
+		rm -rf "${PBI_STAGEDIR}" 2>/dev/null
+	fi
 	mkdir -p ${PBI_STAGEDIR}
 
 	# Build module list of excludes
@@ -3769,7 +3773,11 @@
 rm_stage_dir() {
 	cd ~
 	PBI_STAGEDIR="${PBI_PROGDIRPATH}/.stagedir"
-	if [ -e "${PBI_STAGEDIR}" ] ; then rm -rf "${PBI_STAGEDIR}" ; fi
+	if [ -e "${PBI_STAGEDIR}" ] ; then 
+		rm -rf "${PBI_STAGEDIR}" 2>/dev/null
+		chflags -R noschg ${PBI_STAGEDIR} 2>/dev/null
+		rm -rf "${PBI_STAGEDIR}" 2>/dev/null
+	fi
 }
 
 # See if we need to clean the stagedir
@@ -5954,11 +5962,14 @@
 		# Now re-run pbi_makeport in chroot environment
 		chroot "${PBI_CHROOTDIR}" "/usr/local/sbin/pbi_makeport_chroot" "$@"
 		_err=$?
-		if [ "$_err" = "0" ] ; then
+		if [ "$_err" = "0" -a "${PBI_BUILDONLY}" != "YES" ] ; then
 			mv ${PBI_CHROOTDIR}/pbiout/*.pbi ${PBI_CREATE_OUTDIR}/ 
 			mv ${PBI_CHROOTDIR}/pbiout/*.sha256 ${PBI_CREATE_OUTDIR}/
 		fi
 
+  		# Break here if we are only doing a build
+		if [ "${PBI_BUILDONLY}" = "YES" ] ; then exit_trap; fi
+
 		# Lets cleanup the chroot environment
 		chroot_make_cleanup
 		rm_tmpdir



More information about the Commits mailing list