From 3a74a104aa483d15648807dad02c9082466e4e55 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 25 Jan 2010 11:16:25 +0100 Subject: [PATCH] Update sourceforge download tool --- docs/tools/sf2bacula_downloads.pl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/tools/sf2bacula_downloads.pl b/docs/tools/sf2bacula_downloads.pl index 4a9a6136..e40e5d0a 100755 --- a/docs/tools/sf2bacula_downloads.pl +++ b/docs/tools/sf2bacula_downloads.pl @@ -24,11 +24,11 @@ You can also use a previous output =cut # bacula|depkgs | depkgs-qt -my $version = '3.0.3'; +my $version = '5.0.0'; if ($ARGV[0] =~ /^[\d\.]+$/) { $version = shift(@ARGV); } -my $depkgs_version = '18Dec09|28Jul09|3.0.3a'; +my $depkgs_version = '18Dec09|28Jul09'; my $base = "http://bacula.svn.sourceforge.net/viewvc/bacula/tags/Release-$version/bacula"; my $notes = "$base/ReleaseNotes"; @@ -51,6 +51,7 @@ while (my $l = ) { # cat vers file if ($l =~ m!href="(/projects/bacula/files/([^/]+)/([^/]+)/([^/]+)/download)"!) { + print STDERR "$4\n"; $cur = { dl => $1, cat => $2, @@ -64,16 +65,18 @@ while (my $l = ) $cur->{size} = $1; do { $l = ; - if ($l =~ m!(.*?)!) { + if ($l =~ m!(\d{4}-\d{2}-\d{2})!) { $cur->{date} = $1; + print STDERR " date: $1\n"; } - } while (!$cur->{date}); + } while (!$cur->{date} and !eof(FP)); do { $l = ; - if ($l =~ m!(.*?)!) { + if ($l =~ m!([\d,]+)!) { $cur->{downloads} = $1; + print STDERR " downloads: $1\n"; } - } while (!$cur->{downloads}); + } while (!exists $cur->{downloads} and !eof(FP)); # once we have a full $cur element, we can store it @@ -140,8 +143,8 @@ sub print_cat $elt->{downloads} "; + if ($row eq 'odd') { $row = 'even'; } else { $row = 'odd'; } } - if ($row eq 'odd') { $row = 'even'; } else { $row = 'odd'; } } print ' -- 2.39.5