[PC-BSD Commits] r7946 - pcbsd/current/src-sh/pc-metapkgmanager

svn at pcbsd.org svn at pcbsd.org
Fri Oct 29 10:59:08 PDT 2010


Author: kris
Date: 2010-10-29 10:59:07 -0700 (Fri, 29 Oct 2010)
New Revision: 7946

Modified:
   pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
Log:

Improve pc-metapkgmanager error checking, since there may be cases where
we don't install every single port, we need to check if all the base
meta ports did install



Modified: pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
===================================================================
--- pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2010-10-29 17:04:58 UTC (rev 7945)
+++ pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2010-10-29 17:59:07 UTC (rev 7946)
@@ -73,14 +73,16 @@
 		if [ "$loc" = "NET" ] ; then
 			PACKAGESITE="$2" ; export PACKAGESITE
 			pkg_add -f -r "$pkg" >>${LOGFILE} 2>>${LOGFILE}
-			if [ "$?" != "0" ] ; then _pkgStatus=1 ; fi
 		else
 			cd "${2}"
 			pkg_add -f "${pkg}.tbz" >>${LOGFILE} 2>>${LOGFILE}
-			if [ "$?" != "0" ] ; then _pkgStatus=1 ; fi
 		fi
         done < ${MPDIR}/${_apkg}/pkg-list
 
+	# Make sure the program appears fully installed now, if not set error
+	stat_metapkg ${_apkg}
+	if [ "$?" != "0" ] ; then _pkgStatus=1 ; fi
+
 	# Apply our PC-BSD specific xdg menu entry files
 	/usr/local/bin/pc-xdgutil updatemenu
 
@@ -141,6 +143,10 @@
 
 	done < ${MPDIR}/${_dpkg}/pkg-list
 
+	# If the program is still fully installed, set status to error
+	stat_metapkg ${_dpkg}
+	if [ "$?" = "0" ] ; then _pkgStatus=1 ; fi
+
         # Now check what packages we have and prune those whom aren't needed
 	echo "Pruning unused packages... This may take a while..."
         while
@@ -233,15 +239,17 @@
 
 	if [ "$found" = "0" -a "$nfound" = "0" ] ; then
 		echo "The meta-pkg $_mpkg is installed"
+		return 0
 	fi
 	if [ "$found" = "0" -a "$nfound" = "1" ] ; then
 		echo "The meta-pkg $_mpkg is partially installed"
+		return 1
 	fi
 	if [ "$found" = "1" ] ; then
 		echo "The meta-pkg $_mpkg is not installed"
+		return 255
 	fi
 
-	exit 0
 }
 
 # Read through comma delimited list of meta-pkgs



More information about the Commits mailing list