wok-stable rev 11350
Update get-flash-plugin
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Nov 29 13:36:45 2011 +0100 (2011-11-29) |
parents | c994a5c94f9d |
children | 05ee700100bf |
files | get-flash-plugin/stuff/get-flash-plugin |
line diff
1.1 --- a/get-flash-plugin/stuff/get-flash-plugin Tue Nov 29 01:25:59 2011 +0100 1.2 +++ b/get-flash-plugin/stuff/get-flash-plugin Tue Nov 29 13:36:45 2011 +0100 1.3 @@ -1,9 +1,10 @@ 1.4 #!/bin/sh -e 1.5 -: ${DIALOG=tazdialog} 1.6 1.7 -. /etc/slitaz/slitaz.conf 1.8 - 1.9 +PACKAGE="flash-plugin" 1.10 +WEB_SITE="http://www.adobe.com/products/flash/" 1.11 +SHORT_DESC="Adobe Flash Player." 1.12 ROOT="$1" 1.13 +[ -d "$ROOT" ] || ROOT="" 1.14 1.15 if test $(id -u) != 0 ; then 1.16 echo -e "\nYou must be root to run `basename $0`." 1.17 @@ -11,56 +12,37 @@ 1.18 exit 0 1.19 fi 1.20 1.21 -PACKAGE="flash-plugin" 1.22 if [ -d ${ROOT}${INSTALLED}/$PACKAGE ]; then 1.23 [ -n "$ROOT" ] && exit 1 1.24 tazpkg remove $PACKAGE 1.25 [ -d $INSTALLED/$PACKAGE ] && exit 1 1.26 fi 1.27 -WEB_SITE="http://www.adobe.com/products/flash/" 1.28 -URL="http://fpdownload.macromedia.com/get/flashplayer/current/" 1.29 1.30 -# Download tarball 1.31 -VERSIONS=""; i=9; while true; do 1.32 - if busybox wget -s ${URL}install_flash_player_${i}_linux.tar.gz 2> /dev/null; then 1.33 - VERSIONS="$VERSIONS $i" 1.34 - [ -n "$ROOT" ] && break 1.35 - elif [ -n "$VERSIONS" ]; then 1.36 - break 1.37 - elif [ $i -gt 20 ]; then 1.38 - exit 1 1.39 - fi 1.40 - i=$(($i + 1)) 1.41 +URL= 1.42 +for i in $(seq 11 99); do 1.43 + n="$(busybox wget -O - "http://get.adobe.com/fr/flashplayer/completion/?installer=Flash_Player_${i}_for_other_Linux_(.tar.gz)_32-bit" | \ 1.44 + sed "/gz/!d;s/.* '//;s/'.*//")" 1.45 + [ -n "$n" ] && URL="$n" && continue 1.46 + break 1.47 done 1.48 1.49 -value="$(echo $VERSIONS)" 1.50 -case "$VERSIONS" in 1.51 -*[0-9]\ [1-9]*) 1.52 - exec 3>&1 1.53 - value=`$DIALOG --clear --colors --title " Install Flash plugin " \ 1.54 - --menu "Which version to install" 16 70 5 \ 1.55 - $(for i in $VERSIONS; do echo $i; echo "flash-$i"; done) \ 1.56 - 2>&1 1>&3` 1.57 - retval=$? 1.58 - exec 3>&- 1.59 - [ -n "$value" ] || exit 0 1.60 - [ "$retval" = "1" ] && exit 0 1.61 -esac 1.62 -DIR=install_flash_player_${value}_linux 1.63 -TARBALL=$DIR.tar.gz 1.64 -[ -f $TARBALL ] || wget $URL$TARBALL 1.65 +if [ -z "$URL" ]; then 1.66 + echo "Could not find url. Exiting." 1.67 + exit 1 1.68 +fi 1.69 + 1.70 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM 1.71 +CUR_DIR=$(pwd) 1.72 +mkdir -p $TMP_DIR && cd $TMP_DIR 1.73 +TARBALL="$(basename $URL)" 1.74 +busybox wget -O $TARBALL $URL 1.75 if [ ! -f $TARBALL ]; then 1.76 echo "Could not download $TARBALL. Exiting." 1.77 exit 1 1.78 fi 1.79 1.80 +tar xzf $TARBALL 1.81 1.82 -# Extract 1.83 -mkdir $DIR 1.84 -cd $DIR 1.85 -tar xzf ../$TARBALL 1.86 - 1.87 -[ -d $DIR ] && mv $DIR/* . 1.88 VERSION="$(strings libflashplayer.so | grep ^LNX | sed -e 's/LNX //' -e 's/,/./g')" 1.89 1.90 # Install files 1.91 @@ -82,7 +64,7 @@ 1.92 PACKAGE="$PACKAGE" 1.93 VERSION="$VERSION" 1.94 CATEGORY="non-free" 1.95 -SHORT_DESC="Adobe Flash Player." 1.96 +SHORT_DESC="$SHORT_DESC" 1.97 WEB_SITE="$WEB_SITE" 1.98 DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \ 1.99 pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \ 1.100 @@ -116,8 +98,10 @@ 1.101 1.102 # Install pseudo package 1.103 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 1.104 -cd .. 1.105 +case " $@ " in 1.106 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; 1.107 +esac 1.108 1.109 # Clean 1.110 -rm -rf $DIR $TARBALL 1.111 - 1.112 +cd $CUR_DIR 1.113 +rm -rf $TMP_DIR