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