LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File update.sh of Package flash-player (Project openSUSE:Factory:NonFree)

# vim: sw=4 et

t=$(mktemp  -d XXXXXXX)

set -e

pushd $t &>/dev/null

    tar xf ../install_flash_player_11*_linux.i386.tar.bz2 libflashplayer.so
    md5sum libflashplayer.so > ORIG_FLASH
    rm -f libflashplayer.so
    # fetch the current download url
    download_url=$(curl -s 'http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_11.2_for_other_Linux_(.tar.gz)_32-bit' | egrep  -o 'http:\/\/fpdownload.macromedia.com\/get\/flashplayer\/pdc\/11.*\/install_flash_player_11_linux.i386.tar.gz')
    echo "Trying download $download_url";
    wget $download_url
    tar xf install_flash_player_11_linux.i386.tar.gz libflashplayer.so
    md5sum libflashplayer.so > NEW_FLASH

    if cmp -s ORIG_FLASH NEW_FLASH; then

        echo "no new update available"

        echo "*** NEW flashplugin UPDATE AVAILABLE!"
        version=$(strings  libflashplayer.so | grep "LNX 11," |cut -d' ' -f2 | sed -e 's#,#.#g')
        echo "new version is $version"
        download_url=$(echo $download_url | sed -e 's,i386,ARCH,')

        for arch in i386 x86_64; do
            wget -q $(echo $download_url | sed -e "s,ARCH,$arch,")
            mv install_flash_player_11_linux.$arch.tar.gz install_flash_player_${version}_linux.$arch.tar.gz
            bznew install_flash_player_${version}_linux.$arch.tar.gz
            mv install_flash_player_${version}_linux.$arch.tar.bz2 ..
        sed -i -e "s,Version:.*,Version:        $version," ../flash-player.spec
        ( cd ..; 
        osc vc -m "Update to $version: (bnc#XXXXXX)"

    for arch in i386; do
        tar xf ../flashplayer_*_sa.$arch.tar.bz2 install_flash_player_linux_sa/flashplayer
        md5sum install_flash_player_linux_sa/flashplayer > ORIG_FLASH
        rm -rf install_flash_player_linux_sa
        wget http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa.$arch.tar.gz
        tar xvf flashplayer_11_sa.$arch.tar.gz
        md5sum install_flash_player_linux_sa/flashplayer > NEW_FLASH

        if cmp -s ORIG_FLASH NEW_FLASH; then

            echo "no new update available"

            echo "*** NEW flashplayer UPDATE AVAILABLE!"
            version=$(strings install_flash_player_linux_sa/flashplayer | grep "LNX 11," |cut -d' ' -f2 | sed -e 's#,#.#g')
            echo "new version is $version"
            mv flashplayer_11_sa.$arch.tar.gz flashplayer_${version}_sa.$arch.tar.gz
            bznew flashplayer_${version}_sa.$arch.tar.gz
            mv flashplayer_${version}_sa.$arch.tar.bz2 ..

popd &>/dev/null
rm -rf $t