#!/usr/bin/perl
BEGIN {
  unshift @INC,  ".";
}

use strict;
use warnings;

use BSSolv;

my $pool = BSSolv::pool->new();
my $repo = $pool->repofromfile("factory", "/home/marcus/factory.solv");
die("eek no repo") unless $repo;
$pool->createwhatprovides();
my @a_reqs = $pool->whatrequires('libc.so.6()(64bit)');
my %a_seen = map {$_ => 1} @a_reqs;
my @b_reqs = $pool->whatrequires('filesystem');
my @common = grep {$a_seen{$_}} @b_reqs;
for my $p (@common) {
  print $pool->pkg2name($p) . "\n";
}
