Changeset 2944

Show
Ignore:
Timestamp:
10/30/08 06:49:28 (17 months ago)
Author:
kris
Message:

Updated the system-overlay backend for the new SystemUpdater? program. Removed old scripts / binares we no longer need, and added a config file

Location:
pcbsd
Files:
4 added
8 removed
2 modified

Legend:

Unmodified
Added
Removed
  • pcbsd/branches/7.0/system-overlay/PCBSD/SystemUpdater/bin/readSysUpdates.sh

    r1420 r2944  
    11#!/bin/bash 
     2# 
     3# Requires $1 to be set to PC-BSD Version, and $2 to be patch .tgz location 
     4############################################################################ 
     5 
     6# Check to make sure we have been given a version number 
     7if [ -z "${1}" ] 
     8then 
     9   exit 150 
     10fi 
    211 
    312# Set the program location 
     
    514 
    615# Get the system version we are checking for updates to 
    7 SYSVER="`pbreg get /PC-BSD/Version`" ; export SYSVER 
     16SYSVER="${1}" ; export SYSVER 
    817 
    918# Check if we have an update folder for the version we are on 
    10 if [ -d "${PROGDIR}/system-updates/available/${SYSVER}" ] 
     19if [ ! -d "${PROGDIR}/system-updates/available/${SYSVER}" ] 
    1120then 
    12  
    13  # Make the installed directory for this version 
    14  if [ ! -d "${PROGDIR}/system-updates/installed/${SYSVER}" ] 
    15  then 
    16    mkdir -p ${PROGDIR}/system-updates/installed/${SYSVER} 
    17  fi 
    18  
    19  # CD to the patch directory for this version 
    20  cd ${PROGDIR}/system-updates/available/${SYSVER} 
    21  
    22  # Setup our variable, we have no patches so far 
    23  PATCHFOUND="0"  
    24  
    25  # Remove the tmp update file 
    26  rm /tmp/.pcbsdavailupdates >/dev/null 2>/dev/null 
    27  
    28  # Now check which updates are available, and make a list of ones not installed  
    29  for i in `ls *.upd` 
    30  do 
    31     if [ ! -e "${PROGDIR}/system-updates/installed/${SYSVER}/${i}" ] 
    32     then 
    33        PATCHFOUND="`expr ${PATCHFOUND} + 1`"  
    34        echo "PATCH: ${SYSVER}/${i}" >> /tmp/.pcbsdavailupdates 
    35     fi 
    36  done  
    37  
    38  # Check if we found any new patches  
    39  if [ "${PATCHFOUND}" = "0" ] 
    40  then  
    41    # No available updates 
    42    exit 150 
    43  else 
    44    # We have updates! 
    45    exit 0 
    46  fi 
    47 else 
    48   # Exit with code 150, - No updates available 
    49   exit 150 
     21   mkdir -p ${PROGDIR}/system-updates/available/${SYSVER} 
    5022fi 
    5123 
     24# If we have new update-data file, extract it 
     25if [ ! -z "${2}" ] 
     26then 
     27    cd ${PROGDIR}/system-updates/available/${SYSVER} 
     28 
     29    # Remove old .upd data files 
     30    rm *.upd 
     31 
     32    # Extract the patch data  
     33    tar xvzf ${2} >/dev/null 2>/dev/null 
     34 
     35    # Remove patchset data, done with it for now 
     36    rm ${2} 
     37fi 
     38 
     39 
     40# Make the installed directory for this version 
     41if [ ! -d "${PROGDIR}/system-updates/installed/${SYSVER}" ] 
     42then 
     43  mkdir -p ${PROGDIR}/system-updates/installed/${SYSVER} 
     44fi 
     45 
     46# CD to the patch directory for this version 
     47cd ${PROGDIR}/system-updates/available/${SYSVER} 
     48 
     49# Setup our variable, we have no patches so far 
     50PATCHFOUND="0"  
     51 
     52# Remove the tmp update file 
     53rm /tmp/.pcbsdavailupdates >/dev/null 2>/dev/null 
     54 
     55# Now check which updates are available, and make a list of ones not installed  
     56for i in `ls *.upd` 
     57do 
     58   if [ ! -e "${PROGDIR}/system-updates/installed/${SYSVER}/${i}" ] 
     59   then 
     60      PATCHFOUND="`expr ${PATCHFOUND} + 1`"  
     61      echo "PATCH: ${SYSVER}/${i}" >> /tmp/.pcbsdavailupdates 
     62   fi 
     63done  
     64 
     65# Check if we found any new patches  
     66if [ "${PATCHFOUND}" = "0" ] 
     67then  
     68  # No available updates 
     69  exit 150 
     70else 
     71  # We have updates! 
     72  exit 0 
     73fi 
  • pcbsd/trunk/system-overlay/PCBSD/SystemUpdater/bin/readSysUpdates.sh

    r1420 r2944  
    11#!/bin/bash 
     2# 
     3# Requires $1 to be set to PC-BSD Version, and $2 to be patch .tgz location 
     4############################################################################ 
     5 
     6# Check to make sure we have been given a version number 
     7if [ -z "${1}" ] 
     8then 
     9   exit 150 
     10fi 
    211 
    312# Set the program location 
     
    514 
    615# Get the system version we are checking for updates to 
    7 SYSVER="`pbreg get /PC-BSD/Version`" ; export SYSVER 
     16SYSVER="${1}" ; export SYSVER 
    817 
    918# Check if we have an update folder for the version we are on 
    10 if [ -d "${PROGDIR}/system-updates/available/${SYSVER}" ] 
     19if [ ! -d "${PROGDIR}/system-updates/available/${SYSVER}" ] 
    1120then 
    12  
    13  # Make the installed directory for this version 
    14  if [ ! -d "${PROGDIR}/system-updates/installed/${SYSVER}" ] 
    15  then 
    16    mkdir -p ${PROGDIR}/system-updates/installed/${SYSVER} 
    17  fi 
    18  
    19  # CD to the patch directory for this version 
    20  cd ${PROGDIR}/system-updates/available/${SYSVER} 
    21  
    22  # Setup our variable, we have no patches so far 
    23  PATCHFOUND="0"  
    24  
    25  # Remove the tmp update file 
    26  rm /tmp/.pcbsdavailupdates >/dev/null 2>/dev/null 
    27  
    28  # Now check which updates are available, and make a list of ones not installed  
    29  for i in `ls *.upd` 
    30  do 
    31     if [ ! -e "${PROGDIR}/system-updates/installed/${SYSVER}/${i}" ] 
    32     then 
    33        PATCHFOUND="`expr ${PATCHFOUND} + 1`"  
    34        echo "PATCH: ${SYSVER}/${i}" >> /tmp/.pcbsdavailupdates 
    35     fi 
    36  done  
    37  
    38  # Check if we found any new patches  
    39  if [ "${PATCHFOUND}" = "0" ] 
    40  then  
    41    # No available updates 
    42    exit 150 
    43  else 
    44    # We have updates! 
    45    exit 0 
    46  fi 
    47 else 
    48   # Exit with code 150, - No updates available 
    49   exit 150 
     21   mkdir -p ${PROGDIR}/system-updates/available/${SYSVER} 
    5022fi 
    5123 
     24# If we have new update-data file, extract it 
     25if [ ! -z "${2}" ] 
     26then 
     27    cd ${PROGDIR}/system-updates/available/${SYSVER} 
     28 
     29    # Remove old .upd data files 
     30    rm *.upd 
     31 
     32    # Extract the patch data  
     33    tar xvzf ${2} >/dev/null 2>/dev/null 
     34 
     35    # Remove patchset data, done with it for now 
     36    rm ${2} 
     37fi 
     38 
     39 
     40# Make the installed directory for this version 
     41if [ ! -d "${PROGDIR}/system-updates/installed/${SYSVER}" ] 
     42then 
     43  mkdir -p ${PROGDIR}/system-updates/installed/${SYSVER} 
     44fi 
     45 
     46# CD to the patch directory for this version 
     47cd ${PROGDIR}/system-updates/available/${SYSVER} 
     48 
     49# Setup our variable, we have no patches so far 
     50PATCHFOUND="0"  
     51 
     52# Remove the tmp update file 
     53rm /tmp/.pcbsdavailupdates >/dev/null 2>/dev/null 
     54 
     55# Now check which updates are available, and make a list of ones not installed  
     56for i in `ls *.upd` 
     57do 
     58   if [ ! -e "${PROGDIR}/system-updates/installed/${SYSVER}/${i}" ] 
     59   then 
     60      PATCHFOUND="`expr ${PATCHFOUND} + 1`"  
     61      echo "PATCH: ${SYSVER}/${i}" >> /tmp/.pcbsdavailupdates 
     62   fi 
     63done  
     64 
     65# Check if we found any new patches  
     66if [ "${PATCHFOUND}" = "0" ] 
     67then  
     68  # No available updates 
     69  exit 150 
     70else 
     71  # We have updates! 
     72  exit 0 
     73fi