737 |
[ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist." |
[ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist." |
738 |
|
|
739 |
# remove virtuals only if no other exist |
# remove virtuals only if no other exist |
740 |
if [[ $(count_installed_pkgs --pcat ${pcat} --pname ${pname}) -le 1 ]] |
if [[ $(count_installed_pkgs --pcat=${pcat} --pname=${pname}) -le 1 ]] |
741 |
then |
then |
742 |
# first unregister virtuals |
# first unregister virtuals |
743 |
provide="$(get_value_from_magefile PROVIDE ${magefile})" |
provide="$(get_value_from_magefile PROVIDE ${magefile})" |
766 |
local i |
local i |
767 |
|
|
768 |
# very basic getops |
# very basic getops |
769 |
for i in $* |
for i in $@ |
770 |
do |
do |
771 |
case $1 in |
case ${i} in |
772 |
--pcat|-c) shift; pcat="$1" ;; |
--pcat*) pcat="${i#*=}" ;; |
773 |
--pname|-n) shift; pname="$1" ;; |
--pname*) pname="${i#*=}" ;; |
774 |
esac |
esac |
|
shift |
|
775 |
done |
done |
776 |
|
|
777 |
# sanity checks; abort if not given |
# sanity checks; abort if not given |