[Collab-qa-commits] r515 - svnbuildstat/trunk/lib/SvnBuildStat/WWW/Controller

goneri-guest at alioth.debian.org goneri-guest at alioth.debian.org
Sun Nov 25 22:09:21 UTC 2007


Author: goneri-guest
Date: 2007-11-25 22:09:21 +0000 (Sun, 25 Nov 2007)
New Revision: 515

Modified:
   svnbuildstat/trunk/lib/SvnBuildStat/WWW/Controller/Packages.pm
Log:
tobuildv3 give an url to the dsc file and the package id so it will be more easy to deal will two packages with the same name

Modified: svnbuildstat/trunk/lib/SvnBuildStat/WWW/Controller/Packages.pm
===================================================================
--- svnbuildstat/trunk/lib/SvnBuildStat/WWW/Controller/Packages.pm	2007-11-25 20:52:49 UTC (rev 514)
+++ svnbuildstat/trunk/lib/SvnBuildStat/WWW/Controller/Packages.pm	2007-11-25 22:09:21 UTC (rev 515)
@@ -172,7 +172,7 @@
 $c->stash->{template} = 'packages/info.tt2';
 
 }
-sub tobuildv2 : Local {
+sub tobuildv3 : Local {
   my ($self, $c, $arch) = @_;
   my $archs = "(i386|m68k|sparc|alpha|powerpc|".
   "arm|mips|mipsel|hppa|ia64|s390|amd64|".
@@ -184,24 +184,20 @@
     $c->response->body("missing or invalid arch"); # Seems to create an error 
     return;
   }
+#   FROM package
+#      LEFT JOIN build ON package.id = build.package_id AND package.vcsrev = build.rev::text
+#        WHERE package.blacklisted = false AND package.issrcinmypool = true AND (package.lastbuildstart IS NULL OR package.lastbuildstart < (now() - '03:00:00'::interval))
+#          ORDER BY build.id IS NOT NULL, build."time";
 
-  my $tmp = $c->model('SvnBuildStat::WWW::Model::DB::Viewtobuild2')->search({$arch => 'true' })->first;
-  my $package = $c->model('SvnBuildStat::WWW::Model::DB::Package')->search ({id => $tmp->id})->first;
+  my $package_id = $c->model('SvnBuildStat::WWW::Model::DB::Viewtobuild')->search({$arch => 'true' })->first->id;
+  my $package = $c->model('SvnBuildStat::WWW::Model::DB::Package')->search ({id => $package_id})->first;
 
 
   $package->lastbuildstart('now');
   $package->update();
 
-  my $svndebrelease = $package->realsvndebrelease;
-  $svndebrelease =~ s/^\d+://; # remove the EPOCH 
+  $c->response->body("dsc=".$package->dscuri."\npackage_id=".$package->id);
 
-  if ($package->isinmypool) {
-    # TODO: put the repository URL in the cfg
-    $c->response->body("http://nana.rulezlan.org/debian/".$package->repository_id->team_id->shortname."/".$package->name."/".$package->name."_".$svndebrelease.".dsc");
-  } else {
-    $c->response->body($package->dscuri);
-  }
-
 }
 
 =head1 AUTHOR




More information about the Collab-qa-commits mailing list