From 710dd41ca899be43da8e700a14ef598ad15b2055 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 23 Nov 2009 17:26:46 +0100 Subject: [PATCH] update sourceforge to bacula.org download script --- docs/tools/sf2bacula_downloads.pl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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); -- 2.39.2