Merge pull request #231 from shlevy/prev-build-drv-info

Pass along drvPath and outputName for inputs that are previous builds.
This commit is contained in:
Eelco Dolstra 2015-08-10 20:23:29 +02:00
commit cf9516baa4

View file

@ -105,11 +105,19 @@ sub fetchInputBuild {
my $relName = ($prevBuild->releasename or $prevBuild->nixname); my $relName = ($prevBuild->releasename or $prevBuild->nixname);
my $version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/; my $version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
return my $mainOutput = getMainOutput($prevBuild);
{ storePath => getMainOutput($prevBuild)->path
my $result =
{ storePath => $mainOutput->path
, id => $prevBuild->id , id => $prevBuild->id
, version => $version , version => $version
, outputName => $mainOutput->name
}; };
if (isValidPath($prevBuild->drvpath)) {
$result->{drvPath} = $prevBuild->drvpath;
}
return $result;
} }
@ -279,6 +287,8 @@ sub buildInputToString {
(defined $input->{gitTag} ? "; gitTag = \"" . $input->{gitTag} . "\"" : "") . (defined $input->{gitTag} ? "; gitTag = \"" . $input->{gitTag} . "\"" : "") .
(defined $input->{shortRev} ? "; shortRev = \"" . $input->{shortRev} . "\"" : "") . (defined $input->{shortRev} ? "; shortRev = \"" . $input->{shortRev} . "\"" : "") .
(defined $input->{version} ? "; version = \"" . $input->{version} . "\"" : "") . (defined $input->{version} ? "; version = \"" . $input->{version} . "\"" : "") .
(defined $input->{outputName} ? "; outputName = \"" . $input->{outputName} . "\"" : "") .
(defined $input->{drvPath} ? "; drvPath = builtins.storePath " . $input->{drvPath} . "" : "") .
";}"; ";}";
} }
return $result; return $result;