PPM: download fix

Another PPM bug fixed.

PPM failed to download from one of the ibiblio.org mirror sites, reported unable to get size of file (ftp://ftp.lug.udel.edu).

The problem was in script /usr/sbin/download_file.

If you are using latest Quirky or Luci, grab this. File is here:

http://murga-linux.com/puppy/viewtopic.php?p=474244#474244


Posted on 6 Dec 2010, 8:23


Comments:

Posted on 6 Dec 2010, 13:51 by 01micko
download_file
Hmmm..
The discovery of your "lug bug" prompted me to test my code for downloading. It worked strangely enough but I am probably doing something totally ludicrous. I'm grepping for the permissions to look for the file, simply the "rw".
Relevant code snippet, warts and all:
THEPET=the generic pet name
GRAB_PET=the full name of the pet and extension
#integrity check

PET_SIZE=`grep -w "Content-Length" /tmp/docheck|awk '{print $2}'`
if [ "$PET_SIZE" = "" ];then #PET_SIZE=`grep -w -i $THEPET /tmp/docheck|grep -v Removed|grep -v exists|tail -n1|awk '{print $5}'` #ftp sites have changed header format! 20101118
PET_SIZE=`grep "rw" /tmp/docheck|grep "$GRABPET" |awk '{print $5}'`
fi

I just tested with
ftp://ftp.lug.udel.edu
http://ftp.cc.uoc.gr
http://distro.ibiblio.org
ftp://ftp.linux.hr
Cheers