]> git.sur5r.net Git - bacula/docs/blobdiff - docs/tools/sf2bacula_downloads.pl
Update sparse documentation
[bacula/docs] / docs / tools / sf2bacula_downloads.pl
index 4a9a6136669368e83bb1325062958481b0d955de..72d7bdd9d334c7c2c0f493178c516fffe0cd7066 100755 (executable)
@@ -24,13 +24,13 @@ You can also use a previous output
 =cut
 
 #             bacula|depkgs | depkgs-qt
-my $version = '3.0.3';
-if ($ARGV[0] =~ /^[\d\.]+$/) {
+my $version = '5.0.1';
+if ($ARGV[0] and $ARGV[0] =~ /^[\d\.]+$/) {
     $version = shift(@ARGV);
 }
-my $depkgs_version  = '18Dec09|28Jul09|3.0.3a';
+my $depkgs_version  = '18Dec09|28Jul09|15May10';
 
-my $base = "http://bacula.svn.sourceforge.net/viewvc/bacula/tags/Release-$version/bacula";
+my $base = "http://bacula.git.sourceforge.net/git/gitweb.cgi?p=bacula/bacula;a=blob_plain;hb=Release-$version;f=bacula";
 my $notes = "$base/ReleaseNotes";
 my $chglog = "$base/ChangeLog";
 my %cats;
@@ -50,7 +50,8 @@ open(FP, $file);
 while (my $l = <FP>)
 {
     #                                         cat   vers  file
-    if ($l =~ m!href="(/projects/bacula/files/([^/]+)/([^/]+)/([^/]+)/download)"!) {
+    if ($l =~ m!href="(?:http://sourceforge.net)(/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
@@ -88,6 +91,8 @@ close(FP);
 
 print '
 <? require_once("inc/header.php"); ?>
+<? // This page is generated by sf2bacula_downloads.pl in eric s crontab, 
+   // no need to update it by hand ?>
 <table>
   <tr>
    <td class="contentTopic">
@@ -140,8 +145,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>
@@ -159,5 +164,6 @@ print_cat('depkgs-qt');
 
 print '
 </table>
+<small>', scalar(localtime), '</small>
 <? require_once("inc/footer.php"); ?>
 ';