[PC-BSD Commits] r15868 - pcbsd/current/src-sh/pc-updatemanager

svn at pcbsd.org svn at pcbsd.org
Wed Mar 21 00:42:52 PDT 2012


Author: kris
Date: 2012-03-21 07:42:52 +0000 (Wed, 21 Mar 2012)
New Revision: 15868

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

Remove functionality from pc-updatemanager to do system package updates,
this will belong to the pc-metapkgmanager now



Modified: pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager
===================================================================
--- pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager	2012-03-21 07:39:07 UTC (rev 15867)
+++ pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager	2012-03-21 07:42:52 UTC (rev 15868)
@@ -128,74 +128,6 @@
 	  fi
 	fi
 
-
-	# Now check for package updates
-	if [ -e "base-ports.tlz" ] ; then
-	  openssl dgst -sha1 -verify ${SKEY} \
-	  	-signature base-ports.tlz.sha1 \
-              	base-ports.tlz >/dev/null 2>/dev/null
-	  if [ $? -eq 0 ]; then
-	    rm -rf base-ports
-	    tar xvJf base-ports.tlz >/dev/null 2>/dev/null
-
-	    # If we have a index, check installed pkgs for updates
-	    if [ -e "base-ports/master-pkg-index" ] ; then
-	      fPkgUp=0
-
-	      # Checkout the installed pkgs and compare to master list
-	      ls /var/db/pkg > /tmp/.pkgList.$$
-	      cat base-ports/master-pkg-index | cut -d ":" -f 1-2 | sed 's|:|-|g' > /tmp/.pkgList2.$$
-	      diff /tmp/.pkgList.$$ /tmp/.pkgList2.$$ | grep '^<' | sed 's|< ||g' > /tmp/.dList.$$
-	      rm /tmp/.pkgList.$$
-	      rm /tmp/.pkgList2.$$
-	      while read pLine
-	      do
-		pName=`echo $pLine | rev | cut -d "-" -f 2-25 | rev`
-		pVer=`echo $pLine | rev | cut -d "-" -f 1 | rev`
-		
-	 	# Make sure this version isn't in our index
-		grep "^${pName}:${pVer}" base-ports/master-pkg-index >/dev/null 2>/dev/null
-		if [ $? -eq 0 ] ; then continue ; fi
-
-	        # Get the info from master-pkg-index
-		iLine=`grep "^${pName}:" base-ports/master-pkg-index`
-		if [ -z "$iLine" ] ; then continue ; fi
-
-
-	        iVer="`echo $iLine | cut -d ':' -f 2`"
-	        iSiz="`echo $iLine | cut -d ':' -f 3`"
-	        iFile="`echo $iLine | cut -d ':' -f 4`"
-
-	 	# Is this version different?
-		if [ "$pVer" = "$iVer" ] ; then continue ; fi
-
-		if [ $PATCHFOUND -eq 0 ] ; then
-		  echo "The following updates are available:"
-		  echo "------------------------------------"
-		fi
-		if [ $fPkgUp -eq 0 ] ; then 
-		  echo "The following package updates are available:"
-	          echo "NAME: Package Updates" 
-	          echo "TYPE: PACKAGE" 
-		  fPkgUp=1
-		fi
-	        # Display the pkg update data
-		echo "PKGUPDATE: ${pName} ${pVer} -> ${iVer}"
-		echo "PKGUPDATEKB: ${iSiz}"
-		echo "PKGUPDATEFILE: ${iFile}"
-	      done < /tmp/.dList.$$
-	      rm /tmp/.dList.$$
-
-	      # Display command to use for pkg-updating
-	      if [ $fPkgUp -eq 1 ] ; then 
-		echo " "
-		echo "To install these package updates run \"${0} install pkg-updates\""
-		echo " "
-	      fi
-	    fi
-          fi
-	fi
-
 	echo ""
 
 	# Now check which stand-alone updates are available
@@ -625,143 +557,6 @@
 
 }
 
-start_pkg_updates() {
-	# Start doing pkg-updates
-	cd "${AVAILDIR}/${SYSVER}"
-
-        # Do we have update data
-	if [ ! -e "base-ports.tlz" ] ; then
-   	  exit_err "No package updates available!"
-        fi
-
-        # Verify the signature of the base-ports.tlz
-	openssl dgst -sha1 -verify ${SKEY} \
-		-signature base-ports.tlz.sha1 \
-              	base-ports.tlz >/dev/null 2>/dev/null
-        if [ $? -ne 0 ]; then
-   	  exit_err "No package updates available!"
-	fi
-
-    	rm -rf base-ports
-	tar xvJf base-ports.tlz >/dev/null 2>/dev/null
-
-	# If we have a index, check installed pkgs for updates
-	if [ ! -e "base-ports/master-pkg-index" ] ; then
-   	  exit_err "No package updates available!"
-        fi
-
-	fPkgUp=0
-
-	# Checkout the installed pkgs and compare to master list
-	ls /var/db/pkg > /tmp/.pkgList.$$
-	cat base-ports/master-pkg-index | cut -d ":" -f 1-2 | sed 's|:|-|g' > /tmp/.pkgList2.$$
-	diff /tmp/.pkgList.$$ /tmp/.pkgList2.$$ | grep '^<' | sed 's|< ||g' > /tmp/.dList.$$
-	rm /tmp/.pkgList.$$
-	rm /tmp/.pkgList2.$$
-	while read pLine
-	do
-	  pName=`echo $pLine | rev | cut -d "-" -f 2-25 | rev`
-	  pVer=`echo $pLine | rev | cut -d "-" -f 1 | rev`
-		
-	  # Make sure this version isn't in our index
-	  grep "^${pName}:${pVer}" base-ports/master-pkg-index >/dev/null 2>/dev/null
-	  if [ $? -eq 0 ] ; then continue ; fi
-
-	  # Get the info from master-pkg-index
-	  iLine=`grep "^${pName}:" base-ports/master-pkg-index`
-	  if [ -z "$iLine" ] ; then continue ; fi
-
-	  iFile="`echo $iLine | cut -d ':' -f 4`"
-
-	  # Is this version different?
-	  if [ "$pVer" = "$iVer" ] ; then continue ; fi
-
-	  if [ $fPkgUp -eq 0 ] ; then fPkgUp=1 ; fi
-
-	  # Save what pkg will be updated
-	  echo "${pLine} ${iFile}" >> /tmp/.uList.$$
-
-	done < /tmp/.dList.$$
-	rm /tmp/.dList.$$
-
-	# Exit if no updates found
-	if [ $fPkgUp -ne 1 ] ; then exit_err "No package updates available"; fi
-    	# Create the stage directory for this update
-        STAGEDIR="${DOWNLOADDIR}/.pkg-updates.$$"
-        if [ ! -e "${STAGEDIR}" ] ; then
-          mkdir -p ${STAGEDIR}
-        fi
-
-	# Set the mirror locaion for this major update
-	MIRRORDIR="${MIRRORURL}/${SYSVER}/`uname -m`/netinstall"
-        MIRRORDIR="`echo ${MIRRORDIR} | sed -e 's|://|:::|g' | sed -e 's|//|/|g' | sed -e 's|:::|://|g'`"       
-
-  	if [ ! -z "$PCFETCHGUI" ] ; then
-	  echo "PKGDLCOUNT: `wc -l /tmp/.uList.$$ | awk '{print $1}'`"	
-	fi
-
-	# Start downloading the files
-	while read pLine
-	do
-	  oPkg="`echo $pLine | cut -d ' ' -f 1`"
-	  nPkg="`echo $pLine | cut -d ' ' -f 2`"
-
-	  # Get the new package
-	  fetch_file "${MIRRORDIR}/packages/$nPkg" "${STAGEDIR}/$nPkg" "1" "0"
-	  if [ $? -ne 0 ] ; then
-            rm -rf ${STAGEDIR} >/dev/null 2>/dev/null
-	    rm /tmp/.uList.$$
-            exit_err "Failed to download: ${MIRRORDIR}/packages/$nPkg"
-          fi
-
-	  # Grab the MD5 file
-	  fetch_file "${MIRRORDIR}/packages/${nPkg}.md5" "${STAGEDIR}/${nPkg}.md5" "1" "0"
-	  if [ $? -ne 0 ] ; then
-            rm -rf ${STAGEDIR} >/dev/null 2>/dev/null
-	    rm /tmp/.uList.$$
-            exit_err "Failed to download: ${MIRRORDIR}/packages/$nPkg"
-          fi
-	
-	  if [ `md5 -q ${STAGEDIR}/${nPkg}` != `cat ${STAGEDIR}/${nPkg}.md5` ]
-	  then
-            rm -rf ${STAGEDIR} >/dev/null 2>/dev/null
-	    rm /tmp/.uList.$$
-            exit_err "Invalid checksum for ${nPkg}. Please try again later."
-	  fi
-	done < /tmp/.uList.$$
-
-	# Now start updating the package list 
-  	if [ ! -z "$PCFETCHGUI" ] ; then
-	  echo "PKGUPCOUNT: `wc -l /tmp/.uList.$$ | awk '{print $1}'`"	
-	fi
-	while read pLine
-	do
-	  oPkg="`echo $pLine | cut -d ' ' -f 1`"
-	  nPkg="`echo $pLine | cut -d ' ' -f 2`"
-	  nPkgNoExt="`echo $nPkg | sed 's|.tbz||g'`"
-  	  if [ ! -z "$PCFETCHGUI" ] ; then
-	    echo "PKGUPDATE: $oPkg -> $nPkgNoExt"
-	  else
-	    echo "Updating $oPkg -> $nPkgNoExt"
-	  fi
-	
-	  pkg_delete -f ${oPkg} >/dev/null 2>/dev/null
-	  if [ $? -ne 0 ] ; then
-	    echo "WARNING: Failed to uninstall ${oPkg}"
-	  fi
-
-	  pkg_add -f "${STAGEDIR}/${nPkg}" >/dev/null 2>/dev/null
-	  if [ $? -ne 0 ] ; then
-	    echo "WARNING: Failed to install ${STAGEDIR}/${nPkg}"
-	  fi
-	done < /tmp/.uList.$$
-
-	# Clean up, all done
-  	if [ ! -z "$PCFETCHGUI" ] ; then echo "PKGUPDATEFINISHED" ; fi
-	rm -rf ${STAGEDIR}
-	rm /tmp/.uList.$$
-}
-
 generate_pkg_fetch_list() {
 	local STAGEDIR="$1"
 	hNV="NO"



More information about the Commits mailing list