From 921111d1972388a0aa1841c545c753cb996c9257 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 3 Jan 2012 14:01:47 +0000 Subject: =?UTF-8?q?*=20Move=20the=20implementation=20of=20the=20=E2=80=98d?= =?UTF-8?q?erivation=E2=80=99=20primop=20into=20a=20separate=20=20=20file.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libexpr/primops.cc | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/libexpr/primops.cc') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index ca7766487..02c444cd6 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1099,29 +1099,7 @@ void EvalState::createBaseEnv() /* Add a wrapper around the derivation primop that computes the `drvPath' and `outPath' attributes lazily. */ - string s = "attrs: \ - let \ - strict = derivationStrict attrs; \ - attrValues = attrs: \ - map (name: builtins.getAttr name attrs) (builtins.attrNames attrs); \ - outputToAttrListElement = output: \ - { \ - name = output; \ - value = attrs // { \ - outPath = builtins.getAttr (output + \"Path\") strict; \ - drvPath = strict.drvPath; \ - type = \"derivation\"; \ - currentOutput = output; \ - } // outputsAttrs // { all = allList; }; \ - }; \ - outputsList = if attrs ? outputs then \ - map outputToAttrListElement attrs.outputs else \ - [ (outputToAttrListElement \"out\") ]; \ - outputsAttrs = builtins.listToAttrs outputsList; \ - allList = attrValues outputsAttrs; \ - head = if attrs ? outputs then builtins.head attrs.outputs else \"out\"; \ - in builtins.getAttr head outputsAttrs"; - mkThunk_(v, parseExprFromString(s, "/")); + mkThunk_(v, parseExprFromFile(findFile("nix/derivation.nix"))); addConstant("derivation", v); /* Now that we've added all primops, sort the `builtins' attribute -- cgit v1.2.3