aboutsummaryrefslogtreecommitdiffstats
path: root/src-rpm-list
blob: e5a8bf95426552122e73af77e6e5035dd00d92de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/perl -w

# This script takes a root SRPMS directory as argument, and print the
# list of package names on stdout
# As second argument, it can optionally take a file containing a list
# of packages (as regexp) to skip

use strict;
use URPM;
use MDK::Common;

my $srpmsdir = $ARGV[0] or exit 1;
my $skipfile = $ARGV[1];

my $urpm = URPM->new;

foreach (glob("$srpmsdir/*/*/media_info/synthesis.hdlist.cz")) {
    $urpm->parse_synthesis($_);
}

my %res;
$urpm->traverse(sub { $res{$_[0]->name} = 1 });

my @skip = $skipfile ? chomp_(cat_($skipfile)) : ();
my @pkgs = grep {
              my $res = 1;
              foreach my $skipre (@skip) {
                  if ($_ =~ m/^$skipre$/) {
		      $res = 0;
		      last;
                  }
              }
	      $res;
           } (keys %res);

print join("\n", sort @pkgs, '')