source: lliurex-up/trunk/fuentes/scripts/install-packages @ 464

Last change on this file since 464 was 464, checked in by jrpelegrina, 5 years ago

First release to Xenial

File size: 3.7 KB
Line 
1#!/bin/sh
2# Installing packages (doing the real dist-upgrade)
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 "Install required packages")"
15SERVER_ATENTION_MESSAGE="$(gettext "This seems a LliureX Server, caution. ")"
16SERVER_REMOVE_PACKAGES_MESSAGE="$(gettext "Removing some packages")"
17SERVER_INSTALL_PACKAGES_MESSAGE="$(gettext "Installed some packages")"
18APACHE_CRT_FILE="/etc/lliurex-secrets/certs/apache/apache.crt"
19APACHE_CRT_FILE_NCFG="/usr/share/ca-certificates/lliurex-certs/ncfg-certs/apache.crt"
20APACHE_CRT_FILE_NCFG_VAR="/var/lib/llxcfg-ncfg-certs/certificates/ncfg-certs/apache.crt"
21
22# Methods
23
24_commonPreUpgradeActions()
25{
26
27        for package in lliurex-live-ubiquity ubiquity ubiquity-casper ubiquity-frontend-gtk ubiquity-ubuntu-artwork casper-customize-mod-autologin casper-customize-mod-nsswitch; do
28            _test_and_remove_package ${package}
29        done
30
31}
32
33_musicaPreUpgradeActions()
34{
35        echo " * [ LliureX Up ] : Musica Upgrade"
36}
37
38_infantilPreUpgradeActions()
39{
40        echo " * [ LliureX Up ] : Infantil Upgrade"
41}
42
43_desktopPreUpgradeActions()
44{
45        echo " * [ LliureX Up ] : Desktop Upgrade"
46}
47
48_biblioPreUpgradeActions()
49{
50        echo " * [ LliureX Up ] : Biblioteca Upgrade"
51        _cleanhome
52}
53
54_clientPreUpgradeActions()
55{
56        echo " * [ LliureX Up ] : Client Upgrade"
57        _cleanhome
58}
59
60_teachersPreUpgradeActions()
61{
62        echo " * [ LliureX Up ] : Teachers Upgrade"
63}
64
65_pimePreUpgradeActions()
66{
67        echo " * [ LliureX Up ] : Pime Upgrade"
68}
69
70# Post Upgrade Actions
71
72_serverPostUpgradeActions()
73{
74        echo "$SERVER_ATENTION_MESSAGE"
75        # Install some packages.
76        echo "$SERVER_INSTALL_PACKAGES_MESSAGE"         
77        apt-get install -y --force-yes "$PACKAGES_INSTALL_ON_SERVER"
78        for package in modemmanager; do
79            _test_and_remove_package ${package}
80        done
81       
82}
83
84_musicaPostUpgradeActions()
85{
86        echo " * [ LliureX Up ] : Musica Upgrade"
87        # Install some packages
88        apt-get install -y --force-yes "$PACKAGES_INSTALL_ON_MUSIC"
89}
90
91_infantilPostUpgradeActions()
92{
93        echo " * [ LliureX Up ] : Infantil Upgrade"
94        # Install some packages
95        apt-get install -y --force-yes "$PACKAGES_INSTALL_ON_INFANTIL"
96}
97
98_desktopPostUpgradeActions()
99{
100        echo " * [ LliureX Up ] : Desktop Upgrade"
101        # Install some packages
102        apt-get install -y --force-yes "$PACKAGES_INSTALL_ON_DESKTOP"
103}
104
105_biblioPostUpgradeActions()
106{
107        echo " * [ LliureX Up ] : Biblioteca Upgrade"
108        # Install some packages
109        apt-get install -y --force-yes "$PACKAGES_INSTALL_ON_BIBLIOTECA"
110}
111
112_clientPostUpgradeActions()
113{
114        echo " * [ LliureX Up ] : Client"
115        # Install some packages
116        apt-get install -y --force-yes "$PACKAGES_INSTALL_ON_CLIENT"
117        for package in modemmanager lliurex-initramfs-tools-nsswitch ; do
118            _test_and_remove_package ${package}
119        done
120}
121
122_teachersPostUpgradeActions()
123{
124        echo " * [ LliureX Up ] : Teachers Upgrade"
125        # Install some packages
126        apt-get install -y --force-yes "$PACKAGES_INSTALL_ON_TEACHERS"
127}
128
129_pimePostUpgradeActions()
130{
131        echo " * [ LliureX Up ] : Pime Upgrade"
132        # Install some packages
133        apt-get install -y --force-yes "$PACKAGES_INSTALL_ON_PIME"
134}
135
136_info()
137{
138        echo "$INFO_MESSAGE"
139}
140
141_migrate()
142{
143        _discoverCddVersion
144        _commonPreUpgradeActions
145               
146        apt-get dist-upgrade -y --force-yes
147        apt-get -f install
148
149        if [ $IS_SERVER -eq 0 ] ; then
150                _serverPostUpgradeActions       
151        fi
152
153        if [ $IS_CLIENT -eq 0 ] ; then
154                _clientPostUpgradeActions
155        fi
156        update-grub
157}
158
159_usage()
160{
161        echo " * [ LliureX Up ] : # Unknown argument"
162
163}
164
165_die()
166{
167        echo " * [ LliureX Up ] : Error: $1"
168        exit 1
169}
170
171ACTION="$1"
172case "$ACTION" in
173        migrate)
174                _migrate
175        ;;
176        info)
177                _info
178        ;;
179        *)
180                _usage
181        ;;
182esac
183
184exit 0
Note: See TracBrowser for help on using the repository browser.