cope with package resources declared elsewhere

This patch should make this code more resilient in the event that various package resources are declared in other manifests.