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

svn at pcbsd.org svn at pcbsd.org
Mon Mar 7 05:52:57 PST 2011


Author: kris
Date: 2011-03-07 05:52:57 -0800 (Mon, 07 Mar 2011)
New Revision: 9549

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

Don't merge to the hashdir a PBI which was just flagged for deletion



Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-03-07 10:23:00 UTC (rev 9548)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-03-07 13:52:57 UTC (rev 9549)
@@ -2736,7 +2736,13 @@
 		file="`echo $hl | sed 's/:::.*$//g'`"
 		hash="`echo $hl | sed 's/^.*::://g'`"
 		tfile="${file}:::${hash}"
-		
+
+		# If we are trying to merge a PBI which was deleted, stop
+		if [ ! -z "${2}" -a -e "${2}" ] ; then
+			echo "HASHDONE - Deleted" 
+			return
+		fi
+
 		# Make sure the target file hasnt been removed
 		if [ ! -e "${1}/${file}" ] ; then continue ; fi
 
@@ -3761,6 +3767,9 @@
 	load_info_from_dir "${PBI_DBAPPDIR}/${PBI_DELETENAME}"
 	PBI_PROGDIRPATH="${PBI_ORIGPROGDIRPATH}"
 
+	# Set the dirty flag that we are removing this PBI
+	touch ${PBI_DBAPPDIR}/${PBI_DELETENAME}/.pbiDeleted
+
 	check_preremove_script
 	run_remove_script
  	remove_pbidir
@@ -3999,7 +4008,7 @@
 
 				# Lets start this hash merge
 				echo "Adding ${_hpbipath} to hash-dir: `date`" >> ${_pbid_log}
-				pbi_add_update_hashdir "${_hpbipath}" >${_redir} 2>${_redir}
+				pbi_add_update_hashdir "${_hpbipath}" "${PBI_DBAPPDIR}/${_hpbi}/.pbiDeleted" >${_redir} 2>${_redir}
 				echo "Finished adding ${_hpbipath} to hash-dir: `date`" >> ${_pbid_log}
 				
 				# Now remove the trigger file



More information about the Commits mailing list