wok-current rev 6699

get-OpenOffice3: get any localization
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 13 16:01:25 2010 +0200 (2010-10-13)
parents c0a5719491d2
children da4c85428dc0
files get-OpenOffice3/stuff/get-OpenOffice3
line diff
     1.1 --- a/get-OpenOffice3/stuff/get-OpenOffice3	Wed Oct 13 13:55:08 2010 +0100
     1.2 +++ b/get-OpenOffice3/stuff/get-OpenOffice3	Wed Oct 13 16:01:25 2010 +0200
     1.3 @@ -8,16 +8,12 @@
     1.4  PACKAGE="OpenOffice3"
     1.5  URL="http://www.openoffice.org"
     1.6  ROOT="$1"
     1.7 +PATTERN="Linux_x86_install-rpm"
     1.8  
     1.9 -case "$LANG" in
    1.10 -fr_*|de_*|es_*|it_*|ru_*)
    1.11 -	LOC=${LANG%_*}
    1.12 -	DIR="localized/$LOC"
    1.13 -	SUFFIX="Linux_x86_install-rpm_$LOC.tar.gz";;
    1.14 -*)
    1.15 -	DIR="stable"
    1.16 -	SUFFIX="Linux_x86_install-rpm_en-US.tar.gz";;
    1.17 -esac
    1.18 +DIR="stable"
    1.19 +LOC=$(wget -O - http://openofficeorg.secsup.org/localized/ 2> /dev/null 
    1.20 +| grep -E ">$LANG/|>${LANG%_*}/" | tail -1 | sed 's/.*href=\"\(.*\)\/\".*/\1/')
    1.21 +[ -n "$LOC" ] && DIR="localized/$LANG"
    1.22  
    1.23  VERSION="$(basename $(wget -O - http://openofficeorg.secsup.org/$DIR/ \
    1.24  	2> /dev/null | grep href=\"[0-9] | tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/'))"
    1.25 @@ -25,7 +21,10 @@
    1.26  	echo "Can't find VERSION. Abort."
    1.27  	exit 0
    1.28  fi
    1.29 -TARBALL="OOo_${VERSION}_${SUFFIX}"
    1.30 +echo "Selecting $DIR version $VERSION ..."
    1.31 +TARBALL="$(wget -O - http://openofficeorg.secsup.org/$DIR/$VERSION/ \
    1.32 +	2> /dev/null | grep $PATTERN | tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/')"
    1.33 +echo "Archive is $TARBALL ..."
    1.34  WGET_URL=ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/$DIR/$VERSION/$TARBALL
    1.35  
    1.36  TEMP_DIR="/tmp/$PACKAGE.$$"