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

svn at pcbsd.org svn at pcbsd.org
Tue Nov 9 06:03:31 PST 2010


Author: kris
Date: 2010-11-09 06:03:30 -0800 (Tue, 09 Nov 2010)
New Revision: 8005

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


Improve logic in moving older PBI versions to the archived folder


Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2010-11-07 22:19:19 UTC (rev 8004)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2010-11-09 14:03:30 UTC (rev 8005)
@@ -3388,8 +3388,7 @@
 	cd "${PBI_AB_CONFDIR}"
 	init_tmpdir
 	
-	find . -type f -name "${PBI_CONFFILE}" | grep -v '\.svn' >"${PBI_TMPDIR}/.autob.$$"
-	while read pbi
+	for pbi in `find . -type f -name "${PBI_CONFFILE}" | grep -v '\.svn'`
 	do
 		# Figure out the target port for this build
 		PBI_MAKEPORT=""
@@ -3417,8 +3416,7 @@
 			echo "${PBI_MAKEPORT} is up to date"
 		fi
 
-	done < ${PBI_TMPDIR}/.autob.$$
-	rm "${PBI_TMPDIR}/.autob.$$"
+	done
 }
 
 # Prune any outdir files which don't have matching modules
@@ -3468,6 +3466,14 @@
 		rm "${_od}/build.log.bz2"
 	fi
 
+	# Move old PBIs to archived folder
+	get_pbi_progversion
+        oldVersion=`cat ${PBI_AB_OUTDIR}/${_cd}/pbi-version`
+	if [ "$oldVersion" != "$PBI_PROGVERSION" -a ! -z "`ls ${_od}/*.pbi 2>/dev/null`" ]; then
+		oldpbi="`ls ${_od}/*.pbi 2>/dev/null`"
+		archive_old_pbis "$_od" "$oldpbi" "$PBI_AB_ARCHIVENUM"
+	fi
+
 	# Add some header info to log file
 	echo "Starting build: `date`" >${_od}/build.log
 	echo "Build Command:" >>${_od}/build.log
@@ -3478,24 +3484,6 @@
 	pbi_makeport ${_flags} ${_mp} >>${_od}/build.log 2>>${_od}/build.log
 	if [ "$?" = "0" ] ; then
 
-		# Check for new PBIs, don't want to remove a rebuild of the same version
-		newpbi="`ls ${_od}/*.pbi 2>/dev/null`"
-
-		# Deal old PBIs if we need to
-		if [ "$newpbi" != "$oldpbi" ] ; then
-			if [ ! -z "$PBI_AB_ARCHIVENUM" ] ; then
-				# Move the old PBIs to the archived folder
-				archive_old_pbis "$_od" "$oldpbi" "$PBI_AB_ARCHIVENUM"
-			else
-				# Remove old PBI stuff
-				for _oldPBI in $oldpbi
-				do
-			  	 	rm "$_oldPBI"
-			  	 	rm "${_oldPBI}.sha256" >/dev/null 2>/dev/null
-				done
-			fi
-		fi
-
 		echo "$PBI_PROGVERSION" > "${_od}/pbi-version"
 		if [ ! -z "$PBI_BUILDKEY" ] ; then
 			echo "$PBI_PROGVERSION" > "${_od}/pbi-buildkey"



More information about the Commits mailing list