summaryrefslogtreecommitdiffstats
path: root/clean-rpmsrate
blob: f9b7777ac907112a854ceef818254a17f40a6e66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl
#
# 

use strict;
use MGATools::rpmsrate qw(cleanrpmsrate);

my $rpmsrate;
$ARGV[0] =~ /-o/ and shift @ARGV and $rpmsrate = shift;

$ARGV[1] or print "\nUsage:
	clean-rpmsrate [options] <rpmsrate file> <RPMs dir 1> <RPMs dir 2> ... <RPMs dir n>

	options:
		-o file: output file\n\n" and exit();

my %rpm;
my $rpmsrate_base = shift @ARGV;
foreach my $d (@ARGV) {
    $rpm{$d} = [ map { s!$d/?(.*)\.rpm$!$1!; $_ } glob "$d/*.rpm" ];
}
cleanrpmsrate($rpmsrate_base, $rpmsrate, 0, \%rpm);