support negative by-package filtering

Shamelessly duplicates the code used to make a positive match.
Refactoring will be needed.