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

svn at pcbsd.org svn at pcbsd.org
Mon Jan 28 10:20:28 PST 2013


Author: kris
Date: 2013-01-28 18:20:28 +0000 (Mon, 28 Jan 2013)
New Revision: 21218

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

Add way to determine if patches are for PCBSD/TRUEOS or both



Modified: pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager
===================================================================
--- pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager	2013-01-28 17:00:53 UTC (rev 21217)
+++ pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager	2013-01-28 18:20:28 UTC (rev 21218)
@@ -27,6 +27,9 @@
 # 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
+
 # Set the config location
 UPDATECONF="${PROGDIR}/conf/sysupdate.conf"
 
@@ -236,13 +239,18 @@
    # Check if this is an update we can install
    local saVer=`echo $line | cut -d ':' -f 2`
    local saArch=`echo $line | cut -d ':' -f 3`
-   local saPlat=`echo $line | cut -d ':' -f 4`
+   local saType=`echo $line | cut -d ':' -f 4`
    local saIdent="`echo $line | cut -d ':' -f 5`"
 
    # For this version?
    if [ "$SYSVER" != "$saVer" ] ; then return ; fi
+
    # For this system arch?
    if [ "$ARCH" != "$saArch" -a "$saArch" != "noarch" ] ; then return ; fi
+
+   # For this system type?
+   if [ "$SYSTYPE" != "$saType" -a "$saType" != "both" ] ; then return ; fi
+
    # Already installed?
    if [ -e "${INSDIR}/${SYSVER}/$saIdent" ] ; then return ; fi
 
@@ -289,17 +297,24 @@
     if [ "$saIdent" != "$up" ] ; then continue ; fi
     saVer=`echo $line | cut -d ':' -f 2`
     saArch=`echo $line | cut -d ':' -f 3`
-    saPlat=`echo $line | cut -d ':' -f 4`
+    saType=`echo $line | cut -d ':' -f 4`
     # Does this update apply to this system arch?
     if [ "$saArch" != "$ARCH" -a "$saArch" != "noarch" ] ; then 
        rm ${PATCHTMPFILE}
        exit_err "Patch $up is not for this system arch type!"
     fi
+    # For this version?
     if [ "$saVer" != "$SYSVER" ] ; then 
        rm ${PATCHTMPFILE}
        exit_err "Patch $up is not for this system version!"
     fi
 
+    # For this system type?
+    if [ "$SYSTYPE" != "$saType" -a "$saType" != "both" ] ; then
+       rm ${PATCHTMPFILE}
+       exit_err "Patch $up is not for this system type!"
+    fi
+
     # Got here? We have a patch ready to go
     patchLine="$line"
     break



More information about the Commits mailing list