diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-03-10 16:20:42 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-03-10 16:20:42 +0000 |
commit | 37d1b1cafd17a18dc7dbef3b4ba7fb204158d58b (patch) | |
tree | 65ac3fdf078404a0957c5df5af855849e03be20f /src/libexpr/get-drvs.hh | |
parent | a33fb2d28738376d377ea8473f6cffc39bc784c4 (diff) |
* `nix-env -qa --description' shows human-readable descriptions of
packages (provided that they have a `meta.description' attribute).
E.g.,
$ ./src/nix-env/nix-env -qa --description gcc
gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for sparc-linux)
gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for mips-linux)
gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for arm-linux)
gcc-4.0.2 GNU Compiler Collection, 4.0.x
Diffstat (limited to 'src/libexpr/get-drvs.hh')
-rw-r--r-- | src/libexpr/get-drvs.hh | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/libexpr/get-drvs.hh b/src/libexpr/get-drvs.hh index 5b1c0e6d4..e692a5c66 100644 --- a/src/libexpr/get-drvs.hh +++ b/src/libexpr/get-drvs.hh @@ -7,6 +7,9 @@ #include "eval.hh" +typedef map<string, string> MetaInfo; + + struct DrvInfo { private: @@ -19,24 +22,9 @@ public: ATermMap attrs; - string queryDrvPath(EvalState & state) const - { - if (drvPath == "") { - Expr a = attrs.get("drvPath"); - (string &) drvPath = a ? evalPath(state, a) : ""; - } - return drvPath; - } - - string queryOutPath(EvalState & state) const - { - if (outPath == "") { - Expr a = attrs.get("outPath"); - if (!a) throw Error("output path missing"); - (string &) outPath = evalPath(state, a); - } - return outPath; - } + string queryDrvPath(EvalState & state) const; + string queryOutPath(EvalState & state) const; + MetaInfo queryMetaInfo(EvalState & state) const; void setDrvPath(const string & s) { |