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 2081 by niro, Wed May 11 22:17:14 2011 UTC revision 2117 by niro, Thu May 12 20:43:28 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 152  do Line 135  do
135   mage uninstall ${i}   mage uninstall ${i}
136  done  done
137    
138    if [[ -f /.dist-upgrade ]]
139    then
140     # array of wireless opts
141     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 )
142    
143     # fixing current dhcp network settings
144     #for i in $(grep -irl NETWORKING=.*dhcp.* /etc/conf.d/net.*)
145     for i in $(grep -irl DHCP_PROG=.*dhcpcd.* /etc/conf.d/net.*)
146     do
147     case ${i} in
148     */net.sample) continue ;;
149     */net.routes) continue ;;
150     esac
151    
152     echo "fixing current dhcp network settings in '${i}'"
153     mv ${i}{,.orig}
154     onboot="$(read_value ${i}.orig ONBOOT)"
155     echo "ONBOOT=\"${onboot}\"" > ${i}
156     echo 'NETWORKING="dhcp"' >> ${i}
157     # check wireless extensions
158     for opt in ${WIRELESS_OPTS[*]}
159     do
160     value="$(read_value ${i}.orig ${opt})"
161     if [[ ! -z ${value} ]]
162     then
163     echo "${opt}=\"${value}\"" >> ${i}
164     fi
165     done
166     rm -f ${i}.orig
167     done
168     # search modules files
169     for i in $(find /etc/modules.d -name net.\*)
170     do
171     install -d /etc/modprobe.d
172     mv ${i} /etc/modprobe.d/${i%.conf}.conf
173     done
174    fi
175    
176  if [[ -f /.orphaned ]]  if [[ -f /.orphaned ]]
177  then  then
178   echo "Searching for orphaned files and directories ..."   echo "Searching for orphaned files and directories ..."
# Line 159  then Line 180  then
180   rm -f /.orphaned   rm -f /.orphaned
181  fi  fi
182    
183  # force a reboot at this point here  if [[ -f /.dist-upgrade ]]
184  reboot -f  then
185     rm -f /.dist-upgrade
186     # force a reboot at this point here
187     reboot -f
188    fi

Legend:
Removed from v.2081  
changed lines
  Added in v.2117