source: lliurex-up/trunk/fuentes/install-files/usr/share/lliurex-up/common-upgrade-vars.sh @ 464

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

First release to Xenial

File size: 4.8 KB
Line 
1# Source script common for all upgrades
2# this script contains some variables that will
3# be used around the upgrade
4
5NEXT_GENERATION="llx1505"
6NEXT_GENERATION_PATTERN="/trusty"
7NEXT_CODENAME="trusty"
8
9OLD_GENERATION="llx1406"
10OLD_GENERATION_PATTERN="/platinum"
11OLD_CODENAME="pandora"
12
13BACKUP_SOURCES_LIST_PATH="/etc/apt/sources.list.backup-lliurex-up"
14SOURCES_LIST_PATH="/etc/apt/sources.list"
15
16PACKAGES_REMOVED_ON_SERVER="openjdk-6-jre-headless  openjdk-6-jre-lib openjdk-6-jre default-jre openjdk-6-jdk default-jdk libjama-java geogebra icedtea-6-jre-cacao default-jre-headless"
17
18
19
20# Packages install on each flavour
21PACKAGES_INSTALL_ON_SERVER="lliurex-cdd-edu-class-gserver"
22PACKAGES_INSTALL_ON_CLIENT="lliurex-cdd-edu-class-gclient"
23PACKAGES_INSTALL_ON_DESKTOP="lliurex-cdd-gdesktop"
24PACKAGES_INSTALL_ON_EDUDESKTOP="lliurex-cdd-edu-gdesktop"
25PACKAGES_INSTALL_ON_MUSIC="lliurex-cdd-edu-music-gdesktop"
26PACKAGES_INSTALL_ON_INFANTIL="lliurex-cdd-edu-infantil-gdesktop"
27PACKAGES_INSTALL_ON_TEACHERS="lliurex-cdd-edu-class-teachers-gclient"
28PACKAGES_INSTALL_ON_BIBLIOTECA="lliurex-cdd-edu-biblio-gserver"
29PACKAGES_INSTALL_ON_LITE="lliurex-cdd-lxdesktop"
30PACKAGES_INSTALL_ON_GVA="lliurex-cdd-gdesktop-gva"
31PACKAGES_INSTALL_ON_PIME="lliurex-cdd-gdesktop-pime"
32PACKAGES_INSTALL_ON_XDESKTOP="lliurex-cdd-xdesktop"
33
34# ETC TOKENS
35ETCTOKENSPATH="/etc/lliurex-up/tokens"
36
37CDDSERVERLOST="lliurex-cdd-edu-class-gserver.lost"
38
39
40
41TOKENPATH="/tmp/"
42TOKENSERVER="isServer"
43TOKENCLIENT="isClient"
44TOKENDESKTOP="isDesktop"
45TOKENEDUDESKTOP="isEduDesktop"
46TOKENMUSIC="isMusic"
47TOKENINFANTIL="isInfantil"
48TOKENLITE="isLite"
49TOKENTEACHERS="isTeachers"
50TOKENPIME="isPime"
51TOKENBIBLIO="isBiblio"
52TOKENGVA="isGva"
53TOKENXDESKTOP="isXdesktop"
54
55SOURCES_LIST_OK="deb http://lliurex.net/trusty pandora main restricted universe multiverse partner "
56
57IS_SERVER=0
58IS_CLIENT=0
59IS_BIBLIO=0
60IS_DESKTOP=0
61IS_EDUDESKTOP=0
62IS_MUSIC=0
63IS_INFANTIL=0
64IS_TEACHERS=0
65IS_LITE=0
66IS_GVA=0
67IS_PIME=0
68IS_XDESKTOP=0
69
70_test_and_remove_package()
71{
72    # Remove package
73    rc=0
74    dpkg -s ${1} >/dev/null 2>/dev/null || rc=1
75    if [ ${rc} -eq 0 ]; then
76        apt-get purge ${1} --force-yes -y
77    else
78        echo "[ LliureX UP Msg]: Package ${1} not found...nothing to do"
79    fi
80}
81
82_isServer()
83{
84   if  [ ! -f  $TOKENPATH$TOKENSERVER ] ; then
85                IS_SERVER=1
86        fi
87}
88
89_isClient()
90{
91        if [ ! -f $TOKENPATH$TOKENCLIENT ] ; then
92                IS_CLIENT=1
93        fi
94}
95
96_isGva()
97{
98        if [ ! -f "$TOKENPATH$TOKENGVA" ] ; then
99                IS_GVA=1
100        fi
101}
102
103
104_isBiblio()
105{
106        if [ ! -f $TOKENPATH$TOKENBIBLIO ] ; then
107                IS_BIBLIO=1
108        fi
109}
110
111_isDesktop()
112{
113        if [ ! -f $TOKENPATH$TOKENDESKTOP  ] ; then
114                IS_DESKTOP=1
115        fi
116}
117
118_isEduDesktop()
119{
120        if [ ! -f $TOKENPATH$TOKENEDUDESKTOP  ] ; then
121                IS_EDUDESKTOP=1
122        fi
123}
124
125_isXdesktop()
126{
127        if [ ! -f $TOKENPATH$TOKENXDESKTOP  ] ; then
128                IS_XDESKTOP=1
129        fi
130}
131
132_isMusic()
133{
134        if  [ ! -f $TOKENPATH$TOKENMUSIC  ] ; then
135                IS_MUSIC=1
136        fi
137}
138
139_isInfantil()
140{
141        if [ ! -f $TOKENPATH$TOKENINFANTIL ] ; then
142                IS_INFANTIL=1
143        fi
144}
145
146_isTeachers()
147{
148        if [ ! -f $TOKENPATH$TOKENTEACHERS  ] ; then
149                IS_TEACHERS=1
150        fi
151}
152
153_isLite()
154{
155        if  [ ! -f $TOKENPATH$TOKENLITE  ] ; then
156                IS_LITE=1
157        fi
158}
159
160_isPime()
161{
162    if [ ! -f $TOKENPATH$TOKENPIME ] ; then
163        IS_PIME=1
164    fi
165}
166
167######
168
169_researchIsServer()
170{
171        lliurex-version -t server && touch      $TOKENPATH$TOKENSERVER
172       
173}
174
175_researchIsClient()
176{
177        lliurex-version -t client && touch $TOKENPATH$TOKENCLIENT
178        lliurex-version -t network-client && touch $TOKENPATH$TOKENCLIENT
179}
180
181_researchIsBiblio()
182{
183        lliurex-version -t biblio && touch $TOKENPATH$TOKENBIBLIO
184}
185
186_researchIsGva()
187{
188        lliurex-version -t gva && touch $TOKENPATH$TOKENGVA
189
190}
191_researchIsDesktop()
192{
193        lliurex-version -t desktop && touch $TOKENPATH$TOKENDESKTOP
194}
195
196
197_researchIsEduDesktop()
198{
199        rc=0
200        lliurex-version -t desktop || rc=1
201        lliurex-version -t edu || rc=1
202        if [ $rc -eq 0 ] ; then
203                touch $TOKENPATH$TOKENEDUDESKTOP
204        fi
205}
206
207_researchIsXdesktop()
208{
209        lliurex-version -t xdesktop  && touch $TOKENPATH$TOKENXDESKTOP
210}
211
212_researchIsMusic()
213{
214        lliurex-version -t music && touch $TOKENPATH$TOKENMUSIC
215}
216
217_researchIsInfantil()
218{
219        lliurex-version -t infantil && touch $TOKENPATH$TOKENINFANTIL
220}
221
222_researchIsTeachers()
223{
224        lliurex-version -t teachers && touch $TOKENPATH$TOKENTEACHERS
225}
226
227_researchIsLite()
228{
229        rc=0
230        lliurex-version -t lxde || rc=1
231        lliurex-version -t desktop || rc=1
232        if [ $rc -eq 0 ]; then
233                touch $TOKENPATH$TOKENLITE
234        fi
235}
236
237_researchIsPime()
238{
239        lliurex-version -t pime && touch $TOKENPATH$TOKENPIME
240}
241
242# Discover cdd-version for values
243
244_discoverCddVersion()
245{
246        _isServer
247        _isClient
248        _isBiblio
249        _isPime
250        _isGva
251        _isDesktop
252        _isEduDesktop
253        _isXdesktop
254        _isMusic
255        _isInfantil
256        _isTeachers
257        _isLite
258
259}
260
261_researchCddVersion()
262{
263        _researchIsServer
264        _researchIsClient
265        _researchIsBiblio
266        _researchIsPime
267        _researchIsGva
268        _researchIsMusic
269        _researchIsDesktop
270        _researchIsEduDesktop
271        _researchIsXdesktop
272        _researchIsInfantil
273        _researchIsTeachers
274        _researchIsLite
275}
276
Note: See TracBrowser for help on using the repository browser.