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

svn at pcbsd.org svn at pcbsd.org
Thu Oct 28 13:08:45 PDT 2010


Author: kris
Date: 2010-10-28 13:08:45 -0700 (Thu, 28 Oct 2010)
New Revision: 7937

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

Log the output of pkg_add / pkg_delete for the user to pick through if
a failure occurs



Modified: pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
===================================================================
--- pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2010-10-28 19:53:26 UTC (rev 7936)
+++ pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2010-10-28 20:08:45 UTC (rev 7937)
@@ -26,6 +26,7 @@
 
 # Define some universals
 MPDIR="/usr/local/share/pcbsd/base-ports"
+LOGFILE="/tmp/.pc-metapkgmanager.log"
 
 display_usage() {
         cat <<EOF
@@ -70,11 +71,11 @@
 		# Start installing the packages now
 		if [ "$loc" = "NET" ] ; then
 			PACKAGESITE="$2" ; export PACKAGESITE
-			pkg_add -f -r "$pkg" >/dev/null 2>/dev/null
+			pkg_add -f -r "$pkg" >>${LOGFILE} 2>${LOGFILE}
 			if [ "$?" != "0" ] ; then _pkgStatus=1 ; fi
 		else
 			cd "${2}"
-			pkg_add -f "${pkg}.tbz" >/dev/null 2>/dev/null
+			pkg_add -f "${pkg}.tbz" >${LOGFILE} 2>${LOGFILE}
 			if [ "$?" != "0" ] ; then _pkgStatus=1 ; fi
 		fi
         done < ${MPDIR}/${_apkg}/pkg-list
@@ -134,7 +135,7 @@
 		if [ "$?" = "0" ] ; then echo "Skipping Required: ${rmPkg}" ; continue; fi
 
 		echo "Removing: ${rmPkg}"
-		pkg_delete ${rmPkg} >/dev/null 2>/dev/null 
+		pkg_delete ${rmPkg} >${LOGFILE} 2>${LOGFILE}
 
 	done < ${MPDIR}/${_dpkg}/pkg-list
 
@@ -247,6 +248,10 @@
 		exit_err "Internal error, must use add/del for parse_metapkgs"
 	fi
 
+	if [ -e "${LOGFILE}" ] ; then
+		rm ${LOGFILE}
+	fi
+
 	get_num_pkgs "$1"
 	echo "Pending Meta-Package changes: $VAL"
 



More information about the Commits mailing list