diff options
Diffstat (limited to 'src-rpm-list')
-rwxr-xr-x | src-rpm-list | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/src-rpm-list b/src-rpm-list index c5b4077..aa87a82 100755 --- a/src-rpm-list +++ b/src-rpm-list @@ -5,34 +5,16 @@ 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; - } - ); -} +my $srpmsdir = $ARGV[0] or exit 1; -exit 1 unless @ARGV == 1; -my $srpmsdir = $ARGV[0]; -my @medias = qw/core nonfree tainted/; -my @submedias = qw/release updates updates_testing/; +my $urpm = URPM->new; -my %res; -for my $media (@medias) { - for my $submedia (@submedias) { - list_pkgnames("$srpmsdir/$media/$submedia/media_info/synthesis.hdlist.cz", - \%res); - } +foreach (glob("$srpmsdir/*/*/media_info/synthesis.hdlist.cz")) { + $urpm->parse_synthesis($_); } -for my $pkg (sort keys %res) { - print $pkg, "\n"; -} +my %res; +$urpm->traverse(sub { $res{$_[0]->name} = 1 }); +print join("\n", sort(keys %res), '') |