Subversion Repositories ALCASAR

Rev

Rev 1509 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1509 Rev 1529
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-urpmi.sh 1509 2014-11-30 22:45:38Z richard $
2
# $Id: alcasar-urpmi.sh 1529 2014-12-21 16:17:23Z richard $
3
 
3
 
4
# alcasar-urpmi.sh
4
# alcasar-urpmi.sh
5
# by 3abtux and Rexy
5
# by 3abtux and Rexy
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 38... Line 38...
38
	echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'"
38
	echo "If this problem occurs again, change the MIRRORLIST[1&2] variables in the file 'scripts/alcasar-urpmi.sh'"
39
fi
39
fi
40
}
40
}
41
# extract the current Mageia version and hardware architecture (i586 ou X64)
41
# extract the current Mageia version and hardware architecture (i586 ou X64)
42
fic=`cat /etc/product.id`
42
fic=`cat /etc/product.id`
43
unknown_os=0
-
 
44
old="$IFS"
43
old="$IFS"
45
IFS=","
44
IFS=","
46
set $fic
45
set $fic
47
for i in $*
46
for i in $*
48
do
47
do
49
	if [ "`echo $i|grep distribution|cut -d'=' -f1`" == "distribution" ]
48
	if [ "`echo $i|grep distribution|cut -d'=' -f1`" == "distribution" ]
50
	then 
49
	then 
51
		DISTRIBUTION=`echo $i|cut -d"=" -f2`
50
		DISTRIBUTION=`echo $i|cut -d"=" -f2`
52
		unknown_os=`expr $unknown_os + 1`
-
 
53
	fi
51
	fi
54
	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
52
	if [ "`echo $i|grep version|cut -d'=' -f1`" == "version" ]
55
	then 
53
	then 
56
		CURRENT_VERSION=`echo $i|cut -d"=" -f2`
54
		CURRENT_VERSION=`echo $i|cut -d"=" -f2`
57
		unknown_os=`expr $unknown_os + 1`
-
 
58
	fi
55
	fi
59
	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
56
	if [ "`echo $i|grep arch|cut -d'=' -f1`" == "arch" ]
60
	then 
57
	then 
61
		ARCH=`echo $i|cut -d"=" -f2`
58
		ARCH=`echo $i|cut -d"=" -f2`
62
		unknown_os=`expr $unknown_os + 1`
-
 
63
	fi
59
	fi
64
done
60
done
65
IFS="$old"
61
IFS="$old"
66
if [[ ( $unknown_os != 3 || "$DISTRIBUTION" != "Mageia" ) && ( "$CURRENT_VERSION" != "4" ) ]]
-
 
67
then
-
 
68
	if [ $Lang == "fr" ]
-
 
69
	then	
-
 
70
		echo "L'installation ou la mise @ jour d'ALCASAR ne peut pas être réalisée."
-
 
71
		echo "Le système d'exploitation doit être remplacé (Mageia4)"
-
 
72
	else
-
 
73
		echo "The automatic update of ALCASAR can't be performed."
-
 
74
		echo "The OS must be replaced (Mageia4)"
-
 
75
	fi
-
 
76
	if [ -e /tmp/alcasar-conf.tar.gz ]
-
 
77
	then
-
 
78
		echo
-
 
79
		if [ $Lang == "fr" ]
-
 
80
		then	
-
 
81
			echo "1 - Récupérez le fichier de configuration actuel (/tmp/alcasar-conf.tar.gz)."
-
 
82
			echo "2 - Installez Linux-Mageia4 (cf. doc d'installation)"
-
 
83
			echo "3 - copiez le fichier 'alcasar-conf.tar.gz' dans le répertoire '/tmp' avant de lancer l'installation d'ALCASAR"
-
 
84
		else
-
 
85
			echo "1 - Retrieve the configuration file (/tmp/alcasar-conf.tar.gz)"
-
 
86
			echo "2 - Install Linux-Mageia4 (cf. installation doc)"
-
 
87
			echo "3 - Copy the file 'alcasar-conf.tar.gz' in the folder '/tmp' before launching the installation of ALCASAR"
-
 
88
		fi
-
 
89
	fi
-
 
90
	exit 1
-
 
91
fi
-
 
92
# We prefer wget than curl
62
# We prefer wget than curl
93
urpmi --no-verify-rpm --auto conf/rpms/$ARCH/wget*.rpm
63
urpmi --no-verify-rpm --auto conf/rpms/$ARCH/wget*.rpm
94
# Set the RPM repository (if not already set)
64
# Set the RPM repository (if not already set)
95
ACTIVE_REPO=`cat /etc/urpmi/urpmi.cfg|grep "mageia.org"|wc -l`
65
ACTIVE_REPO=`cat /etc/urpmi/urpmi.cfg|grep "mageia.org"|wc -l`
96
if [ "$ACTIVE_REPO" != "2" ]
66
if [ "$ACTIVE_REPO" != "2" ]