summaryrefslogtreecommitdiffstats
path: root/clean-rpmsrate
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-05-01 21:07:18 +0000
committerNicolas Vigier <boklm@mageia.org>2011-05-01 21:07:18 +0000
commit5b465daebbeef4942f1ed9bd410cdbdecc7e4504 (patch)
tree98adf736d0a89fd28e101cf41501c4dfb2c60c4a /clean-rpmsrate
downloadmgatools-5b465daebbeef4942f1ed9bd410cdbdecc7e4504.tar
mgatools-5b465daebbeef4942f1ed9bd410cdbdecc7e4504.tar.gz
mgatools-5b465daebbeef4942f1ed9bd410cdbdecc7e4504.tar.bz2
mgatools-5b465daebbeef4942f1ed9bd410cdbdecc7e4504.tar.xz
mgatools-5b465daebbeef4942f1ed9bd410cdbdecc7e4504.zip
add cleanrpmsrate
Diffstat (limited to 'clean-rpmsrate')
-rwxr-xr-xclean-rpmsrate19
1 files changed, 19 insertions, 0 deletions
diff --git a/clean-rpmsrate b/clean-rpmsrate
new file mode 100755
index 0000000..c8b11d4
--- /dev/null
+++ b/clean-rpmsrate
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+#
+#
+
+use strict;
+use MGATools::rpmsrate qw(cleanrpmsrate);
+
+$ARGV[0] =~ /-o/ and shift @ARGV and my $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);