Fix "error: deriver of path ‘’ is not known"

This commit is contained in:
Eelco Dolstra 2015-05-13 18:03:22 +02:00
parent 9233ac7c56
commit a010c0ae05

View file

@ -49,12 +49,11 @@ LocalStore & ensureLocalStore()
static Path useDeriver(Path path)
{
if (!isDerivation(path)) {
path = store->queryDeriver(path);
if (path == "")
throw Error(format("deriver of path %1% is not known") % path);
}
return path;
if (isDerivation(path)) return path;
Path drvPath = store->queryDeriver(path);
if (drvPath == "")
throw Error(format("deriver of path %1% is not known") % path);
return drvPath;
}