aboutsummaryrefslogtreecommitdiffstats
path: root/src-rpm-list
blob: c5b4077d6bc7d287f90d6519963e466a4e573437 (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
37
38
#!/usr/bin/perl -w

# This script takes a root SRPMS directory as argument, and print the
# list of package names on stdout

use strict;
use URPM;
use Data::Dump qw/dump/;

sub list_pkgnames
{
    my ($synthesis_file, $res) = @_;
    my $urpm = new URPM;
    $urpm->parse_synthesis($synthesis_file);
    $urpm->traverse(
	sub {
	    $res->{$_[0]->name()} = 1;
	}
    );
}

exit 1 unless @ARGV == 1;
my $srpmsdir = $ARGV[0];
my @medias = qw/core nonfree tainted/;
my @submedias = qw/release updates updates_testing/;

my %res;
for my $media (@medias) {
    for my $submedia (@submedias) {
	list_pkgnames("$srpmsdir/$media/$submedia/media_info/synthesis.hdlist.cz",
	    \%res);
    }
}

for my $pkg (sort keys %res) {
    print $pkg, "\n";
}