Changeset 6f2048f


Ignore:
Timestamp:
04/29/13 08:46:14 (15 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
a43929d
Parents:
ce5bcd0
Message:

Change how we do download parsing to use shell built-ins,
fixes an issue running aria2c in a chroot environment where "ps" may not be available

File:
1 edited

Legend:

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

    r2b9c5b7 r6f2048f  
    194194 
    195195   ( aria2c -o ${aFile} -d ${aDir} -k 5M ${aStat} --check-certificate=false --file-allocation=none ${mirrorList} >/dev/null 2>/dev/null ; echo "$?" > ${_eFile} ) & 
    196    FETCH_PID=`ps -auwwwx | grep -v grep | grep "aria2c -o ${aFile}" | awk '{print $2}'` 
     196   FETCH_PID=$! 
    197197   while :  
    198198   do 
     
    207207 
    208208      # Make sure download isn't finished 
    209       ps -p $FETCH_PID >/dev/null 2>/dev/null 
    210       if [ "$?" != "0" ] ; then break ; fi 
    211       sleep 2 
    212       _time=`expr $_time + 2` 
     209      jobs -l >/tmp/.jobProcess.$$ 
     210      cat /tmp/.jobProcess.$$ | awk '{print $3}' | grep -q ${FETCH_PID} 
     211      if [ "$?" != "0" ] ; then rm /tmp/.jobProcess.$$ ; break ; fi 
     212      sleep 1 
     213      _time=`expr $_time + 1` 
    213214   done 
    214215 
Note: See TracChangeset for help on using the changeset viewer.