Magellan Linux

Diff of /mage/branches/alx-0_6_0/profiles/alx-060/forced-uninstall

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2112 by niro, Thu May 12 18:51:46 2011 UTC revision 2180 by niro, Wed May 18 22:55:40 2011 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # $Id$  # $Id$
3    
4    MAGERC="/etc/mage.rc"
5    MAGEPROFILE="alx-060"
6    NEW_MAGE_DISTRIBUTION="unstable"
7    NEW_RSYNC="rsync://magellan-linux.de/mage-alx-0.6.0"
8    NEW_MIRRORS="http://magellan-linux.de/magellan/alx-0.6.0/${NEW_MAGE_DISTRIBUTION}"
9    NEW_PACKAGES_SERVER_PATH='packages/${ARCH}'
10    NEW_MAGE_UNINSTALL_TIMEOUT=0
11    
12    CONFIGRC="/etc/alxconfig-ng/config.rc"
13    NEW_ALX_NETWORKING="dhcp"
14    NEW_ALX_DHCP_PROG="/sbin/udhcpc"
15    NEW_ALX_DHCP_START="-T 10"
16    NEW_ALX_DHCP_STOP=""
17    
18  read_value()  read_value()
19  {  {
20   local file=$1   local file=$1
# Line 14  read_value() Line 28  read_value()
28   return 0   return 0
29  }  }
30    
31  MAGERC="/etc/mage.rc"  updateconfig()
32  MAGEPROFILE="alx-060"  {
33  NEW_MAGE_DISTRIBUTION="unstable"   local variables="$@"
34  NEW_RSYNC="rsync://magellan-linux.de/mage-alx-0.6.0"   local value
35  NEW_MIRRORS="http://magellan-linux.de/magellan/alx-0.6.0/${NEW_MAGE_DISTRIBUTION}"   local i
 NEW_PACKAGES_SERVER_PATH='packages/${ARCH}'  
 NEW_MAGE_UNINSTALL_TIMEOUT=0  
36    
37  # fix mage.rc   if [[ -z ${CONFIG} ]]
 for i in RSYNC MIRRORS MAGE_DISTRIBUTION PACKAGES_SERVER_PATH MAGE_UNINSTALL_TIMEOUT  
 do  
  value="$(eval echo \${NEW_${i}})"  
  if [[ ! -z $(grep "^${i}=" ${MAGERC}) ]]  
38   then   then
39   echo "fixing $i -> ${value}"   echo "You must define \$CONFIG varibale first!"
40   sed -i "s|^\(${i}=\).*|\1\"${value}\"|" ${MAGERC}   return 1
  else  
  echo "adding $i=${value}"  
  echo "${i}=\"${value}\"" >> ${MAGERC}  
41   fi   fi
42  done  
43     for i in ${variables}
44     do
45     value="$(eval echo \${NEW_${i}})"
46     if [[ ! -z $(grep "^${i}=" ${CONFIG}) ]]
47     then
48     echo "fixing ${i} -> ${value}"
49     sed -i "s|^\(${i}=\).*|\1\"${value}\"|" ${CONFIG}
50     else
51     echo "adding ${i}=${value}"
52     echo "${i}=\"${value}\"" >> ${CONFIG}
53     fi
54     done
55    }
56    
57    # fix mage.rc
58    CONFIG="${MAGERC}"
59    updateconfig RSYNC MIRRORS MAGE_DISTRIBUTION PACKAGES_SERVER_PATH MAGE_UNINSTALL_TIMEOUT
60    
61    # fix config.rc
62    CONFIG="${CONFIGRC}"
63    updateconfig ALX_NETWORKING ALX_DHCP_PROG ALX_DHCP_START ALX_DHCP_STOP
64    
65  # fix profile  # fix profile
66  if [[ $(readlink /etc/mage-profile) != */${MAGEPROFILE} ]]  if [[ $(readlink /etc/mage-profile) != */${MAGEPROFILE} ]]
# Line 135  do Line 161  do
161   mage uninstall ${i}   mage uninstall ${i}
162  done  done
163    
 if [[ -f /.orphaned ]]  
 then  
  echo "Searching for orphaned files and directories ..."  
  bash /etc/mage-profile/prune-orphaned-files  
  rm -f /.orphaned  
 fi  
   
164  if [[ -f /.dist-upgrade ]]  if [[ -f /.dist-upgrade ]]
165  then  then
166   # array of wireless opts   # array of wireless opts
# Line 172  then Line 191  then
191   done   done
192   rm -f ${i}.orig   rm -f ${i}.orig
193   done   done
194     # search modules files
195     for i in $(find /etc/modules.d -name net.\*)
196     do
197     install -d /etc/modprobe.d
198     mv ${i} /etc/modprobe.d/${i%.conf}.conf
199     done
200    fi
201    
202    if [[ -f /.orphaned ]]
203    then
204     echo "Searching for orphaned files and directories ..."
205     bash /etc/mage-profile/prune-orphaned-files
206     rm -f /.orphaned
207  fi  fi
208    
209  if [[ -f /.dist-upgrade ]]  if [[ -f /.dist-upgrade ]]

Legend:
Removed from v.2112  
changed lines
  Added in v.2180