Blog karp0tt

GNU/Linux configurations

Trouble with programs after upgrading some packages?

I’m syncing my portage tree every saturday morning at 04:19 AM and after every sync, there are a ton of packages in need of an upgrade.
While these packages itself compile fine, there could be a problem with already installed packages and the new versions.

Because I would have to run a few programs, I wrote a little bash script to automate this whole process.
It’s just like with every script/program/etc you download:
READ IT BEFORE USING IT

#!/bin/bash
# check for permissions
if [[ $UID -ne "0" ]] ; then
echo "Switch user to root"
echo "Exiting"
exit 1
fi

if [[ -e "/usr/sbin/etc-update" ]] ; then
# check for configuration files
etc-update
fi

if [[ -e "/usr/bin/eclean" ]] ; then
# clean up distfiles-directory
eclean -d distfiles
fi

if [[ -e "/usr/bin/eix-test-obsolete" ]] ; then
#obsolete entries in /etc/portage
eix-test-obsolete b
fi

if [[ -e "/usr/bin/revdep-rebuild" ]] ; then
# look for broken packages
revdep-rebuild -i
fi

if [[ -e "/usr/bin/ghc-pkg" ]] ; then
# check for broken haskell packages
keks=`ghc-pkg check --simple-output`
if [[ -n $keks ]] ; then
echo -e ""
echo -e "The following haskell-packages need to be recompiled:"
echo -e "$keks"
fi
fi

if [[ -e "/usr/sbin/haskell-updater" ]] ; then
# check for haskell packages compiled with an older version of ghc
haskell-updater -p
fi

if [[ -e "/usr/bin/lsof" ]] ; then
# which processes need to be restarted
echo -e ""
echo -e "Processes that need to be restarted"
lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u
fi

Advertisements

Written by body0r

February 13, 2010 at 12:00 pm

Posted in GNU/Linux

Tagged with , , ,

%d bloggers like this: