about summary refs log tree commit diff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-02-11T16·56+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-02-11T16·56+0000
commit20ce2642fc0052a9f70faf194cc0c31d3f88926e (patch)
tree6c578e87f0453af0522ae97a749e66b40f952669 /src/libutil/util.hh
parent80870d9291813f265a6e078c92aa535ef0b70a47 (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/libutil/util.hh')
-rw-r--r--src/libutil/util.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index b67913862408..2577f79e1b87 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -112,6 +112,14 @@ Path createTempDir();
    not already exist. */
 void writeStringToFile(const Path & path, const string & s);
 
+template<class T, class A>
+T singleton(const A & a)
+{
+    T t;
+    t.insert(a);
+    return t;
+}
+
 
 /* Messages. */