home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
tusportal.tus.k12.pa.us
/
tusportal.tus.k12.pa.us.tar
/
tusportal.tus.k12.pa.us
/
Wyse
/
latest-image.raw
/
0.img
/
usr
/
sbin
/
addon-remove
< prev
next >
Wrap
Text File
|
2010-09-30
|
722b
|
35 lines
#!/bin/bash
function usage()
{
echo "Usage: $0 <addon.rpm>" >/dev/stderr
exit 1
}
ADDON=$1
if test -z $ADDON; then
echo "No addon specified" >/dev/stderr
usage
fi
if ! rpm -q $ADDON >/dev/null 2>&1; then
echo "$ADDON is not installed" >/dev/stderr
usage
fi
ADDON_NAME=`rpm -q --queryformat "%{NAME}\n" $ADDON`
installedPackages=`rpm -qa`
for pack in $installedPackages; do
requires=`rpm -q --requires $pack | grep ADDON`
for req in $requires; do
reqName=`echo $req | cut -d: -f2`
if test "$reqName" = "$ADDON_NAME"; then
echo "Cannot remove '$ADDON': $reqName depends on it." >/dev/stderr
exit 1
fi
done
done
rpm -e --nodeps $ADDON