This commit is contained in:
Eelco Dolstra 2008-11-12 23:14:57 +00:00
parent 08f171d9e8
commit 6591118a2b
14 changed files with 50 additions and 25 deletions

View file

@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes; __PACKAGE__->load_classes;
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F1nSglXZOlZaa+DozFyuSw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZbJ6NueGI5oUOzciArgKog
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -28,6 +28,8 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 0, size => undef }, { data_type => "integer", is_nullable => 0, size => undef },
"path", "path",
{ data_type => "text", is_nullable => 0, size => undef }, { data_type => "text", is_nullable => 0, size => undef },
"sha256hash",
{ data_type => "VARCHAR", is_nullable => 0, size => undef },
); );
__PACKAGE__->set_primary_key("id"); __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
@ -38,8 +40,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6AC1Vo2bOr42lKnrBq/OJg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aad+idPUM0h/+J0Hl5SdIg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -21,8 +21,8 @@ __PACKAGE__->set_primary_key("build", "logphase");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fdoYDJVZVm+i55Fx3tAN9Q # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o8osOyKf+9S5A87XexVOeA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -33,8 +33,8 @@ __PACKAGE__->set_primary_key("build", "productnr");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N+3MtBcrTGOC3emLB+xNRQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:52RNu4OcP3buytGZs+cGZQ
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -25,8 +25,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YMeFW1JK1ChtsgKbur76Mg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+kbG4YYzbVVPWMwWTcQ32Q
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -79,8 +79,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mfQ486yZBf8hAuPUAT3rNw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:l4QUKDHPL1mEZSlO9GgGzw
__PACKAGE__->has_many(dependents => 'HydraFrontend::Schema::Buildinputs', 'dependency'); __PACKAGE__->has_many(dependents => 'HydraFrontend::Schema::Buildinputs', 'dependency');

View file

@ -23,8 +23,8 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KGrBqaYWcJJW8YWfTxU2aA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EDzMzfQFnkl0bAmBlh5Omw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" }); __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zjPeAZwkkJ7hZ5LZ00fm1A # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:T25Mdcg1A77BB4gFF3LPZA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -33,8 +33,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9qIw6bpHy7bKDNI3g1WKMA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Qc9/eVs3wY6m9fztR3Yizg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -43,8 +43,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OL3rSmVxWsUJoeaUieZGJA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V2RU7h0eTPBUES0G306AgA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -48,8 +48,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ed14Jg43pSHx6rNdYW6kLg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TMnJfLpgUhiMkJKB8I1qqQ
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -24,8 +24,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-12 17:11:42 # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-13 00:06:06
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qzleHgS4oapKEZ8hPyB3Sw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UEZU36sQSaNML/YCAtpGkg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -103,6 +103,8 @@ create table BuildInputs (
path text, path text,
sha256hash text,
foreign key (build) references Builds(id) on delete cascade, -- ignored by sqlite foreign key (build) references Builds(id) on delete cascade, -- ignored by sqlite
foreign key (dependency) references Builds(id) -- ignored by sqlite foreign key (dependency) references Builds(id) -- ignored by sqlite
); );

View file

@ -16,6 +16,20 @@ sub isValidPath {
} }
sub getStorePathHash {
my ($storePath) = @_;
my $hash = `nix-store --query --hash $storePath`
or die "cannot get hash of $storePath";
chomp $hash;
die unless $hash =~ /^sha256:(.*)$/;
$hash = $1;
$hash = `nix-hash --to-base16 --type sha256 $hash`
or die "cannot convert hash";
chomp $hash;
return $hash;
}
sub fetchInput { sub fetchInput {
my ($input, $alt, $inputInfo) = @_; my ($input, $alt, $inputInfo) = @_;
my $type = $input->type; my $type = $input->type;
@ -26,7 +40,13 @@ sub fetchInput {
or die "cannot copy path $uri to the Nix store"; or die "cannot copy path $uri to the Nix store";
chomp $storePath; chomp $storePath;
print " copied to $storePath\n"; print " copied to $storePath\n";
$$inputInfo{$input->name} = {type => $type, uri => $uri, storePath => $storePath};
$$inputInfo{$input->name} =
{ type => $type
, uri => $uri
, storePath => $storePath
, sha256hash => getStorePathHash $storePath
};
} }
elsif ($type eq "string") { elsif ($type eq "string") {
@ -105,6 +125,7 @@ sub checkJob {
, value => $input->{value} , value => $input->{value}
, dependency => $input->{id} , dependency => $input->{id}
, path => ($input->{storePath} or "") # !!! temporary hack , path => ($input->{storePath} or "") # !!! temporary hack
, sha256hash => $input->{sha256hash}
}); });
} }
}); });