]> git.sur5r.net Git - bacula/docs/commitdiff
Merge branch 'master' of ssh://bacula.git.sourceforge.net/gitroot/bacula/docs
authorKern Sibbald <kern@sibbald.com>
Wed, 3 Feb 2010 09:24:16 +0000 (10:24 +0100)
committerKern Sibbald <kern@sibbald.com>
Wed, 3 Feb 2010 09:24:16 +0000 (10:24 +0100)
docs/tools/sf2bacula_downloads.pl

index 4a9a6136669368e83bb1325062958481b0d955de..e40e5d0abb5a4db00438366afbb373cc9497adec 100755 (executable)
@@ -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 = <FP>)
 {
     #                                         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 = <FP>)
         $cur->{size} = $1;
         do {
             $l = <FP>;
-            if ($l =~ m!<td>(.*?)</td>!) {
+            if ($l =~ m!<td>(\d{4}-\d{2}-\d{2})</td>!) {
                 $cur->{date} = $1;
+                print STDERR "  date: $1\n";
             }
-        } while (!$cur->{date});
+        } while (!$cur->{date} and !eof(FP));
         do {
             $l = <FP>;
-            if ($l =~ m!<td>(.*?)</td>!) {
+            if ($l =~ m!<td>([\d,]+)</td>!) {
                 $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
  <td align=\"center\">$elt->{downloads}</td>
 </tr>
 ";
+            if ($row eq 'odd') { $row = 'even'; } else { $row = 'odd'; }
         }
-        if ($row eq 'odd') { $row = 'even'; } else { $row = 'odd'; }
     }
     print '</table>
      </td>