| 1 | 
           root | 
           1 | 
           #!/bin/sh
  | 
        
        
           | 64 | 
           franck | 
           2 | 
           # $Id: alcasar-urpmi.sh 64 2010-04-08 20:01:24Z franck $
  | 
        
        
           | 1 | 
           root | 
           3 | 
           # script d'ajout des medias logiciels 
  | 
        
        
            | 
            | 
           4 | 
           # 3abtux & rexy
  | 
        
        
            | 
            | 
           5 | 
           # changelog :
  | 
        
        
            | 
            | 
           6 | 
           # 	+ prise en compte dynamique de la version de la distribution
  | 
        
        
            | 
            | 
           7 | 
           #	+ prise en compte de la nouvelle struture RPM
  | 
        
        
           | 29 | 
           richard | 
           8 | 
           #	+ test avant sortie
  | 
        
        
           | 1 | 
           root | 
           9 | 
              | 
        
        
            | 
            | 
           10 | 
           fic=`cat /etc/product.id`
  | 
        
        
            | 
            | 
           11 | 
           old="$IFS"
  | 
        
        
            | 
            | 
           12 | 
           IFS=","
  | 
        
        
            | 
            | 
           13 | 
           set $fic
  | 
        
        
            | 
            | 
           14 | 
           for i in $*
  | 
        
        
            | 
            | 
           15 | 
           do
  | 
        
        
            | 
            | 
           16 | 
           	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
  | 
        
        
            | 
            | 
           17 | 
           	then 
  | 
        
        
            | 
            | 
           18 | 
           		ARCH=`echo $i|cut -d"=" -f2`
  | 
        
        
            | 
            | 
           19 | 
           	fi
  | 
        
        
            | 
            | 
           20 | 
           	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
  | 
        
        
            | 
            | 
           21 | 
           	then 
  | 
        
        
            | 
            | 
           22 | 
           		VERSION=`echo $i|cut -d"=" -f2`
  | 
        
        
            | 
            | 
           23 | 
           	fi
  | 
        
        
            | 
            | 
           24 | 
           done
  | 
        
        
            | 
            | 
           25 | 
           IFS="$old"
  | 
        
        
           | 29 | 
           richard | 
           26 | 
              | 
        
        
            | 
            | 
           27 | 
           # For International install
  | 
        
        
            | 
            | 
           28 | 
           # MIRRORLIST="http://api.mandriva.com/mirrors/basic.$VERSION.$ARCH.list"
  | 
        
        
            | 
            | 
           29 | 
              | 
        
        
            | 
            | 
           30 | 
           # For french ALCASARistes
  | 
        
        
            | 
            | 
           31 | 
           MIRRORLIST="http://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/$VERSION/$ARCH"
  | 
        
        
            | 
            | 
           32 | 
              | 
        
        
           | 1 | 
           root | 
           33 | 
           urpmi.removemedia -a
  | 
        
        
           | 29 | 
           richard | 
           34 | 
           urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main /media/main/release
  | 
        
        
            | 
            | 
           35 | 
           urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST main_updates /media/main/updates
  | 
        
        
            | 
            | 
           36 | 
           urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib /media/contrib/release
  | 
        
        
            | 
            | 
           37 | 
           urpmi.addmedia --probe-synthesis --mirrorlist $MIRRORLIST contrib_updates /media/contrib/updates
  | 
        
        
            | 
            | 
           38 | 
           nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
  | 
        
        
            | 
            | 
           39 | 
           if [ "$nb_repository" != "4" ]
  | 
        
        
            | 
            | 
           40 | 
           then
  | 
        
        
            | 
            | 
           41 | 
           	exit 1
  | 
        
        
            | 
            | 
           42 | 
           	else exit 0
  | 
        
        
            | 
            | 
           43 | 
           fi
  | 
        
        
            | 
            | 
           44 | 
              |