def generate_clauses(repo)
      package_filenames = []

      self.package_rules.each do |rule|
        package_filenames.concat(query_rpms(repo, rule))
      end
      if self.original_packages
        package_filenames.concat(repo.packages_without_errata.map(&:filename))
      end

      { 'filename' => { "$in" => package_filenames } } unless package_filenames.empty?
    end
def generate_clauses(repo)
      package_filenames = []

      self.package_rules.each do |rule|
        package_filenames.concat(query_rpms(repo, rule))
      end
      if self.original_packages
        package_filenames.concat(repo.packages_without_errata.map(&:filename))
      end

      { 'filename' => { "$in" => package_filenames } } unless package_filenames.empty?
    end
Returns a set of Pulp/MongoDB conditions to filter out packages in the
 repo repository that match parameters

 @param repo [Repository] a repository containing packages to filter
 @return [Array] an array of hashes with MongoDB conditions