761 |
[ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist." |
[ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist." |
762 |
|
|
763 |
# remove virtuals only if no other exist |
# remove virtuals only if no other exist |
764 |
if [[ $(count_installed_pkgs --pcat ${pcat} --pname ${pname}) -le 1 ]] |
if [[ $(count_installed_pkgs --pcat=${pcat} --pname=${pname}) -le 1 ]] |
765 |
then |
then |
766 |
# first unregister virtuals |
# first unregister virtuals |
767 |
provide="$(get_value_from_magefile PROVIDE ${magefile})" |
provide="$(get_value_from_magefile PROVIDE ${magefile})" |
790 |
local i |
local i |
791 |
|
|
792 |
# very basic getops |
# very basic getops |
793 |
for i in $* |
for i in $@ |
794 |
do |
do |
795 |
case $1 in |
case ${i} in |
796 |
--pcat|-c) shift; pcat="$1" ;; |
--pcat*) pcat="${i#*=}" ;; |
797 |
--pname|-n) shift; pname="$1" ;; |
--pname*) pname="${i#*=}" ;; |
798 |
esac |
esac |
|
shift |
|
799 |
done |
done |
800 |
|
|
801 |
# sanity checks; abort if not given |
# sanity checks; abort if not given |