diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-02-11 16:56:45 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-02-11 16:56:45 +0000 |
commit | 20ce2642fc0052a9f70faf194cc0c31d3f88926e (patch) | |
tree | 6c578e87f0453af0522ae97a749e66b40f952669 /src/libexpr | |
parent | 80870d9291813f265a6e078c92aa535ef0b70a47 (diff) |
* Refactoring to support different installation sources in nix-env.
* Set the references for the user environment manifest properly.
* Don't copy the manifest (this was accidental).
* Don't store derivation paths in the manifest (maybe this should be
made optional). This cleans up the semantics of nix-env, which were
weird.
* Hash on the output paths of activated components, not on derivation
paths. This is because we don't know the derivation path of already
installed components anymore, and it allows the installation of
components by store path (skipping Nix expressions entirely).
* Query options `--out-path' and `--drv-path' to show the output and
derivation paths of components, respectively (the latter replaces
the `--expr' query).
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 013eba594..da9d1e635 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -94,6 +94,7 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv, else if (matchAttrs(e, es)) { Expr a = queryAttr(e, "type"); + if (a && evalString(state, a) == "derivation") { a = queryAttr(e, "drvPath"); if (!a) throw Error("derivation name missing"); @@ -104,12 +105,22 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv, /* !!! supports only single output path */ Path outPath = evalPath(state, a); - StringSet ids; - ids.insert("out"); - drv.inputDrvs[drvPath] = ids; + drv.inputDrvs[drvPath] = singleton<StringSet>("out"); + ss.push_back(outPath); + } + + else if (a && evalString(state, a) == "storePath") { + + a = queryAttr(e, "outPath"); + if (!a) throw Error("output path missing"); + /* !!! supports only single output path */ + Path outPath = evalPath(state, a); + + drv.inputSrcs.insert(outPath); ss.push_back(outPath); - } else - throw Error("invalid derivation attribute"); + } + + else throw Error("invalid derivation attribute"); } else if (matchPath(e, s)) { |