2004-09-08 09:02:30 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Linux deinstallation
|
|
|
|
# No parameter required, all RPMs listed in $HOME/.RPM_OFFICEDATABASE
|
|
|
|
# will be removed.
|
|
|
|
|
2005-01-21 04:34:46 -06:00
|
|
|
if [ $# -ne 1 ]
|
2004-09-08 09:02:30 -05:00
|
|
|
then
|
2005-01-21 04:34:46 -06:00
|
|
|
echo
|
|
|
|
echo "Usage:" $0 "<office-installation-dir>"
|
|
|
|
echo " <inst-destination-dir>: directory where the office to be removed is installed"
|
|
|
|
echo
|
2004-09-08 09:02:30 -05:00
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2006-12-19 11:33:12 -06:00
|
|
|
INSTALLDIR=$1
|
|
|
|
|
|
|
|
# Check for old style .RPM_OFFICEDATABASE first
|
|
|
|
if [ -d ${INSTALLDIR}/.RPM_OFFICEDATABASE ]; then
|
|
|
|
RPM_DB_PATH=${INSTALLDIR}/.RPM_OFFICEDATABASE
|
|
|
|
else
|
|
|
|
RPM_DB_PATH=${INSTALLDIR}/.RPM_DATABASE
|
|
|
|
fi
|
|
|
|
|
|
|
|
# the RPM_DB_PATH must be absolute
|
|
|
|
if [ ! "${RPM_DB_PATH:0:1}" = "/" ]; then
|
|
|
|
RPM_DB_PATH=`cd ${RPM_DB_PATH}; pwd`
|
|
|
|
fi
|
2005-01-21 04:34:46 -06:00
|
|
|
|
|
|
|
RPMLIST=`rpm --dbpath $RPM_DB_PATH --query --all`
|
2004-09-08 09:02:30 -05:00
|
|
|
|
|
|
|
# Output ...
|
|
|
|
clear
|
2004-12-16 03:49:47 -06:00
|
|
|
echo "#########################################"
|
|
|
|
echo "# Deinstallation of Office RPMs #"
|
|
|
|
echo "#########################################"
|
2004-09-08 09:02:30 -05:00
|
|
|
echo
|
|
|
|
echo "Path to the RPM database: " $RPM_DB_PATH
|
|
|
|
echo "RPMs to deinstall:"
|
2005-01-21 04:34:46 -06:00
|
|
|
echo "$RPMLIST"
|
2004-09-08 09:02:30 -05:00
|
|
|
echo "===================================================================="
|
|
|
|
echo
|
|
|
|
|
2005-01-21 04:34:46 -06:00
|
|
|
# Restore original bootstraprc
|
|
|
|
mv -f $1/program/bootstraprc.orig $1/program/bootstraprc
|
|
|
|
|
|
|
|
rpm --dbpath $RPM_DB_PATH --erase $RPMLIST || exit 2
|
|
|
|
|
2006-12-19 11:33:12 -06:00
|
|
|
echo "Removing RPM database ..."
|
2004-09-08 09:02:30 -05:00
|
|
|
rm -rf $RPM_DB_PATH
|
|
|
|
|
|
|
|
echo
|
2006-12-19 11:33:12 -06:00
|
|
|
echo "Deinstallation done."
|
2004-09-08 09:02:30 -05:00
|
|
|
|
2005-01-21 04:34:46 -06:00
|
|
|
exit 0
|