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

svn at pcbsd.org svn at pcbsd.org
Thu Jan 31 11:11:49 PST 2013


Author: kris
Date: 2013-01-31 19:11:49 +0000 (Thu, 31 Jan 2013)
New Revision: 21268

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

Add some more system updating framework, to do freebsd-update, and then force
a pkg upgrade -f, so if we jump from FreeBSD versions to a new one
which is ABI incompatiable, we will get new packages which are correct. 

Also use pkg-static, since we cannot assume that even the pkg-command will be
immune. 



Modified: pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager
===================================================================
--- pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager	2013-01-31 19:11:13 UTC (rev 21267)
+++ pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager	2013-01-31 19:11:49 UTC (rev 21268)
@@ -22,11 +22,8 @@
 DOWNLOADDIR="/usr/local/tmp"
 
 # Get the system version we are checking for updates to
-SYSVER="`pbreg get /PC-BSD/Version`" ; export SYSVER
+SYSVER="`uname -r`" ; export SYSVER
 
-# Get the made date for this system
-SYSMDATE="`pbreg get /PC-BSD/mdate`" ; export SYSMDATE
-
 # Get the system type
 SYSTYPE="`pbreg get /PC-BSD/SysType`" ; export SYSTYPE
 
@@ -373,6 +370,29 @@
      exit_err "Failed running \"freebsd-update install\"..."
   fi
 
+  # Now re-extract overlay files to ensure we do file fixing / massaging 
+  if [ "$SYSTYPE" = "PCBSD" ]; then 
+    pc-extractoverlay desktop
+  fi
+  if [ "$SYSTYPE" = "TRUEOS" ]; then 
+    pc-extractoverlay server
+  fi
+
+  # Set the new pkg.conf file to the new repo
+  local arch=`uname -m`
+  echo "packagesite: http://getmirror.pcbsd.org/packages/$ARCH/$rel" >/usr/local/etc/pkg.conf
+  echo "HTTP_MIRROR: http" >>/usr/local/etc/pkg.conf
+
+  # Now its time to force a pkg-update of all packages to their new FreeBSD compiled versions
+  pc-updatemanager pkgupdate -f
+
+  # Now re-extract overlay files again to grab any new changes from a port we just updated
+  if [ "$SYSTYPE" = "PCBSD" ]; then 
+    pc-extractoverlay desktop
+  fi
+  if [ "$SYSTYPE" = "TRUEOS" ]; then 
+    pc-extractoverlay server
+  fi
 }
 
 do_install() {
@@ -419,8 +439,8 @@
 checkup_pkgs() {
 
   # Checkout the installed pkgs and compare to master list
-  rc_halt "pkg update"
-  pkg upgrade -n >/tmp/.pkgData.$$
+  rc_halt "pkg-static update"
+  pkg-static upgrade -n >/tmp/.pkgData.$$
   grep -q "Upgrading" /tmp/.pkgData.$$
   if [ $? -ne 0 ] ; then
      echo "All packages are up to date!"
@@ -438,6 +458,10 @@
 
 update_pkgs()
 {
+  if [ -n "$1" -a "$1" != "-f" ] ; then
+     exit_err "Invalid option $1 passed"
+  fi
+
   # Running from a GUI?
   if [ -n "$PCFETCHGUI" ] ; then
     # Setup EVENT_PIPE
@@ -450,11 +474,11 @@
     sleep 5
 
     # Tickle pkg update first
-    pkg update
+    pkg-static update
   fi
 
   # Start the package update!
-  pkg upgrade -y
+  pkg-static upgrade -y ${1}
   result=$?
 
   # Lets now re-extract our overlay data to grab any adjusted port files
@@ -489,7 +513,7 @@
  		  get_update_file
                   do_check ;;
 	pkgcheck) checkup_pkgs ;;
-       pkgupdate) update_pkgs ;;
+       pkgupdate) update_pkgs "$2" ;;
  	 install) get_mirror
                   MIRRORURL="$VAL"
  		  get_update_file



More information about the Commits mailing list