1 |
#!/usr/bin/perl |
2 |
# |
3 |
# |
4 |
|
5 |
use strict; |
6 |
use MGATools::rpmsrate qw(cleanrpmsrate); |
7 |
|
8 |
$ARGV[0] =~ /-o/ and shift @ARGV and my $rpmsrate = shift; |
9 |
|
10 |
$ARGV[1] or print "\nUsage: |
11 |
clean-rpmsrate [options] <rpmsrate file> <RPMs dir 1> <RPMs dir 2> ... <RPMs dir n> |
12 |
|
13 |
options: |
14 |
-o file: output file\n\n" and exit; |
15 |
|
16 |
my %rpm; |
17 |
my $rpmsrate_base = shift @ARGV; |
18 |
foreach my $d (@ARGV) { $rpm{$d} = [ map { s/$d\/?(.*)\.rpm$/$1/; $_ } glob "$d/*.rpm" ] }; |
19 |
cleanrpmsrate($rpmsrate_base,$rpmsrate,0, \%rpm); |