Ignore:
Timestamp:
06/28/13 13:42:12 (15 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

File:
1 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? 
Note: See TracChangeset for help on using the changeset viewer.