Changeset 9788f38


Ignore:
Timestamp:
06/28/13 13:42:12 (16 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
Children:
2c1e079
Parents:
2c8cdfc
Message:

Switch us over to the new PC-BSD CDN

Location:
src-sh
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src-sh/libsh/functions.sh

    r2bba3b7 r9788f38  
    4747 
    4848  # Where are the packages on our mirrors? 
    49   pkgUrl="/packages/${PKGREL}/${ARCH}" 
     49  pkgUrl="/${PKGREL}/${ARCH}" 
    5050 
    5151  if [ ! -d "$PKG_CACHEDIR/All" ] ; then 
     
    6666        rm ${PKG_CACHEDIR}/All/${i} ;  
    6767    fi 
    68     get_file_from_mirrors "${pkgUrl}/All/${i}" "${PKG_CACHEDIR}/All/${i}" 
     68    get_file_from_mirrors "${pkgUrl}/All/${i}" "${PKG_CACHEDIR}/All/${i}" "pkg" 
    6969    if [ $? -ne 0 ] ; then 
    7070      echo "Failed downloading: /${pkgUrl}/All/${i}" 
     
    126126     exit_err "Need to supply file to grab from mirrors..." 
    127127  fi 
     128  if [ -z $2 ] ; then 
     129     exit_err "Need to supply which mirror to fetch from..." 
     130  fi 
     131 
     132  case $2 in 
     133    pkg) mirrorTag="PKG_MIRROR"  
     134         mirrorFile="/usr/local/share/pcbsd/conf/pkg-mirror" 
     135         ;; 
     136    pbi) mirrorTag="PBI_MIRROR"  
     137         mirrorFile="/usr/local/share/pcbsd/conf/pbi-mirror" 
     138         ;; 
     139    iso) mirrorTag="ISO_MIRROR"  
     140         mirrorFile="/usr/local/share/pcbsd/conf/iso-mirror" 
     141         ;; 
     142  update) mirrorTag="UPDATE_MIRROR"  
     143         mirrorFile="/usr/local/share/pcbsd/conf/update-mirror" 
     144         ;; 
     145    *) exit_err "Bad mirror type!" ;; 
     146  esac 
    128147 
    129148  # Set the mirror URL 
    130   local VAL="`cat ${PCBSD_ETCCONF} 2>/dev/null | grep 'PCBSD_MIRROR: ' | sed 's|PCBSD_MIRROR: ||g'`" 
     149  local VAL=`cat ${PCBSD_ETCCONF} 2>/dev/null | grep "^${mirrorTag}:" | sed "s|^${mirrorTag}: ||g"` 
    131150  if [ -n "$VAL" ] ; then 
    132151     echo "${VAL}${1}" 
     
    134153  fi 
    135154 
    136   if [ ! -e "/usr/local/share/pcbsd/conf/pcbsd-mirrors" ] ; then 
    137      exit_err "Missing mirror list: /usr/local/share/pcbsd/conf/pcbsd-mirrors" 
     155  if [ ! -e "${mirrorFile}" ] ; then 
     156     exit_err "Missing mirror list: ${mirrorFile}" 
    138157  fi 
    139158 
     
    142161  do 
    143162    VAL="$VAL ${line}${1}" 
    144   done < /usr/local/share/pcbsd/conf/pcbsd-mirrors 
     163  done < ${mirrorFile} 
    145164  echo ${VAL} 
    146165} 
     
    153172   _rf="${1}" 
    154173   _lf="${2}" 
     174   _mtype="${3}" 
     175 
     176   case $_mtype in 
     177      iso|pbi|pkg|update) ;; 
     178      *) exit_err "Fixme! Missing mirror type in get_file_from_mirrors" ;; 
     179   esac 
    155180 
    156181   # Get any proxy information 
     
    176201 
    177202   # Get mirror list 
    178    local mirrorList="$(get_aria_mirror_list $1)" 
     203   local mirrorList="$(get_aria_mirror_list ${_rf} ${_mtype})" 
    179204    
    180205   # Running from a non GUI? 
  • src-sh/pbi-manager/pbi-manager

    r1421110 r9788f38  
    55025502        for _cMirror in $_mirrorList 
    55035503        do 
    5504                 if [ "$_cMirror" = "PCBSDCDN" ] ; then 
    5505                         get_file_from_mirrors "${_uFile}" "$_dl_loc" 
     5504                if [ "$_cMirror" = "PCBSDCDN" -o "$_cMirror" = "http://pbi.cdn.pcbsd.org" ] ; then 
     5505 
     5506                        # Strip the /PBI from the mirror URL 
     5507                        _uFile="`echo ${_uFile} | sed 's|^/PBI||g'`" 
     5508                         
     5509                        get_file_from_mirrors "${_uFile}" "$_dl_loc" "pbi" 
    55065510                        if [ "$?" != "0" ]  ; then  
    55075511                                rm "${_dl_loc}" >/dev/null 2>/dev/null 
     
    69496953          do 
    69506954            echo "Downloading /${SYSVER}/${ARCH}/dist/${i} ..." 
    6951             get_file_from_mirrors "/${SYSVER}/${ARCH}/dist/${i}" "${i}" 
     6955            get_file_from_mirrors "/${SYSVER}/${ARCH}/dist/${i}" "${i}" "iso" 
    69526956            [ $? -ne 0 ] && exit_err "Error while downloading the freebsd world." 
    69536957          done 
  • src-sh/pc-metapkgmanager/pc-metapkgmanager

    r48831cd r9788f38  
    336336      dlPath="$2" 
    337337   fi 
    338    get_file_from_mirrors "$dlPath" "$dlOut" 
     338   get_file_from_mirrors "$dlPath" "$dlOut" "iso" 
    339339   exit $? 
    340340} 
  • src-sh/pc-thinclient/pc-thinclient

    r26bde3c r9788f38  
    270270    echo "Downloading ${MIRRORURL}/${SYSVER}/${ARCH}/dist/${i} ..." 
    271271     
    272     get_file_from_mirrors "/${SYSVER}/${ARCH}/dist/${i}" "$i" 
     272    get_file_from_mirrors "/${SYSVER}/${ARCH}/dist/${i}" "$i" "iso" 
    273273    [ $? -ne 0 ] && exit_err "Error while downloading the freebsd world." 
    274274  done 
  • src-sh/warden/scripts/backend/createjail.sh

    r084c528 r9788f38  
    246246  cd ${JAILDIR} 
    247247  SYSVER="$(uname -r | cut -d '-' -f 1-2)" 
    248   get_file_from_mirrors "/${SYSVER}/${ARCH}/dist/src.txz" "src.txz" 
     248  get_file_from_mirrors "/${SYSVER}/${ARCH}/dist/src.txz" "src.txz" "iso" 
    249249  if [ $? -ne 0 ] ; then 
    250250    echo "Error while downloading the freebsd world." 
  • src-sh/warden/scripts/backend/createtemplate.sh

    r9cc2f9c r9788f38  
    2323     for f in $DFILES 
    2424     do 
    25        get_file_from_mirrors "/${TRUEOSVER}/${FBSDARCH}/dist/$f" "${JDIR}/.download/$f" 
     25       get_file_from_mirrors "/${TRUEOSVER}/${FBSDARCH}/dist/$f" "${JDIR}/.download/$f" "iso" 
    2626       if [ $? -ne 0 ] ; then 
    2727         exit_err "Failed downloading: /${TRUEOS}/${FBSDARCH}/dist/${f}" 
  • src-sh/warden/scripts/backend/functions.sh

    rf70de07 r9788f38  
    823823 
    824824  if [ -e "pkg.txz" ] ; then rm pkg.txz ; fi 
    825   get_file_from_mirrors "/packages/${release}/${arch}/Latest/pkg.txz" "pkg.txz" 
     825  get_file_from_mirrors "/${release}/${arch}/Latest/pkg.txz" "pkg.txz" "pkg" 
    826826  if [ $? -eq 0 ] ; then 
    827827    chroot ${jaildir} /bootstrap-pkgng 
Note: See TracChangeset for help on using the changeset viewer.