Permalink
Browse files

Made it all a bit more configurable.

  • Loading branch information...
1 parent bd16b94 commit b66b344847f1ba8da5a4b1063c0ea722dad8de6d @davorg committed Jul 11, 2010
Showing with 20 additions and 3 deletions.
  1. +20 −3 fedora_rpms
View
@@ -3,9 +3,15 @@
use strict;
use warnings;
+use Getopt::Std;
use Parse::CPAN::Packages;
-my $packfile = '/home/dave/cpan/modules/02packages.details.txt.gz';
+my %opts;
+
+getopts('p:d:', \%opts);
+
+my $packfile = $opts{p}
+ ||'/home/dave/cpan/modules/02packages.details.txt.gz';
unless (-f $packfile) {
require LWP::Simple;
@@ -18,8 +24,19 @@ unless (-f $packfile) {
my $cmd = q(repoquery --repoid=REPO ) .
q(--qf="%{name},%{version},%{vendor},%{repoid}" 'perl-*');
-my @repos = qw(fedora updates magnum rpmfusion-free rpmfusion-nonfree
- rpmfusion-free-updates rpmfusion-nonfree-updates livna);
+my %repos = (
+ fedora => [ qw(fedora updates magnum rpmfusion-free
+ rpmfusion-nonfree rpmfusion-free-updates
+ rpmfusion-nonfree-updates livna) ],
+ centos => [ qw(base updates epel magnum rpmforge) ],
+ );
+
+my $dist = $opts{d} || 'fedora';
+
+die "$dist is an unknown distribution\n" unless exists $repos{$dist};
+
+my @repos = @{ $repos{$dist} };
+
my @cols = qw(name version vendor repo);
my $rpm;

0 comments on commit b66b344

Please sign in to comment.