From 08f171d9e8161c1e55c469d473a7a0c21a7c3eb4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 12 Nov 2008 16:42:07 +0000 Subject: [PATCH] --- .../lib/HydraFrontend/Controller/Root.pm | 3 ++- src/HydraFrontend/lib/HydraFrontend/Schema.pm | 4 +-- .../lib/HydraFrontend/Schema/Buildinputs.pm | 4 +-- .../lib/HydraFrontend/Schema/Buildlogs.pm | 4 +-- .../lib/HydraFrontend/Schema/Buildproducts.pm | 4 +-- .../HydraFrontend/Schema/Buildresultinfo.pm | 4 +-- .../lib/HydraFrontend/Schema/Builds.pm | 26 ++++++++++--------- .../Schema/Buildschedulinginfo.pm | 4 +-- .../lib/HydraFrontend/Schema/Buildsteps.pm | 4 +-- .../HydraFrontend/Schema/Jobsetinputalts.pm | 4 +-- .../lib/HydraFrontend/Schema/Jobsetinputs.pm | 4 +-- .../lib/HydraFrontend/Schema/Jobsets.pm | 4 +-- .../lib/HydraFrontend/Schema/Projects.pm | 4 +-- src/HydraFrontend/root/build.tt | 19 ++++++++++++-- src/build.pl | 7 ++--- src/hydra.sql | 1 + src/scheduler.pl | 1 + 17 files changed, 61 insertions(+), 40 deletions(-) diff --git a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm index e1c55646..21177361 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm @@ -180,7 +180,8 @@ sub download :Local { } } - my $path = $product->path . "/" . join("/", @path); + my $path = $product->path; + $path .= "/" . join("/", @path) if scalar @path > 0; # If this is a directory but no "/" is attached, then redirect. if (-d $path && substr($c->request->uri, -1) ne "/") { diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema.pm b/src/HydraFrontend/lib/HydraFrontend/Schema.pm index a7d3ba11..15346c06 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-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:B5e2QLKoLZK5s4Ntc5MuAA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F1nSglXZOlZaa+DozFyuSw # 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 6a350991..330be8d5 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm @@ -38,8 +38,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gB3bnV6S6yuAk1ojYmaI8g +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6AC1Vo2bOr42lKnrBq/OJg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm index 05a933b5..bbe3618e 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm @@ -21,8 +21,8 @@ __PACKAGE__->set_primary_key("build", "logphase"); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IfVP+l5/yBO6808VOMNADQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fdoYDJVZVm+i55Fx3tAN9Q # 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 7bed8468..56429e8c 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm @@ -33,8 +33,8 @@ __PACKAGE__->set_primary_key("build", "productnr"); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pY4RxKVCMKfiBDtNNXeBng +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N+3MtBcrTGOC3emLB+xNRQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm index 9ef94a73..18506a61 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm @@ -25,8 +25,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wYS1iVMAyN/RtZG1Obi9tw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YMeFW1JK1ChtsgKbur76Mg # 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 8fa9ec47..bba7e38e 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm @@ -20,6 +20,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0, size => undef }, "attrname", { data_type => "text", is_nullable => 0, size => undef }, + "nixname", + { data_type => "text", is_nullable => 0, size => undef }, "description", { data_type => "text", is_nullable => 0, size => undef }, "drvpath", @@ -50,6 +52,11 @@ __PACKAGE__->has_many( "HydraFrontend::Schema::Buildresultinfo", { "foreign.id" => "self.id" }, ); +__PACKAGE__->has_many( + "buildsteps", + "HydraFrontend::Schema::Buildsteps", + { "foreign.id" => "self.id" }, +); __PACKAGE__->has_many( "buildinputs_builds", "HydraFrontend::Schema::Buildinputs", @@ -60,25 +67,20 @@ __PACKAGE__->has_many( "HydraFrontend::Schema::Buildinputs", { "foreign.dependency" => "self.id" }, ); -__PACKAGE__->has_many( - "buildlogs", - "HydraFrontend::Schema::Buildlogs", - { "foreign.build" => "self.id" }, -); -__PACKAGE__->has_many( - "buildsteps", - "HydraFrontend::Schema::Buildsteps", - { "foreign.id" => "self.id" }, -); __PACKAGE__->has_many( "buildproducts", "HydraFrontend::Schema::Buildproducts", { "foreign.build" => "self.id" }, ); +__PACKAGE__->has_many( + "buildlogs", + "HydraFrontend::Schema::Buildlogs", + { "foreign.build" => "self.id" }, +); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1fLVr/70ZuAOfnMp3rMzxg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mfQ486yZBf8hAuPUAT3rNw __PACKAGE__->has_many(dependents => 'HydraFrontend::Schema::Buildinputs', 'dependency'); diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm index 76b58b75..839a4f43 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm @@ -23,8 +23,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iRPGs/gpDnzo1PxQxG7xvw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KGrBqaYWcJJW8YWfTxU2aA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm index a3dc1e46..b4ddd18c 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Buildsteps.pm @@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr"); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mhkF1c7eX7lD/XrssbCZvA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zjPeAZwkkJ7hZ5LZ00fm1A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm index 1f0a6f55..74c3ad69 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-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hxSSWmfGbKz1L3Qcd3/3Vw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9qIw6bpHy7bKDNI3g1WKMA # 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 d1d3a270..c1dbd83f 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-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PWJ32W99n1Zw44Rhj5P1Pg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OL3rSmVxWsUJoeaUieZGJA # 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 7af13620..5798c86a 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm @@ -48,8 +48,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FVgzVxkslYSC4yoG9JxA+A +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ed14Jg43pSHx6rNdYW6kLg # 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 cd419f17..508fcc45 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm @@ -24,8 +24,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 15:09:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Gj8h9Nexy9HmrFNeH2bWCQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qzleHgS4oapKEZ8hPyB3Sw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/HydraFrontend/root/build.tt b/src/HydraFrontend/root/build.tt index d4d7746d..14ec7d09 100644 --- a/src/HydraFrontend/root/build.tt +++ b/src/HydraFrontend/root/build.tt @@ -56,7 +56,11 @@ Job name: - [% build.attrname %] + [% build.attrname %] + + + Nix name: + [% build.nixname %] Description: @@ -101,7 +105,7 @@ [% IF build.schedulingInfo.busy %] Logfile: - [% build.schedulingInfo.logfile %] + [% build.schedulingInfo.logfile %] [% END %] [% END %] @@ -238,6 +242,17 @@ [% END %] + [% CASE "doc" %] + + + [% SWITCH product.subtype %] + [% CASE "readme" %] + “README” file + [% CASE DEFAULT %] + Documentation of type [% product.subtype %] + [% END %] + + [% CASE DEFAULT %] Something of type [% product.type %] diff --git a/src/build.pl b/src/build.pl index fce7b089..b61419e5 100644 --- a/src/build.pl +++ b/src/build.pl @@ -215,9 +215,9 @@ sub doBuild { if (-e "$outPath/nix-support/hydra-build-products") { open LIST, "$outPath/nix-support/hydra-build-products" or die; while () { - /^(\w+)\s+([\w-]+)\s+(\S+)$/ or die; + /^([\w\-]+)\s+([\w\-]+)\s+(\S+)$/ or next; my $type = $1; - my $subtype = $2; + my $subtype = $2 eq "none" ? "" : $2; my $path = $3; die unless -e $path; @@ -225,7 +225,7 @@ sub doBuild { if (-f $path) { my $st = stat($path) or die "cannot stat $path: $!"; - $fileSize = $st; + $fileSize = $st->size; $sha1 = `nix-hash --flat --type sha1 $path` or die "cannot hash $path: $?";; @@ -258,6 +258,7 @@ sub doBuild { , type => "nix-build" , subtype => "" , path => $outPath + , name => $build->nixname }); } } diff --git a/src/hydra.sql b/src/hydra.sql index 9ee27f87..a3321138 100644 --- a/src/hydra.sql +++ b/src/hydra.sql @@ -17,6 +17,7 @@ create table Builds ( attrName text not null, -- Info about the build result. + nixName text, -- name attribute of the derivation description text, drvPath text not null, outPath text not null, diff --git a/src/scheduler.pl b/src/scheduler.pl index c74bdd69..99c5150a 100644 --- a/src/scheduler.pl +++ b/src/scheduler.pl @@ -80,6 +80,7 @@ sub checkJob { , jobset => $jobset->name , attrname => $jobName , description => $description + , nixname => $job->{name} , drvpath => $drvPath , outpath => $outPath , system => $job->{system}