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