about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/nix-build/nix-build.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index 8a3c8a02506c..769ca8cd03a2 100755
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -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);