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 2111 by niro, Wed May 11 22:17:14 2011 UTC revision 2112 by niro, Thu May 12 18:51:46 2011 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # $Id$  # $Id$
3    
4    read_value()
5    {
6     local file=$1
7     local var=$2
8     local value
9    
10     [[ ! -e ${file} ]] && return 1
11    
12     value=$(source ${file}; echo $(eval echo \${${var}}))
13     echo "${value}"
14     return 0
15    }
16    
17  MAGERC="/etc/mage.rc"  MAGERC="/etc/mage.rc"
18  MAGEPROFILE="alx-060"  MAGEPROFILE="alx-060"
19  NEW_MAGE_DISTRIBUTION="unstable"  NEW_MAGE_DISTRIBUTION="unstable"
# Line 53  then Line 66  then
66    
67   # enable run of orphaned files check   # enable run of orphaned files check
68   touch /.orphaned   touch /.orphaned
69    
70     # tell that we're running an dist-upgrade
71     touch /.dist-upgrade
72  fi  fi
73    
74  # install new toolchain if not exist  # install new toolchain if not exist
# Line 66  then Line 82  then
82    
83   # enable run of orphaned files check   # enable run of orphaned files check
84   touch /.orphaned   touch /.orphaned
85    
86     # tell that we're running an dist-upgrade
87     touch /.dist-upgrade
88  fi  fi
89    
90  # install new basesystem  # install new basesystem
# Line 81  then Line 100  then
100    
101   # enable run of orphaned files check   # enable run of orphaned files check
102   touch /.orphaned   touch /.orphaned
103    
104     # tell that we're running an dist-upgrade
105     touch /.dist-upgrade
106  fi  fi
107    
108  # install remserial, if the plugin was enabled  # install remserial, if the plugin was enabled
# Line 92  then Line 114  then
114   touch /.orphaned   touch /.orphaned
115  fi  fi
116    
117    # etc-update
118    #etc-update
119    
120  # clean mage cache  # clean mage cache
121  mage clean  mage clean
122    
 # # uninstall all other deprecated -alx packages  
 # DEPRECATED="bzip2  
 # gzip  
 # perl  
 # glib1  
 # openssl  
 # popt  
 # libungif  
 # samba  
 # dhcpcd  
 # openssh  
 # wget  
 # cups  
 # ddcxinfo-knoppix  
 # debianutils  
 # grep  
 # inetutils  
 # kbd  
 # less  
 # net-tools  
 # pciutils  
 # procps  
 # psmisc  
 # sed  
 # shadow  
 # sysvinit  
 # tar  
 # which  
 # gtk1+  
 # ttmkfdir  
 # xdialog"  
 #  
 # echo "Searching for deprecated packages ..."  
 # for i in ${DEPRECATED}  
 # do  
 # if [[ ! -z $(magequery -n ${i}-alx) ]]  
 # then  
 # echo "Removing deprecated mage-target '${i}-alx'"  
 # mage uninstall ${i}-alx  
 # fi  
 # done  
   
123  echo "Searching for deprecated packages ..."  echo "Searching for deprecated packages ..."
124  for i in $(magequery -i | grep -- -alx | sed 's:.*/\(.*\)-.*-.*:\1:')  for i in $(magequery -i | grep -- -alx | sed 's:.*/\(.*\)-.*-.*:\1:')
125  do  do
# Line 159  then Line 142  then
142   rm -f /.orphaned   rm -f /.orphaned
143  fi  fi
144    
145  # force a reboot at this point here  if [[ -f /.dist-upgrade ]]
146  reboot -f  then
147     # array of wireless opts
148     WIRELESS_OPTS=( WIRELESS_BITRATE WIRELESS_CHANNEL WIRELESS_ESSID WIRELESS_FREQUENCY WIRELESS_MODE WIRELESS_NICK WIRELESS_AUTH_MODE WIRELESS_KEY_LENGTH WIRELESS_KEY WIRELESS_KEY_ASCII WIRELESS_WPA_DRIVER )
149    
150     # fixing current dhcp network settings
151     #for i in $(grep -irl NETWORKING=.*dhcp.* /etc/conf.d/net.*)
152     for i in $(grep -irl DHCP_PROG=.*dhcpcd.* /etc/conf.d/net.*)
153     do
154     case ${i} in
155     */net.sample) continue ;;
156     */net.routes) continue ;;
157     esac
158    
159     echo "fixing current dhcp network settings in '${i}'"
160     mv ${i}{,.orig}
161     onboot="$(read_value ${i}.orig ONBOOT)"
162     echo "ONBOOT=\"${onboot}\"" > ${i}
163     echo 'NETWORKING="dhcp"' >> ${i}
164     # check wireless extensions
165     for opt in ${WIRELESS_OPTS[*]}
166     do
167     value="$(read_value ${i}.orig ${opt})"
168     if [[ ! -z ${value} ]]
169     then
170     echo "${opt}=\"${value}\"" >> ${i}
171     fi
172     done
173     rm -f ${i}.orig
174     done
175    fi
176    
177    if [[ -f /.dist-upgrade ]]
178    then
179     rm -f /.dist-upgrade
180     # force a reboot at this point here
181     reboot -f
182    fi

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