#!/bin/bash

E1=E
E2=("UNINSTALL RPMS (rpm)")

function uninstall_command {

    for RPM in $CHOICES ; do

	echo -e "Removing ${RPM}...\n"

	if rpm -e ${RPM}; then

	    echo -e "Removal of ${RPM} succeeded.\n"

	else

	    echo -e "\nRemoval of ${RPM} failed.\n"

	fi

    done

}

function uninstall_now {

    EXEC_GEOM="585x200"
    exec_command "uninstall_command"
    unset EXEC_GEOM

}

function uninstall_rpms {

    sed -e "s|^.*|& RPM off|" < ${CONSTATEDIR}/rpmsinstalled > /tmp/rpmslist-$$

    CHK="SELECT RPMS"

    INPUT=uninstall_now

    DEF=(`cat /tmp/rpmslist-$$`)

    checkbox "${DEF[@]}"

    rm -f /tmp/rpmslist-$$

}
