[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
54/64: nix-instantiate --eval: Apply auto-arguments if the result is a f
From: |
Ludovic Courtès |
Subject: |
54/64: nix-instantiate --eval: Apply auto-arguments if the result is a function |
Date: |
Mon, 05 Jan 2015 16:39:10 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit 95501c4deea1d945022df18475340232bc6980be
Author: Eelco Dolstra <address@hidden>
Date: Tue May 13 12:54:28 2014 +0200
nix-instantiate --eval: Apply auto-arguments if the result is a function
Fixes #254.
---
src/nix-instantiate/nix-instantiate.cc | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/nix-instantiate/nix-instantiate.cc
b/src/nix-instantiate/nix-instantiate.cc
index afd16b3..7cdabcb 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -52,14 +52,19 @@ void processExpr(EvalState & state, const Strings &
attrPaths,
state.forceValue(v);
PathSet context;
- if (evalOnly)
+ if (evalOnly) {
+ Value vRes;
+ if (autoArgs.empty())
+ vRes = v;
+ else
+ state.autoCallFunction(autoArgs, v, vRes);
if (xmlOutput)
- printValueAsXML(state, strict, location, v, std::cout,
context);
+ printValueAsXML(state, strict, location, vRes, std::cout,
context);
else {
- if (strict) state.strictForceValue(v);
- std::cout << v << std::endl;
+ if (strict) state.strictForceValue(vRes);
+ std::cout << vRes << std::endl;
}
- else {
+ } else {
DrvInfos drvs;
getDerivations(state, v, "", autoArgs, drvs, false);
foreach (DrvInfos::iterator, i, drvs) {
- 36/64: Bump version to 1.8, (continued)
- 36/64: Bump version to 1.8, Ludovic Courtès, 2015/01/05
- 44/64: Install an Upstart service, Ludovic Courtès, 2015/01/05
- 45/64: Set up directories and permissions for multi-user install automatically, Ludovic Courtès, 2015/01/05
- 46/64: Simplify multi-user installation instructions, Ludovic Courtès, 2015/01/05
- 49/64: Add ubuntu 14.04, Ludovic Courtès, 2015/01/05
- 48/64: Don't install Upstart job on Fedora, Ludovic Courtès, 2015/01/05
- 51/64: Really fix the RPM builds, Ludovic Courtès, 2015/01/05
- 50/64: Fix RPM build, Ludovic Courtès, 2015/01/05
- 53/64: fix typo, Ludovic Courtès, 2015/01/05
- 52/64: Shortcut already-hardlinked files, Ludovic Courtès, 2015/01/05
- 54/64: nix-instantiate --eval: Apply auto-arguments if the result is a function,
Ludovic Courtès <=
- 47/64: Fix Debian tests, Ludovic Courtès, 2015/01/05
- 60/64: Merge branch 'master' of github.com:wmertens/nix, Ludovic Courtès, 2015/01/05
- 58/64: Use the inodes given by readdir directly, Ludovic Courtès, 2015/01/05
- 57/64: Remove redundant code, Ludovic Courtès, 2015/01/05
- 55/64: Prepare nix-mode to be uploaded to marmalade, Ludovic Courtès, 2015/01/05
- 56/64: Preload linked hashes to speed up lookups, Ludovic Courtès, 2015/01/05
- 63/64: lvlInfo -> lvlTalkative, Ludovic Courtès, 2015/01/05
- 42/64: When running as root, use build users by default, Ludovic Courtès, 2015/01/05
- 59/64: Shortcut store files before lstat, Ludovic Courtès, 2015/01/05
- 64/64: Merge commit '8d5f472f2c49c79a0d3ae2e506f4d4d76224b328' into nix, Ludovic Courtès, 2015/01/05