nix-build: Fix regression causing all outputs to be built

This commit is contained in:
Eelco Dolstra 2017-07-28 15:03:59 +02:00
parent af4689f9e9
commit c7654bc491
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -453,13 +453,13 @@ void mainWrapped(int argc, char * * argv)
for (auto & drvInfo : drvs) {
auto drvPath = drvInfo.queryDrvPath();
pathsToBuild.insert(drvPath);
auto outPath = drvInfo.queryOutPath();
auto outputName = drvInfo.queryOutputName();
if (outputName == "")
throw Error("derivation %s lacks an outputName attribute", drvPath);
pathsToBuild.insert(drvPath + (outputName != "out" ? "!" + outputName : ""));
pathsToBuild.insert(drvPath + "!" + outputName);
std::string drvPrefix;
auto i = drvPrefixes.find(drvPath);
@ -475,8 +475,8 @@ void mainWrapped(int argc, char * * argv)
std::string symlink = drvPrefix;
if (outputName != "out") symlink += "-" + outputName;
resultSymlinks[symlink] = drvInfo.queryOutPath();
outPaths.push_back(drvInfo.queryOutPath());
resultSymlinks[symlink] = outPath;
outPaths.push_back(outPath);
}
buildPaths(pathsToBuild);