Subversion Repositories ALCASAR

Rev

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

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