about summary refs log tree commit diff
path: root/src/libstore/derivations.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-26T14·39+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-26T14·39+0100
commit46a369ad9558939bc2c6ee588df483ca503bbb5a (patch)
tree7a3fc4d49d0a5fb29d1c6e139672d91f86e71f47 /src/libstore/derivations.hh
parenta3d6585c5a1006d4f9ebd2163d06f86ab71a4a3e (diff)
Make "nix-build -A <derivation>.<output>" do the right thing
For example, given a derivation with outputs "out", "man" and "bin":

  $ nix-build -A pkg

produces ./result pointing to the "out" output;

  $ nix-build -A pkg.man

produces ./result-man pointing to the "man" output;

  $ nix-build -A pkg.all

produces ./result, ./result-man and ./result-bin;

  $ nix-build -A pkg.all -A pkg2

produces ./result, ./result-man, ./result-bin and ./result-2.
Diffstat (limited to 'src/libstore/derivations.hh')
-rw-r--r--src/libstore/derivations.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh
index 7d38e60c0fe6..6b7c3e6ab189 100644
--- a/src/libstore/derivations.hh
+++ b/src/libstore/derivations.hh
@@ -79,4 +79,13 @@ typedef std::map<Path, Hash> DrvHashes;
 
 extern DrvHashes drvHashes;
 
+/* Split a string specifying a derivation and a set of outputs
+   (/nix/store/hash-foo!out1,out2,...) into the derivation path and
+   the outputs. */
+typedef std::pair<string, std::set<string> > DrvPathWithOutputs;
+DrvPathWithOutputs parseDrvPathWithOutputs(const string & s);
+
+Path makeDrvPathWithOutputs(const Path & drvPath, std::set<string> outputs);
+
+
 }