r2637 - in people/goneri/SvnBuildStat-WWW: ! dirs' list truncated !

Gonéri Le Bouder goneri-guest at alioth.debian.org
Mon May 7 15:31:16 UTC 2007


Author: goneri-guest
Date: 2007-05-07 15:31:15 +0000 (Mon, 07 May 2007)
New Revision: 2637

Modified:
   people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Packages.pm
   people/goneri/SvnBuildStat-WWW/root/src/packages/info.tt2
   people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-db.pl
Log:
import some changes I did against the way 'tobuild' packages are found

Modified: people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Packages.pm
===================================================================
--- people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Packages.pm	2007-05-07 14:46:15 UTC (rev 2636)
+++ people/goneri/SvnBuildStat-WWW/lib/SvnBuildStat/WWW/Controller/Packages.pm	2007-05-07 15:31:15 UTC (rev 2637)
@@ -80,7 +80,7 @@
     my $piupartsisok;
     if ($build) {
       $buildisok = 1 if $build->buildisok;
-      $needbuild = 0 if (($build->rev eq $package->rev) && $build->buildisok);
+      $needbuild = 0 if $build->rev >= $package->rev;
       $piupartsisok = 1 if $build->piupartsisok;
       $lintianerrcount = $c->model('SvnBuildStat::WWW::Model::DB::BuildLintian')->search (
 	{build_id => $build->id})->count;
@@ -173,15 +173,16 @@
 my $build_rs = $c->model('SvnBuildStat::WWW::Model::DB::Build')->search({package_id => $package->id, isbuildinprogress => 'false'},{order_by => "id DESC"});
 my $cpt;
 while (($cpt++ < 10) && (my $build = $build_rs->next)) {
-my $failedstep = "build";
+my $failedstep;
 if (!$build->buildisok) {
-if ($build->checkoutisok) {
-  $failedstep = "check out";
-
-} if ($build->downloadisok) {
-  $failedstep = "download";
+	if (!$build->checkoutisok) {
+		$failedstep = "check out";
+	} elsif (!$build->downloadisok) {
+		$failedstep = "download";
+	} else {
+		$failedstep = "build";
+	}
 }
-  }
 
   push @{$c->stash->{builds}}, {
     id => $build->id,
@@ -212,7 +213,7 @@
   my $ret;
 
   if (!(defined ($arch) && $arch && $arch =~ /$archs/)) {
-    $c->response->body("missigin or invalid arch"); # Doesn't work :)
+    $c->response->body("missigin or invalid arch"); # Seems to create an error 
     return;
   }
 
@@ -226,11 +227,11 @@
 
     next unless $package->istarballpresent;
     # Build needed?
-    next unless ($c->model('SvnBuildStat::WWW::Model::DB::Build')->search ({
+    next if ($c->model('SvnBuildStat::WWW::Model::DB::Build')->search ({
 	  package_id => $package->id,
-	  rev => $package->rev,
+	  rev => { '>=', $package->rev }, # Work around because some old svn revision
 	  arch_id => $archobj->id
-	})->count == 0);
+	})->count > 0);
     my $name = $package->name;
     my $tarballuri = $package->tarballuri;
 
@@ -241,8 +242,38 @@
     my $tarball = mkTarballFromPackage(\$package);
 
     $resp = "$name;$tarballuri;$tarball;$uri";
-    last unless $cpt--; # the poor man randomizer
+    last if $cpt--<0; # the poor man randomizer
   }
+
+  # TODO improve this (buggy) part.
+  $package_rs = $c->model('SvnBuildStat::WWW::Model::DB::Package')->search ({istarballpresent => 'true'});
+  return unless $package_rs->count;
+
+  $cpt = int rand (10);
+  while (my $package = $package_rs->next) {
+
+   next unless $package->istarballpresent;
+    # Build needed?
+    next if ($c->model('SvnBuildStat::WWW::Model::DB::Build')->search ({
+	  package_id => $package->id,
+	  rev => { '>=', $package->rev }, # Work around because some old svn revision
+	  arch_id => $archobj->id,
+	  buildisok => 'true' 
+	})->count > 0);
+    my $name = $package->name;
+    my $tarballuri = $package->tarballuri;
+
+    $tarballuri =~ s/\@PACKAGE@/$package->name/;
+    $tarballuri =~ s/\@TARBALL@/$package->svndebrelease/;
+
+    my $uri = $package->uri;
+    my $tarball = mkTarballFromPackage(\$package);
+
+    $resp = "$name;$tarballuri;$tarball;$uri";
+    last if $cpt--<0; # the poor man randomizer
+  }
+
+
   $c->response->body($resp);
 }
 =head1 AUTHOR

Modified: people/goneri/SvnBuildStat-WWW/root/src/packages/info.tt2
===================================================================
--- people/goneri/SvnBuildStat-WWW/root/src/packages/info.tt2	2007-05-07 14:46:15 UTC (rev 2636)
+++ people/goneri/SvnBuildStat-WWW/root/src/packages/info.tt2	2007-05-07 15:31:15 UTC (rev 2637)
@@ -64,9 +64,13 @@
       [% IF build.buildisok %]
       <a href="[% Catalyst.uri_for('/logs/build/') _ build.id %]">Success</a>
       [% ELSE %]
+      [% IF build.failedstep == "build" %]
+      <a href="[% Catalyst.uri_for('/logs/build/') _ build.id %]">Build failed</a>
+      [% ELSE %] 
       failed during the "[% build.failedstep %]"
 
       [% END %]
+      [% END %]
 
     </td>
     <td>

Modified: people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-db.pl
===================================================================
--- people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-db.pl	2007-05-07 14:46:15 UTC (rev 2636)
+++ people/goneri/SvnBuildStat-WWW/script/svnbuildstat_update-db.pl	2007-05-07 15:31:15 UTC (rev 2637)
@@ -1,4 +1,14 @@
 #!/usr/bin/perl -w
+#
+# uscan --package gnome-bluetooth --dehs --upstream-version 0.8.0 --watchfile watch 
+#<dehs>
+#<package>gnome-bluetooth</package>
+#<debian-uversion>0.8.0</debian-uversion>
+#<debian-mangled-uversion>0.8.0</debian-mangled-uversion>
+#<upstream-version>0.8.0</upstream-version>
+#<upstream-url>http://ftp.gnome.org/pub/gnome/sources/gnome-bluetooth/0.8/gnome-bluetooth-0.8.0.tar.gz</upstream-url>
+#<status>up to date</status>
+#</dehs>
 
 use strict;
 




More information about the Pkg-games-commits mailing list