diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-07-16 17:28:52 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-07-16 17:28:52 +0000 |
commit | cc0d77f8c9c71f5870bcaf3d0c041b6ba4c1bf63 (patch) | |
tree | 1776c2a44d9e32a6842f310c38f362bf59bb1ffb /src/libexpr/primops.cc | |
parent | c466cb2091b7a382aba1739c0320f2b6c0a04c1e (diff) | |
parent | 5ea817dace2b554e602d7f9df6e43084ad112e3d (diff) |
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 138e00f48..09989102a 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -30,18 +30,6 @@ namespace nix { *************************************************************/ -/* Decode a context string ‘!<name>!<path>’ into a pair <path, - name>. */ -std::pair<string, string> decodeContext(const string & s) -{ - if (s.at(0) == '!') { - size_t index = s.find("!", 1); - return std::pair<string, string>(string(s, index + 1), string(s, 1, index - 1)); - } else - return std::pair<string, string>(s.at(0) == '/' ? s : string(s, 1), ""); -} - - InvalidPathError::InvalidPathError(const Path & path) : EvalError("path '%s' is not valid", path), path(path) {} @@ -883,10 +871,10 @@ static void prim_storePath(EvalState & state, const Pos & pos, Value * * args, V .hint = hintfmt("path '%1%' is not in the Nix store", path), .errPos = pos }); - Path path2 = state.store->toStorePath(path); + auto path2 = state.store->toStorePath(path).first; if (!settings.readOnlyMode) - state.store->ensurePath(state.store->parseStorePath(path2)); - context.insert(path2); + state.store->ensurePath(path2); + context.insert(state.store->printStorePath(path2)); mkString(v, path, context); } |