From 74c952d073eef2e43419127ce90c97a8dc53e300 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 8 Nov 2008 22:40:12 +0000 Subject: [PATCH] --- src/HydraFrontend/lib/HydraFrontend/Schema.pm | 4 ++-- .../lib/HydraFrontend/Schema/Buildinputs.pm | 6 +++--- .../lib/HydraFrontend/Schema/Buildlogs.pm | 4 ++-- .../lib/HydraFrontend/Schema/Buildproducts.pm | 12 +++++------- .../lib/HydraFrontend/Schema/Builds.pm | 14 +++++++------- .../lib/HydraFrontend/Schema/Jobsetinputalts.pm | 4 ++-- .../lib/HydraFrontend/Schema/Jobsetinputs.pm | 4 ++-- .../lib/HydraFrontend/Schema/Jobsets.pm | 4 ++-- .../lib/HydraFrontend/Schema/Projects.pm | 4 ++-- src/hydra.sql | 5 ++--- src/scheduler.pl | 4 ---- 11 files changed, 29 insertions(+), 36 deletions(-) diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema.pm b/src/HydraFrontend/lib/HydraFrontend/Schema.pm index b9596bce..03f3c4ce 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema.pm @@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WdXbmj1/EvPeU107AjY6zw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Gl/KqOOAg3rH0hWZUovhxw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm index 3e1e8243..9b0d789c 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm @@ -25,7 +25,7 @@ __PACKAGE__->add_columns( "path", { data_type => "text", is_nullable => 0, size => undef }, "value", - { data_type => "VARCHAR", is_nullable => 0, size => undef }, + { data_type => "text", is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("buildid", "name"); __PACKAGE__->belongs_to( @@ -35,8 +35,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GBvbApjpjiwkUQsdZg1PLg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2XeATQWeO3i3eSHlquS2QA __PACKAGE__->belongs_to( "build", diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm index 49934b7e..f96ded5e 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm @@ -25,8 +25,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vLByOFOHkwwHa6hf8nC1Jg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tlyJLjDbR0vk3Jt/O3M4nw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm index 37bf3476..7fb7e2d9 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm @@ -10,16 +10,14 @@ __PACKAGE__->table("buildProducts"); __PACKAGE__->add_columns( "buildid", { data_type => "integer", is_nullable => 0, size => undef }, + "path", + { data_type => "text", is_nullable => 0, size => undef }, "type", { data_type => "text", is_nullable => 0, size => undef }, "subtype", { data_type => "text", is_nullable => 0, size => undef }, - "path", - { data_type => "text", is_nullable => 0, size => undef }, - "productnr", - { data_type => "integer", is_nullable => 0, size => undef }, ); -__PACKAGE__->set_primary_key("buildid", "productnr"); +__PACKAGE__->set_primary_key("buildid", "path"); __PACKAGE__->belongs_to( "buildid", "HydraFrontend::Schema::Builds", @@ -27,8 +25,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4exGa1a3mCSv3b8Lqwu7Hw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lCdfeZud7izQv/11dVFFVA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm index 0fd02526..5893afa9 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm @@ -38,6 +38,11 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("id"); +__PACKAGE__->has_many( + "buildinputs", + "HydraFrontend::Schema::Buildinputs", + { "foreign.buildid" => "self.id" }, +); __PACKAGE__->has_many( "buildproducts", "HydraFrontend::Schema::Buildproducts", @@ -48,15 +53,10 @@ __PACKAGE__->has_many( "HydraFrontend::Schema::Buildlogs", { "foreign.buildid" => "self.id" }, ); -__PACKAGE__->has_many( - "buildinputs", - "HydraFrontend::Schema::Buildinputs", - { "foreign.buildid" => "self.id" }, -); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xsDBmgfas2tM/Dn9PE/eXQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JRXGOLW2h+DOY7LZUdkCWQ __PACKAGE__->has_many(dependentBuildInputs => 'HydraFrontend::Schema::Buildinputs', 'inputid'); diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm index 317ae9bd..e2b2cd20 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm @@ -33,8 +33,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8fi3nwRY3VrwApBAW6XrQQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m24w17dWVxjIqPlea77G3A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm index a5ff8443..2cecaa33 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm @@ -43,8 +43,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0uYHZfy1ZXCTLc3AsFWI0w +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ufIbhVFTzl7awpRrZofvJQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm index 4adb8947..67bc9f9b 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm @@ -40,8 +40,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g1LPc13y/7/ngDzFqL5jXQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7hm28Izo7wCZc07fH1EJRg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm index 6f287ab1..ffb748fd 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm @@ -19,8 +19,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-07 17:44:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fIpNlZNqqGDGGWd6EORCAA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-08 23:34:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WCqXnL5vOhpwjYB9/Aw7tg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/hydra.sql b/src/hydra.sql index 7716f2a1..53a23a5d 100644 --- a/src/hydra.sql +++ b/src/hydra.sql @@ -42,11 +42,10 @@ create table buildInputs ( create table buildProducts ( buildId integer not null, - productnr integer not null, + path text not null, type text not null, -- "nix-build", "file", "doc", "report", ... subtype text not null, -- "source-dist", "rpm", ... - path text not null, - primary key (buildId, productnr), + primary key (buildId, path), foreign key (buildId) references builds(id) on delete cascade -- ignored by sqlite ); diff --git a/src/scheduler.pl b/src/scheduler.pl index cf026bd7..94be0b38 100644 --- a/src/scheduler.pl +++ b/src/scheduler.pl @@ -96,8 +96,6 @@ sub buildJob { if ($outputCreated) { - my $productnr = 0; - if (-e "$outPath/log") { foreach my $logPath (glob "$outPath/log/*") { print " LOG $logPath\n"; @@ -120,7 +118,6 @@ sub buildJob { die unless -e $path; $db->resultset('Buildproducts')->create( { buildid => $build->id - , productnr => $productnr++ , type => $type , subtype => $subtype , path => $path @@ -130,7 +127,6 @@ sub buildJob { } else { $db->resultset('Buildproducts')->create( { buildid => $build->id - , productnr => $productnr++ , type => "nix-build" , subtype => "" , path => $outPath