perl-modules: Added Monitoring-Plugin module
[omd.git] / packages / perl-modules / update_modules
blob64744cf9ef4edf6ea241d5807381da1987c3845c
1 #!/usr/bin/perl
3 use warnings;
4 use strict;
5 use Data::Dumper;
6 use lib 'lib';
7 use BuildHelper;
9 my @modules;
10 chdir('src') or die("cannot change into src dir: $!");
11 if(scalar @ARGV == 0) {
12 @modules = glob('*');
13 } else {
14 @modules = @ARGV;
17 for my $file (@modules) {
18 printf "%-55s", $file;
20 if($file =~ m/^MongoDB/mx) {
21 print "skipped, broken since 0.46 on redhat 5.8\n";
22 next;
24 if($file =~ m/^ExtUtils\-Depends\-/mx) {
25 print "skipped, cpan points to wrong module\n";
26 next;
28 if($file =~ m/^File-Temp\-/mx) {
29 print "skipped, broken since 0.22\n";
30 next;
33 my($modname,$modversion) = BuildHelper::file_to_module($file);
34 my $urlpath = BuildHelper::get_url_for_module($modname);
35 my $tarball = $urlpath;
36 $tarball =~ s/^.*\///g;
37 $tarball =~ s/%2B/+/g;
38 $tarball =~ s/0\.29a\.tar\.gz/0.29.tar.gz/g;
39 my($newname,$newversion) = BuildHelper::file_to_module($tarball);
41 if(-f $tarball) {
42 print "no updates\n";
43 } else {
44 print "updated: $newversion\n";
45 my $downloaded = BuildHelper::download_module($modname, 0, 1, 1);
46 if(scalar @{$downloaded} != 1) {
47 die("download failed: ".Dumper($downloaded));
49 my $new = shift @{$downloaded};
50 `sed -i ../Makefile -e 's|$file|$new|'`;
51 `rm $file`;