From 2a240e458e41ef94dadab6d7cd6e2be79900a6c9 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 10 Aug 2015 08:02:10 -0400 Subject: [PATCH] Pass along drvPath and outputName for inputs that are previous builds. This allows importing the .drv and getting the same store paths as if the input had been passed in as nix expressions defining a proper derivation. --- src/lib/Hydra/Helper/AddBuilds.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index 6137e2ca..416aa2b0 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -105,10 +105,14 @@ sub fetchInputBuild { my $relName = ($prevBuild->releasename or $prevBuild->nixname); my $version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/; + my $mainOutput = getMainOutput($prevBuild); + return - { storePath => getMainOutput($prevBuild)->path + { storePath => $mainOutput->path , id => $prevBuild->id , version => $version + , outputName => $mainOutput->name + , drvPath => $prevBuild->drvPath }; } @@ -279,6 +283,8 @@ sub buildInputToString { (defined $input->{gitTag} ? "; gitTag = \"" . $input->{gitTag} . "\"" : "") . (defined $input->{shortRev} ? "; shortRev = \"" . $input->{shortRev} . "\"" : "") . (defined $input->{version} ? "; version = \"" . $input->{version} . "\"" : "") . + (defined $input->{outputName} ? "; outputName = \"" . $input->{outputName} . "\"" : "") . + (defined $input->{drvPath} ? "; drvPath = " . $input->{drvPath} . "" : "") . ";}"; } return $result;