[PC-BSD Commits] r7503 - pcbsd/current/src-qt4/pc-metapkgmanager

svn at pcbsd.org svn at pcbsd.org
Fri Sep 3 08:28:33 PDT 2010


Author: kris
Date: 2010-09-03 08:28:33 -0700 (Fri, 03 Sep 2010)
New Revision: 7503

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

Update to pc-metapkgmanager, add some key strings that get echo'd when we begin to install / remove
packages, we can parse for these in the GUI



Modified: pcbsd/current/src-qt4/pc-metapkgmanager/pc-metapkgmanager
===================================================================
--- pcbsd/current/src-qt4/pc-metapkgmanager/pc-metapkgmanager	2010-09-03 14:00:00 UTC (rev 7502)
+++ pcbsd/current/src-qt4/pc-metapkgmanager/pc-metapkgmanager	2010-09-03 15:28:33 UTC (rev 7503)
@@ -59,18 +59,18 @@
 		loc="PATH"
 	fi
 
+	echo "Installing Meta-Package: $_apkg"
+
         # Now query pkg_info to confirm each pkg is installed
         while read pkg
         do
-		echo "Installing package: $pkg"
-
 		# Start installing the packages now
 		if [ "$loc" = "NET" ] ; then
 			PACKAGESITE="$2" ; export PACKAGESITE
-			pkg_add -r "$pkg"
+			pkg_add -r "$pkg" 2>/dev/null
 		else
 			cd "${2}"
-			pkg_add "${pkg}.tbz"
+			pkg_add "${pkg}.tbz" 2>/dev/null
 		fi
         done < ${MPDIR}/${_apkg}/pkg-list
 	
@@ -82,6 +82,8 @@
 	if [ ! -e "${MPDIR}/${1}/pkg-list" ] ; then exit_err "No such meta-pkg: $1" ; fi
 	_dpkg=$1
 
+	echo "Removing Meta-Package: $_dpkg"
+
 	# Build a list of installed meta-pkgs
 	for i in `find ${MPDIR}/* -type d`
 	do
@@ -148,8 +150,7 @@
 check_remove_pkg() {
         pkg_info -R "${1}" | grep "Required" >/dev/null 2>/dev/null
         if [ "$?" != "0" ] ; then
-                echo "Removing unused pkg: ${1}"
-                pkg_delete ${1}
+                pkg_delete ${1} >/dev/null 2>/dev/null
                 return 0
         fi
         return 1
@@ -226,6 +227,9 @@
 		exit_err "Internal error, must use add/del for parse_metapkgs"
 	fi
 
+	get_num_pkgs "$list"
+	echo "Pending Meta-Package changes: $VAL"
+
  	local list
 	list=`echo "$1" | sed 's|,| |g'`	
 	for z in $list
@@ -233,8 +237,18 @@
 		if [ "$2" = "add" ] ; then add_metapkgs "$z" "$3" ; fi
 		if [ "$2" = "del" ] ; then del_metapkgs "$z" ; fi
 	done
+
+	echo "Meta-Package changes finished!"
+
 }
 
+
+# Get the number of packages we are working on
+get_num_pkgs() {
+        VAL=`echo $1 | sed 's|,| |g' | wc -w | tr -d ' '`
+}
+
+
 # Figure out which mode we are running in
 case ${1} in
    list) list_metapkgs ;;



More information about the Commits mailing list