source: zero-lliurex-adobeair/trunk/fuentes/debian/postinst @ 4561

Last change on this file since 4561 was 4561, checked in by daduve, 3 years ago

Updating version Scarcth to 456.0.1

File size: 2.0 KB
Line 
1#!/bin/sh
2set -e
3
4UPDATED_FILE="/opt/AdobeAirApp/Scratch 2/share/META-INF/AIR/application.xml"
5LAST_ORIG_VERSION="456"
6LAST_LLIUREX_VERSION="903"
7
8if [ ! -f "$UPDATED_FILE" ]; then
9        exit 0
10fi
11
12ACTUAL_VERSION=$(grep "<versionNumber>" "$UPDATED_FILE" | cut -d ">" -f2 | cut -d "<" -f1);
13echo "Actual version is $ACTUAL_VERSION"
14
15## Tienes una version anterior la Original de la web, asi que actualizamos
16if [ "$ACTUAL_VERSION" -lt "$LAST_ORIG_VERSION" ]; then
17        #echo "Your version is obsolete, we are going to update it. wait please....."
18        #/usr/share/zero-center/zmds/zero-lliurex-adobeair-scratch2.zmd
19        #echo "Your Scratch 2 has been updated by LliureX, enjoy it"
20        echo ""
21        echo "-------------- SCRATCH IS OBSOLOTE-----------------"
22        echo "Your Scratch version is obsolete, please update it from Zero-Center, and press Scratch button again."
23        echo ""
24        zenity --info --title="Zero-installer-Scratch" --text="Your Scratch version is obsolete, please update it from Zero-Center, and press Scratch button again." > /dev/null 2>&1 &
25        #echo "Your Scratch 2 has been updated by LliureX, enjoy it"   
26        exit 0
27
28## Tienes la ultima version pero mal numerada, no coincide con el control de versiones de LLiureX
29elif [ "$ACTUAL_VERSION" = "$LAST_ORIG_VERSION" ]; then
30        echo "You have the latest Scratch version"
31        sed -i -e "s%<versionNumber>$LAST_ORIG_VERSION<\/versionNumber>%<versionNumber>$LAST_LLIUREX_VERSION<\/versionNumber>%g" "$UPDATED_FILE"
32        exit 0
33
34## Si llegamos aqui es que tienes una version superior a las de la web de SCRATCH pero anterior a la LAST_LLIUREX_VERSION por lo que hemos de actualizarte
35elif [ "$ACTUAL_VERSION" != "$LAST_LLIUREX_VERSION" ]; then
36        echo ""
37        echo "-------------- SCRATCH IS OBSOLOTE-----------------"
38        echo "Your Scratch version is obsolete, please update it from Zero-Center, and press Scratch button again."
39        echo ""
40        zenity --info --title="Zero-installer-Scratch" --text="Your Scratch version is obsolete, please update it from Zero-Center, and press Scratch button again." > /dev/null 2>&1 &
41        exit 0
42fi
43
44echo "Do nothing, you are updated"
45exit 0
46
Note: See TracBrowser for help on using the repository browser.