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

svn at pcbsd.org svn at pcbsd.org
Wed Aug 15 11:48:31 PDT 2012


Author: kris
Date: 2012-08-15 18:48:30 +0000 (Wed, 15 Aug 2012)
New Revision: 18451

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

Speed up the pkg_add process, we can skip pre-reqs that already installed



Modified: pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
===================================================================
--- pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2012-08-15 18:00:05 UTC (rev 18450)
+++ pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2012-08-15 18:48:30 UTC (rev 18451)
@@ -117,6 +117,13 @@
 		   fi
 
 		else
+		   # Check if the package is already installed
+		   if [ -d "${_chroot}/var/db/pkg/$pkg" ] ; then
+		     echo "Skipping installed package: $pkg"
+		     echo "Skipping installed package: $pkg" >>${LOGFILE}
+		     continue
+		   fi
+
 		   echo "Installing package: $pkg"
 		   echo "Installing package: $pkg" >>${LOGFILE}
 		   if [ -z "$_chroot" ] ; then
@@ -135,6 +142,12 @@
 	if [ "$loc" = "NET" ] ; then
            for pkg in $PKGLIST
            do
+	      # Check if the package is already installed
+	      if [ -d "${_chroot}/var/db/pkg/$pkg" ] ; then
+	         echo "Skipping installed package: $pkg"
+	         echo "Skipping installed package: $pkg" >>${LOGFILE}
+	         continue
+	      fi
 	      echo "Installing package: $pkg"
 	      echo "Installing package: $pkg" >>${LOGFILE}
 	      ${_chrootcmd} pkg_add -f -F "${TMPDIR}/${pkg}.txz" >>${LOGFILE} 2>>${LOGFILE}



More information about the Commits mailing list