source: lliurex-up/trunk/fuentes/lliurex-up-core/usr/share/lliurex-up/commonScripts/previous-upgrade @ 2993

Last change on this file since 2993 was 2993, checked in by kbut, 3 years ago

add lliurex-up-core folder

File size: 1.3 KB
Line 
1#!/bin/sh
2# The last upgrade before the change
3
4# gettext domain
5TEXTDOMAIN="lliurex-up"
6export TEXTDOMAIN
7
8COMMON_LIBRARY="/usr/share/lliurex-up/common-upgrade-vars.sh"
9if [  -r $COMMON_LIBRARY  ] ; then 
10        . $COMMON_LIBRARY
11fi
12
13#gettext messages
14INFO_MESSAGE="$(gettext "Update software cache")"
15UPDATE_CACHE_MESSAGE="$(gettext "Update software cache")"
16UPGRADE_PACKAGES_MESSAGE="$(gettext "Upgrade installed packages")"
17UPGRADE_PACKAGES_END_MESSAGE="$(gettext "Upgrade complete")"
18
19# Methods
20_info()
21{
22        echo "$INFO_MESSAGE"
23}
24
25_migrate()
26{
27        # Update cache
28        echo "$UPDATE_CACHE_MESSAGE"
29        apt-get update
30       
31        # Upgrade packages
32        echo "$UPGRADE_PACKAGES_MESSAGE"
33        apt-get -f install  -y --force-yes
34        # Upgrade package completion
35        echo "$UPGRADE_PACKAGES_END_MESSAGE"
36       
37}
38
39get_details()
40{
41        apt-get update 2>&1 >/dev/null
42        # Create file to log in it.
43        INSTALL_TMP_FILE="$(mktemp /tmp/lliurex-up-working-area.log-to-parse.XXXX)"
44        LANG=C apt-get dist-upgrade -sV >> "$INSTALL_TMP_FILE" 
45        lliurex-upgrade-parser "$INSTALL_TMP_FILE"
46}
47
48_usage()
49{
50        echo " * [ LliureX Up ] : # Unknown argument"
51}
52
53_die()
54{
55        echo " * [ LliureX Up ] : Error: $1"
56        exit 1
57}
58
59ACTION="$1"
60case "$ACTION" in
61        migrate)
62                _migrate
63        ;;
64        info)
65                _info
66        ;;
67        details)
68                get_details
69        ;;
70        *)
71                _usage
72        ;;
73esac
74
75exit 0
76
77
78
79
Note: See TracBrowser for help on using the repository browser.