Changeset d43d5be


Ignore:
Timestamp:
07/29/13 10:53:54 (20 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
a0dfd2d
Parents:
0f79dd90
Message:

Fix a bug fetching 8.x releases of FreeBSD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/warden/scripts/backend/createtemplate.sh

    r9788f38 rd43d5be  
    3030  else 
    3131      
    32      # Check if we are on REAL old versions of FreeBSD 
    33      if [ "$oldFBSD" = "YES" ] ; then 
    34          # Get the .inf list file 
    35          fetch -o "${JDIR}/.download/${oldStr}.inf" "http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/${FBSDARCH}/${FBSDVER}/${oldStr}/${oldStr}.inf" 
    36          if [ $? -ne 0 ] ; then 
    37            exit_err "Failed downloading: FreeBSD ${FBSDVER} - ${oldStr}.inf" 
    38          fi 
    39          # Now read in the list of files to fetch 
    40          while read line 
    41          do 
    42             echo "$line" | grep -q '^cksum' 
    43             if [ $? -ne 0 ] ; then continue ; fi 
    44             fName=`echo $line | cut -d " " -f 1 | sed "s|cksum|$oldStr|g"` 
    45             fetch -o "${JDIR}/.download/$fName" "http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/${FBSDARCH}/${FBSDVER}/${oldStr}/$fName" 
    46             if [ $? -ne 0 ] ; then 
    47               exit_err "Failed downloading: FreeBSD ${FBSDVER} - $fName" 
    48             fi 
    49          done < ${JDIR}/.download/${oldStr}.inf 
    50          return 
    51      fi 
    52  
     32     # Start looking for current versions of FreeBSD 
     33     found=0 
    5334     for f in $DFILES 
    5435     do 
     
    5738         echo "Trying ftp-archive..." 
    5839         fetch -o "${JDIR}/.download/$f" "http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/${FBSDARCH}/${FBSDVER}/$f" 
    59          if [ $? -ne 0 ] ; then 
    60            exit_err "Failed downloading: FreeBSD ${FBSDVER}" 
    61          fi 
     40         if [ $? -ne 0 ] ; then found=1 ; break; fi 
    6241       fi 
    6342     done 
     43 
     44     if [ $found -eq 0 ] ; then return ; fi 
     45 
     46     found=0 
     47     # Check if we are on old versions of FreeBSD 
     48     # Get the .inf list file 
     49     echo "Looking for old versions of FreeBSD" 
     50     fetch -o "${JDIR}/.download/${oldStr}.inf" "ftp://ftp.freebsd.org/pub/FreeBSD/releases/${FBSDARCH}/${FBSDVER}/$oldStr/${oldStr}.inf" 
     51     if [ $? -ne 0 ] ; then 
     52       # Check the ftp-archive 
     53       echo "Looking for older versions of FreeBSD" 
     54       fetch -o "${JDIR}/.download/${oldStr}.inf" "http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/${FBSDARCH}/${FBSDVER}/${oldStr}/${oldStr}.inf" 
     55       if [ $? -ne 0 ] ; then 
     56         exit_err "Failed downloading: FreeBSD ${FBSDVER} - ${oldStr}.inf" 
     57       fi 
     58       fDir="http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/${FBSDARCH}/${FBSDVER}/${oldStr}" 
     59     else 
     60       fDir="ftp://ftp.freebsd.org/pub/FreeBSD/releases/${FBSDARCH}/${FBSDVER}/$oldStr" 
     61     fi 
     62 
     63     # Now read in the list of files to fetch 
     64     while read line 
     65     do 
     66        echo "$line" | grep -q '^cksum' 
     67        if [ $? -ne 0 ] ; then continue ; fi 
     68        fName=`echo $line | cut -d " " -f 1 | sed "s|cksum|$oldStr|g"` 
     69        fetch -o "${JDIR}/.download/$fName" "${fDir}/${fName}" 
     70        if [ $? -ne 0 ] ; then 
     71          exit_err "Failed downloading: FreeBSD ${FBSDVER}" 
     72        fi 
     73     done < ${JDIR}/.download/${oldStr}.inf 
    6474  fi 
    6575 
Note: See TracChangeset for help on using the changeset viewer.