From aea618dbb05dfec4574d726cdb8779569456a050 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Thu, 24 May 2012 16:23:07 +0000 Subject: use more simple script provided by tv http://www.mageia.org/pipermail/mageia-dev/2012-May/015807.html --- src-rpm-list | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'src-rpm-list') 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), '') -- cgit v1.2.1