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

use strict;
use MGATools::rpmsrate;

my $output_file;
$ARGV[0] =~ /-o/ and do { shift @ARGV; $output_file = 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 $rpmsrate_raw_file = shift @ARGV;

my %rpm;
foreach my $dir (@ARGV) {
    chdir($dir);
    $rpm{$dir} = [ map { s!\.rpm$!!; $_ } glob "*.rpm" ];
}
chdir($ENV{PWD}); # in case -o referes to a relative path

cleanrpmsrate($rpmsrate_raw_file, $output_file, \%rpm);