wok-current rev 5753

get-opera: fix URL
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jul 02 23:42:13 2010 +0200 (2010-07-02)
parents 7cd9a13064cd
children d97529779044
files get-opera/stuff/get-opera
line diff
     1.1 --- a/get-opera/stuff/get-opera	Fri Jul 02 19:17:19 2010 +0200
     1.2 +++ b/get-opera/stuff/get-opera	Fri Jul 02 23:42:13 2010 +0200
     1.3 @@ -19,18 +19,21 @@
     1.4  CUR_DIR=$(pwd)
     1.5  mkdir -p $TMP_DIR && cd $TMP_DIR
     1.6  
     1.7 +get_releases()
     1.8 +{
     1.9 +	wget -O - "$URL?C=M;O=D" 2>/dev/null | awk '/folder/ { print $5 }' | \
    1.10 +	sed -e 's/href="\(.*\)">.*/\1/' -e 's|/||'
    1.11 +}
    1.12 +
    1.13  # Download rpm
    1.14 -set -- $(wget -O - $URL 2>/dev/null | grep -E 'href="[0-9]*/"' | tail -1 | sed 's|.*href="\(.*\)/".*|\1|')
    1.15 -for RELEASE in final beta4 beta3 beta2 beta1 ; do
    1.16 -  N=$2
    1.17 -  wget -s $URL$N/$RELEASE/en/i386/ 2> /dev/null && break 
    1.18 -  N=$1
    1.19 -  wget -s $URL$N/$RELEASE/en/i386/ 2> /dev/null && break 
    1.20 +for RELEASE in $(get_releases); do
    1.21 +  [ -n "$RELEASE" ] || continue
    1.22 +  FILE=$(wget -O - "$URL$RELEASE/" 2> /dev/null | grep i386.rpm | sed 's/.*href="\(.*\)">.*/\1/')
    1.23 +  [ -n "$FILE" ] || continue
    1.24 +  wget $URL$RELEASE/$FILE
    1.25 +  [ -s $FILE ] && break
    1.26  done
    1.27 -URL=$URL$N/$RELEASE/en/i386/
    1.28 -FILE=$(wget -O - $URL 2> /dev/null | grep "gcc4.qt4.i386.rpm" | sed 's|.*href="\(.*\)".*|\1|')
    1.29 -URL=$URL$FILE
    1.30 -wget $URL
    1.31 +
    1.32  if [ ! -f $FILE ]; then
    1.33  	cd $CUR_DIR
    1.34  	rm -rf $TMP_DIR