def METHOD_NAME(self, rpms, pattern):
    if self.ts is None:
        if self.prefix is None:
            raise RuntimeError('Must specify installation root for droprpm/keeprpm')
        self.ts = rpm.TransactionSet(self.prefix)
    mi = self.ts.dbMatch()
    mi.pattern('name', rpm.RPMMIRE_GLOB, pattern)
    not_found = True
    for hdr in mi:
        not_found = False
        rpms.add(hdr['name'])
    if self.verbose and not_found:
        print("%s package not found" % pattern)