Ignore:
Timestamp:
10/12/13 16:17:04 (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, releng/10.1
Children:
0a15f21
Parents:
909e1d3
Message:

Remove dep on aria2c, since its broken in 10 right now

File:
1 edited

Legend:

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

    r3b0aba7 r7d497d1  
    119119 
    120120# Function which returns the installed list of PC-BSD mirrors for use 
    121 # with the aria2c command 
     121# with the fetch command 
    122122# Will return just a single mirror, if the user has manually specified one 
    123123# in /usr/local/etc/pcbsd.conf 
    124 get_aria_mirror_list() 
     124get_mirror_loc() 
    125125{ 
    126126  if [ -z $1 ] ; then 
     
    161161  while read line 
    162162  do 
    163     VAL="$VAL ${line}${1}" 
     163    VAL="${line}${1}" 
     164    break 
    164165  done < ${mirrorFile} 
    165166  echo ${VAL} 
     
    183184   . /etc/profile 
    184185 
    185    # Split up the dir / file name 
    186    local aDir=`dirname $_lf` 
    187    local aFile=`basename $_lf` 
    188  
    189    # Server status flag 
    190    if [ `id -u` = "0" ] ; then 
    191       aStatFile=/root/.pcbsd-aria-stat 
    192    else 
    193       aStatFile=${HOME}/.pcbsd-aria-stat 
    194    fi 
    195  
    196    if [ -e "$aStatFile" ] ; then 
    197      local aStat="--server-stat-of=$aStatFile --server-stat-if=$aStatFile --uri-selector=adaptive --server-stat-timeout=864000" 
    198    else 
    199      local aStat="--server-stat-of=$aStatFile --uri-selector=adaptive" 
    200    fi 
    201    touch $aStatFile 
    202  
    203186   # Get mirror list 
    204    local mirrorList="$(get_aria_mirror_list ${_rf} ${_mtype})" 
    205     
     187   local mirrorLoc="$(get_mirror_loc ${_rf} ${_mtype})" 
     188   mirrorLoc="`echo $mirrorLoc | awk '{print $1}'`" 
     189 
    206190   # Running from a non GUI? 
    207191   if [ "$GUI_FETCH_PARSING" != "YES" -a "$PBI_FETCH_PARSING" != "YES" -a -z "$PCFETCHGUI" ] ; then 
    208       aria2c ${aStat} --check-certificate=false --file-allocation=none -d "${aDir}" -o "${aFile}" ${mirrorList} 
     192      fetch -o "${_lf}" ${mirrorLoc} 
    209193      return $? 
    210194   fi 
     
    214198   # Doing a front-end download, parse the output of fetch 
    215199   _eFile="/tmp/.fetch-exit.$$" 
    216    fetch -s "`echo ${mirrorList} | awk '{print $1}'`" > /tmp/.fetch-size.$$ 2>/dev/null 
     200   fetch -s ${mirrorLoc} > /tmp/.fetch-size.$$ 2>/dev/null 
    217201   _fSize=`cat /tmp/.fetch-size.$$ 2>/dev/null` 
    218202   _fSize="`expr ${_fSize} / 1024 2>/dev/null`" 
     
    221205   if [ -z "$_fSize" ] ; then _fSize=0; fi 
    222206 
    223    ( aria2c -o ${aFile} -d ${aDir} ${aStat} --check-certificate=false --file-allocation=none ${mirrorList} >/dev/null 2>/dev/null ; echo "$?" > ${_eFile} ) & 
     207   ( fetch -o ${_lf} ${mirrorLoc} >/dev/null 2>/dev/null ; echo "$?" > ${_eFile} ) & 
    224208   FETCH_PID=$! 
    225209   while :  
Note: See TracChangeset for help on using the changeset viewer.