Subversion Repositories ALCASAR

Rev

Rev 29 | Go to most recent revision | Blame | Last modification | View Log

#!/bin/sh
# script d'ajout des medias logiciels 
# 3abtux & rexy
# changelog :
#       + prise en compte dynamique de la version de la distribution
#       + prise en compte de la nouvelle struture RPM
#       + test avant sortie

fic=`cat /etc/product.id`
old="$IFS"
IFS=","
set $fic
for i in $*
do
        if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
        then 
                ARCH=`echo $i|cut -d"=" -f2`
        fi
        if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
        then 
                VERSION=`echo $i|cut -d"=" -f2`
        fi
done
IFS="$old"

# 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
        else exit 0
fi