Subversion Repositories ALCASAR

Rev

Rev 460 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 460 Rev 461
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: alcasar-urpmi.sh 460 2011-01-17 22:22:16Z richard $
2
# $Id: alcasar-urpmi.sh 461 2011-01-18 21:10:27Z richard $
3
# script de mise à jour de la distribution 
3
# script de mise à jour de la distribution 
4
# 3abtux & rexy
4
# 3abtux & rexy
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 
7
#	+ vérifie que la version actuelle du système est compatible 
8
#	+ remplace les médias puis met à jour
8
#	+ remplace les médias puis met à jour
9
 
9
 
10
VERSION="2010.1"
10
VERSION="2010.1"
11
# extract the current Mandriva version and hardware architecture (i586 ou X64)
11
# extract the current Mandriva version and hardware architecture (i586 ou X64)
12
fic=`cat /etc/product.id`
12
fic=`cat /etc/product.id`
13
old="$IFS"
13
old="$IFS"
14
IFS=","
14
IFS=","
15
set $fic
15
set $fic
16
for i in $*
16
for i in $*
17
do
17
do
18
	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
18
	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
19
	then 
19
	then 
20
		CURRENT_VERSION=`echo $i|cut -d"=" -f2`
20
		CURRENT_VERSION=`echo $i|cut -d"=" -f2`
21
		if [ $CURRENT_VERSION != "2009.0" ] && [ $CURRENT_VERSION != "2009.1" ] && [ $CURRENT_VERSION != "2010.0" ] && [ $CURRENT_VERSION != "2010.1" ] && [ $CURRENT_VERSION != "2010.2" ] 
21
		if [ $CURRENT_VERSION != "2009.0" ] && [ $CURRENT_VERSION != "2009.1" ] && [ $CURRENT_VERSION != "2010.0" ] && [ $CURRENT_VERSION != "2010.1" ] && [ $CURRENT_VERSION != "2010.2" ] 
22
		then
22
		then
23
		      echo "La migration automatique du système ne peut être réalisée."
23
		      echo "La migration automatique du système ne peut être réalisée."
24
		      echo "Réalisez une mise à jour manuelle (cf. doc)."
24
		      echo "Réalisez une mise à jour manuelle (cf. doc)."
25
		      echo "The automatic system update can't perform."
25
		      echo "The automatic system update can't perform."
26
		      echo "Do a manual update (see doc)."
26
		      echo "Do a manual update (see doc)."
27
		exit 1		
27
		exit 1		
28
		fi
28
		fi
29
	fi
29
	fi
30
	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
30
	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
31
	then 
31
	then 
32
		ARCH=`echo $i|cut -d"=" -f2`
32
		ARCH=`echo $i|cut -d"=" -f2`
33
	else
33
	else
34
		ARCH="i586"
34
		ARCH="i586"
35
	fi
35
	fi
36
done
36
done
37
IFS="$old"
37
IFS="$old"
38
# migrate
-
 
39
if [ $CURRENT_VERSION != "2010.2" ]
-
 
40
then
-
 
41
###########################
38
###########################
42
#                       For International install
39
#                       For International install
43
#MIRRORLIST="http://api.mandriva.com/mirrors/basic.$VERSION.$ARCH.list"
40
#MIRRORLIST="http://api.mandriva.com/mirrors/basic.$VERSION.$ARCH.list"
44
#                       For french ALCASARistes
41
#                       For french ALCASARistes
45
MIRRORLIST="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH"
42
MIRRORLIST="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH"
46
############################
43
############################
47
	urpmi.removemedia -a
44
urpmi.removemedia -a
48
	urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main /media/main/release
45
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main /media/main/release
49
	urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main_updates /media/main/updates
46
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main_updates /media/main/updates
50
	urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib /media/contrib/release
47
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib /media/contrib/release
51
	urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib_updates /media/contrib/updates
48
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib_updates /media/contrib/updates
52
	nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
49
nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
53
	if [ "$nb_repository" != "4" ]
50
if [ "$nb_repository" != "4" ]
54
	then
51
then
55
		exit 1
52
	exit 1
56
	fi
-
 
57
	echo "Migration du système en Mandriva $VERSION ! Cela peut durer un certains temps ... "
-
 
58
	echo "Il est temps d'aller prendre un café :-) "
-
 
59
	echo "Mandriva Linux migration in progress. It could take a while ..."
-
 
60
	echo "You should now take a Beer ;-) "
-
 
61
fi
53
fi
62
# update testing and download RPM in cache 
54
# update testing and download RPM in cache 
63
echo "Récupération des paquetages de mise à jour. Veuillez patienter ..."
55
echo "Récupération des paquetages de mise à jour. Veuillez patienter ..."
64
echo "Updated RPM download. Please wait ..."
56
echo "Updated RPM download. Please wait ..."
-
 
57
echo "Il est temps d'aller prendre un café :-) "
-
 
58
echo "You should now take a Beer ;-) "
65
urpmi --auto --auto-update --quiet --test --retry 2
59
urpmi --auto --auto-update --quiet --test --retry 2
66
if [ "$?" != "0" ]
60
if [ "$?" != "0" ]
67
then
61
then
68
	echo
62
	echo
69
	echo "Une erreur a été détectée lors de la récupération des paquetages de mise à jour."
63
	echo "Une erreur a été détectée lors de la récupération des paquetages de mise à jour."
70
	echo "Relancez l'installation ultérieurement."
64
	echo "Relancez l'installation ultérieurement."
71
	echo "Si vous rencontrez à nouveau ce problème, modifier la variable MIRRORLIST du fichier 'scripts/alcasar-urpmi.sh'"
65
	echo "Si vous rencontrez à nouveau ce problème, modifier la variable MIRRORLIST du fichier 'scripts/alcasar-urpmi.sh'"
72
	echo "An error occurs when downloading"
66
	echo "An error occurs when downloading"
73
	echo "Try an other install later."
67
	echo "Try an other install later."
74
	echo "If this problem occurs again, change the MIRRORLIST variable in the file 'scripts/alcasar-urpmi.sh'"
68
	echo "If this problem occurs again, change the MIRRORLIST variable in the file 'scripts/alcasar-urpmi.sh'"
75
fi
69
fi
76
# update with cached RPM
70
# update with cached RPM
77
urpmi --auto --auto-update
71
urpmi --auto --auto-update
78
# cleaning
72
# cleaning
79
urpme --auto --auto-orphans
73
urpme --auto --auto-orphans
80
exit 0
74
exit 0
81
 
75
 
82
 
76