Subversion Repositories ALCASAR

Rev

Rev 456 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 456 Rev 457
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: alcasar-urpmi.sh 456 2011-01-15 11:15:25Z franck $
2
# $Id: alcasar-urpmi.sh 457 2011-01-16 22:40:10Z richard $
3
# script de mise à jour de la distribution 
3
# script de mise à jour de la distribution 
4
# 3abtux
4
# 3abtux
5
# changelog :
5
# changelog :
6
# 	+ Fait une mise à niveau du système actuel
6
# 	+ Fait une mise à niveau du système actuel
7
#	+ vérifie que la version actuelle du système est compatible avec un upgrade
7
#	+ vérifie que la version actuelle du système est compatible avec un upgrade
Line 10... Line 10...
10
# Mise à niveau du système dans la version 2010.1
10
# Mise à niveau du système dans la version 2010.1
11
 
11
 
12
VERSION="2010.1"
12
VERSION="2010.1"
13
 
13
 
14
fic=`cat /etc/product.id`
14
fic=`cat /etc/product.id`
15
#old="$IFS"
15
old="$IFS"
16
#IFS=","
16
IFS=","
17
set $fic
17
set $fic
18
for i in $*
18
for i in $*
19
do
19
do
20
	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
20
	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
21
	then 
21
	then 
22
		VERSION=`echo $i|cut -d"=" -f2`
22
		CURRENT_VERSION=`echo $i|cut -d"=" -f2`
-
 
23
		echo $CURRENT_VERSION
23
		if [ $VERSION != 2009.0 -o $VERSION != 2009.1 -o $VERSION != 2010.0 -o $VERSION != 2010.2 ]
24
		if [ $CURRENT_VERSION != "2009.0" ] && [ $CURRENT_VERSION != "2009.1" ] && [ $CURRENT_VERSION != "2010.0" ] && [ $CURRENT_VERSION != "2010.1" ] && [ $CURRENT_VERSION != "2010.2" ] 
24
		then
25
		then
25
		      echo "Désolé, la migration automatique du système ne peut être réalisée depuis une version inférieure à la 2009.0"
26
		      echo "La migration automatique du système ne peut être réalisée."
26
		      echo "Réalisez une nouvelle installation en 2010.1 (cf. Doc) !"
27
		      echo "Réalisez une mise à jour manuelle (cf. doc)."
27
		exit 1		
28
		exit 1		
28
		fi
29
		fi
29
	fi
30
	fi
30
	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
31
	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
31
	then 
32
	then 
32
		ARCH=`echo $i|cut -d"=" -f2`
33
		ARCH=`echo $i|cut -d"=" -f2`
33
	else
34
	else
34
		ARCH="i586"
35
		ARCH="i586"
35
	fi
36
	fi
36
done
37
done
37
#IFS="$old"
38
IFS="$old"
38
 
-
 
39
echo "Mise à niveau de la version actuelle avant migration ! "
39
echo "Mise à niveau de la version actuelle"
40
urpmi --auto --auto-update
40
urpmi --auto --auto-update
41
 
-
 
42
############################
-
 
43
# For International install
41
# migration si nécessaire
44
# MIRRORLIST="http://api.mandriva.com/mirrors/basic.$VERSION.$ARCH.list"
42
if [ $CURRENT_VERSION  == $VERSION ] || [ $CURRENT_VERSION == "2010.2" ]
45
 
-
 
46
# For french ALCASARistes
-
 
47
MIRRORLIST="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH"
-
 
48
############################
-
 
49
 
-
 
50
urpmi.removemedia -a
-
 
51
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main /media/main/release
-
 
52
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main_updates /media/main/updates
-
 
53
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib /media/contrib/release
-
 
54
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib_updates /media/contrib/updates
-
 
55
nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
-
 
56
if [ "$nb_repository" != "4" ]
-
 
57
then
43
then
-
 
44
	############################
-
 
45
	# For International install
-
 
46
	# MIRRORLIST="http://api.mandriva.com/mirrors/basic.$VERSION.$ARCH.list"
-
 
47
	
-
 
48
	# For french ALCASARistes
-
 
49
	MIRRORLIST="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH"
-
 
50
	############################
-
 
51
 
-
 
52
	urpmi.removemedia -a
-
 
53
	urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main /media/main/release
-
 
54
	urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main_updates /media/main/updates
-
 
55
	urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib /media/contrib/release
-
 
56
	urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib_updates /media/contrib/updates
-
 
57
	nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
-
 
58
	if [ "$nb_repository" != "4" ]
-
 
59
	then
58
	exit 1
60
		exit 1
-
 
61
	fi
-
 
62
	# Effectue la migration du système en mandriva $VERSION
-
 
63
	echo "Migration du système en Mandriva $VERSION ! Cela peut durer un certains temps ... "
-
 
64
	echo "Il est temps d'aller prendre un café :-) "
-
 
65
	urpmi --auto --auto-update
59
fi
66
fi
60
 
-
 
61
# Effectue la migration du système en mandriva $VERSION
-
 
62
echo "Migration du système en Mandriva $VERSION ! Cela peut durer un certains temps ... "
-
 
63
echo "Il est temps d'aller prendre un café :-) "
-
 
64
urpmi --auto --auto-update
-
 
65
 
-
 
66
# puis un peu de nettoyage
67
# puis un peu de nettoyage
67
urpme --auto --auto-orphans
68
urpme --auto --auto-orphans
68
 
-
 
69
exit 0
69
exit 0
70
 
70
 
71
 
71
 
72
 
72