From: Eric Bollengier Date: Mon, 23 Nov 2009 16:26:46 +0000 (+0100) Subject: update sourceforge to bacula.org download script X-Git-Tag: Release-5.0.0~39^2~1 X-Git-Url: https://git.sur5r.net/?p=bacula%2Fdocs;a=commitdiff_plain;h=710dd41ca899be43da8e700a14ef598ad15b2055 update sourceforge to bacula.org download script --- diff --git a/docs/tools/sf2bacula_downloads.pl b/docs/tools/sf2bacula_downloads.pl index 23e2dc17..57a78a0a 100755 --- a/docs/tools/sf2bacula_downloads.pl +++ b/docs/tools/sf2bacula_downloads.pl @@ -51,11 +51,6 @@ while (my $l = ) { # cat vers file if ($l =~ m!href="(/projects/bacula/files/(.+?)/(.+?)/(.+?)/download)"!) { - if ($cur && $cur->{date} && !exists $seen{$cur->{file}}) { - push @{$cats{$cur->{cat}}}, $cur; - $seen{$cur->{file}} = 1; - } - $cur = { dl => $1, cat => $2, @@ -65,7 +60,7 @@ while (my $l = ) } # the size and the date are just after - if ($l =~ m!([\d\.]+ [KMG]B)!) { + if ($cur && $l =~ m!([\d\.]+ [KMG]B)!) { $cur->{size} = $1; do { $l = ; @@ -73,6 +68,13 @@ while (my $l = ) $cur->{date} = $1; } } while (!$cur->{date}); + + # once we have a full $cur element, we can store it + if (!exists $seen{$cur->{file}}) { + push @{$cats{$cur->{cat}}}, $cur; + $seen{$cur->{file}} = 1; + $cur = undef; + } } } close(FP);