diff options
author | Nicolas Vigier <boklm@mageia.org> | 2012-05-24 16:23:07 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2012-05-24 16:23:07 +0000 |
commit | aea618dbb05dfec4574d726cdb8779569456a050 (patch) | |
tree | 246e1c770b6ac4dd82c44fd254836acdc696c3e2 /src-rpm-list | |
parent | 73e9fe3957c8f010fab2260381811cd818afbb9c (diff) | |
download | release-aea618dbb05dfec4574d726cdb8779569456a050.tar release-aea618dbb05dfec4574d726cdb8779569456a050.tar.gz release-aea618dbb05dfec4574d726cdb8779569456a050.tar.bz2 release-aea618dbb05dfec4574d726cdb8779569456a050.tar.xz release-aea618dbb05dfec4574d726cdb8779569456a050.zip |
use more simple script provided by tv
http://www.mageia.org/pipermail/mageia-dev/2012-May/015807.html
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), '') |