--- mage/branches/alx-0_6_0/profiles/alx-060/forced-uninstall 2011/05/11 22:17:14 2081 +++ mage/branches/alx-0_6_0/profiles/alx-060/forced-uninstall 2011/05/12 18:51:46 2112 @@ -1,6 +1,19 @@ #!/bin/bash # $Id$ +read_value() +{ + local file=$1 + local var=$2 + local value + + [[ ! -e ${file} ]] && return 1 + + value=$(source ${file}; echo $(eval echo \${${var}})) + echo "${value}" + return 0 +} + MAGERC="/etc/mage.rc" MAGEPROFILE="alx-060" NEW_MAGE_DISTRIBUTION="unstable" @@ -53,6 +66,9 @@ # enable run of orphaned files check touch /.orphaned + + # tell that we're running an dist-upgrade + touch /.dist-upgrade fi # install new toolchain if not exist @@ -66,6 +82,9 @@ # enable run of orphaned files check touch /.orphaned + + # tell that we're running an dist-upgrade + touch /.dist-upgrade fi # install new basesystem @@ -81,6 +100,9 @@ # enable run of orphaned files check touch /.orphaned + + # tell that we're running an dist-upgrade + touch /.dist-upgrade fi # install remserial, if the plugin was enabled @@ -92,51 +114,12 @@ touch /.orphaned fi +# etc-update +#etc-update + # clean mage cache mage clean -# # 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 - echo "Searching for deprecated packages ..." for i in $(magequery -i | grep -- -alx | sed 's:.*/\(.*\)-.*-.*:\1:') do @@ -159,5 +142,41 @@ rm -f /.orphaned fi -# force a reboot at this point here -reboot -f +if [[ -f /.dist-upgrade ]] +then + # array of wireless opts + 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 ) + + # fixing current dhcp network settings + #for i in $(grep -irl NETWORKING=.*dhcp.* /etc/conf.d/net.*) + for i in $(grep -irl DHCP_PROG=.*dhcpcd.* /etc/conf.d/net.*) + do + case ${i} in + */net.sample) continue ;; + */net.routes) continue ;; + esac + + echo "fixing current dhcp network settings in '${i}'" + mv ${i}{,.orig} + onboot="$(read_value ${i}.orig ONBOOT)" + echo "ONBOOT=\"${onboot}\"" > ${i} + echo 'NETWORKING="dhcp"' >> ${i} + # check wireless extensions + for opt in ${WIRELESS_OPTS[*]} + do + value="$(read_value ${i}.orig ${opt})" + if [[ ! -z ${value} ]] + then + echo "${opt}=\"${value}\"" >> ${i} + fi + done + rm -f ${i}.orig + done +fi + +if [[ -f /.dist-upgrade ]] +then + rm -f /.dist-upgrade + # force a reboot at this point here + reboot -f +fi