add more logic while processing EPKG_ENODB

freebsd/pkg/#765