Magellan Linux

Annotation of /mage/branches/alx07x-unstable/profiles/alx-070/forced-uninstall

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7861 - (hide annotations) (download)
Wed Nov 18 09:35:23 2015 UTC (8 years, 6 months ago) by niro
File size: 1269 byte(s)
-release alx070x-unstable
1 niro 3130 #!/bin/bash
2     # $Id$
3    
4     # get a suitable environment
5     source /etc/profile
6    
7     MAGERC="/etc/mage.rc"
8     MAGEPROFILE="alx-070"
9     NEW_MAGE_DISTRIBUTION="unstable"
10     NEW_RSYNC="rsync://magellan-linux.de/mage-alx-0.7.0"
11     NEW_MIRRORS="http://magellan-linux.de/magellan/alx-0.7.0/${NEW_MAGE_DISTRIBUTION}"
12     #NEW_RSYNC="rsync://128.20.41.110/mage-alx-070"
13     #NEW_MIRRORS="http://128.20.41.110/magellan/alx-070"
14     NEW_PACKAGES_SERVER_PATH='packages/${ARCH}'
15     NEW_MAGE_UNINSTALL_TIMEOUT=0
16    
17     updateconfig()
18     {
19     local variables="$@"
20     local value
21     local i
22    
23     if [[ -z ${CONFIG} ]]
24     then
25     echo "You must define \$CONFIG varibale first!"
26     return 1
27     fi
28    
29     for i in ${variables}
30     do
31     value="$(eval echo \${NEW_${i}})"
32     if [[ ! -z $(grep "^${i}=" ${CONFIG}) ]]
33     then
34     echo "fixing ${i} -> ${value}"
35     sed -i "s|^\(${i}=\).*|\1\"${value}\"|" ${CONFIG}
36     else
37     echo "adding ${i}=${value}"
38     echo "${i}=\"${value}\"" >> ${CONFIG}
39     fi
40     done
41     }
42    
43     # fix mage.rc
44     CONFIG="${MAGERC}"
45     updateconfig RSYNC MIRRORS MAGE_DISTRIBUTION PACKAGES_SERVER_PATH MAGE_UNINSTALL_TIMEOUT
46    
47     # fix profile
48     if [[ $(readlink /etc/mage-profile) != */${MAGEPROFILE} ]]
49     then
50     echo "fixing profile link -> /usr/mage/profiles/${MAGEPROFILE}"
51     ln -snf /usr/mage/profiles/${MAGEPROFILE} /etc/mage-profile
52     fi
53    
54     # ------- exit -------
55     exit 0