12,18 → 12,19 |
VERSION="2010.1" |
|
fic=`cat /etc/product.id` |
#old="$IFS" |
#IFS="," |
old="$IFS" |
IFS="," |
set $fic |
for i in $* |
do |
if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ] |
then |
VERSION=`echo $i|cut -d"=" -f2` |
if [ $VERSION != 2009.0 -o $VERSION != 2009.1 -o $VERSION != 2010.0 -o $VERSION != 2010.2 ] |
CURRENT_VERSION=`echo $i|cut -d"=" -f2` |
echo $CURRENT_VERSION |
if [ $CURRENT_VERSION != "2009.0" ] && [ $CURRENT_VERSION != "2009.1" ] && [ $CURRENT_VERSION != "2010.0" ] && [ $CURRENT_VERSION != "2010.1" ] && [ $CURRENT_VERSION != "2010.2" ] |
then |
echo "Désolé, la migration automatique du système ne peut être réalisée depuis une version inférieure à la 2009.0" |
echo "Réalisez une nouvelle installation en 2010.1 (cf. Doc) !" |
echo "La migration automatique du système ne peut être réalisée." |
echo "Réalisez une mise à jour manuelle (cf. doc)." |
exit 1 |
fi |
fi |
34,38 → 35,37 |
ARCH="i586" |
fi |
done |
#IFS="$old" |
|
echo "Mise à niveau de la version actuelle avant migration ! " |
IFS="$old" |
echo "Mise à niveau de la version actuelle" |
urpmi --auto --auto-update |
# migration si nécessaire |
if [ $CURRENT_VERSION == $VERSION ] || [ $CURRENT_VERSION == "2010.2" ] |
then |
############################ |
# For International install |
# MIRRORLIST="http://api.mandriva.com/mirrors/basic.$VERSION.$ARCH.list" |
|
# For french ALCASARistes |
MIRRORLIST="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH" |
############################ |
|
############################ |
# For International install |
# MIRRORLIST="http://api.mandriva.com/mirrors/basic.$VERSION.$ARCH.list" |
|
# For french ALCASARistes |
MIRRORLIST="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH" |
############################ |
|
urpmi.removemedia -a |
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main /media/main/release |
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main_updates /media/main/updates |
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib /media/contrib/release |
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib_updates /media/contrib/updates |
nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l` |
if [ "$nb_repository" != "4" ] |
then |
exit 1 |
urpmi.removemedia -a |
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main /media/main/release |
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main_updates /media/main/updates |
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib /media/contrib/release |
urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib_updates /media/contrib/updates |
nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l` |
if [ "$nb_repository" != "4" ] |
then |
exit 1 |
fi |
# Effectue la migration du système en mandriva $VERSION |
echo "Migration du système en Mandriva $VERSION ! Cela peut durer un certains temps ... " |
echo "Il est temps d'aller prendre un café :-) " |
urpmi --auto --auto-update |
fi |
|
# Effectue la migration du système en mandriva $VERSION |
echo "Migration du système en Mandriva $VERSION ! Cela peut durer un certains temps ... " |
echo "Il est temps d'aller prendre un café :-) " |
urpmi --auto --auto-update |
|
# puis un peu de nettoyage |
urpme --auto --auto-orphans |
|
exit 0 |
|
|