about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-05-15T16·50+0200
committerEelco Dolstra <edolstra@gmail.com>2017-05-15T16·50+0200
commite80257f12209c8fbb709b901039ef5199111276e (patch)
tree7fdac30690731e017497025277127dc8d68558b1 /src/libstore
parentc05d9ae7a5f72a6575130cf92fb54e3f90d1927d (diff)
Simplify fixed-output check
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 5ec4cbf66540..91156d313e2e 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1066,12 +1066,8 @@ void DerivationGoal::haveDerivation()
 
     /* Reject doing a hash build of anything other than a fixed-output
        derivation. */
-    if (buildMode == bmHash) {
-        if (drv->outputs.size() != 1 ||
-            drv->outputs.find("out") == drv->outputs.end() ||
-            drv->outputs["out"].hashAlgo == "")
-            throw Error(format("cannot do a hash build of non-fixed-output derivation ‘%1%’") % drvPath);
-    }
+    if (buildMode == bmHash && !drv->isFixedOutput())
+        throw Error("cannot do a hash build of non-fixed-output derivation ‘%1%’", drvPath);
 
     /* We are first going to try to create the invalid output paths
        through substitutes.  If that doesn't work, we'll build