about summary refs log tree commit diff
path: root/src/nix-env/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-17T10·15+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-17T10·15+0000
commit46b631b6c4a743b88bf2d6bb779c0f677e9b8318 (patch)
tree5d076a1799a336e7ca087442e59105b881904673 /src/nix-env/main.cc
parentd7efd7639420f4c840cbfdfcbbb3c45292f3ac54 (diff)
* Don't generate an empty drvPath attribute in the manifest.
Diffstat (limited to 'src/nix-env/main.cc')
-rw-r--r--src/nix-env/main.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc
index b55fc2246e94..f6b3cbdfb443 100644
--- a/src/nix-env/main.cc
+++ b/src/nix-env/main.cc
@@ -165,19 +165,19 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
          i != elems.end(); ++i)
     {
         Path drvPath = keepDerivations ? i->queryDrvPath(state) : "";
-        ATerm t = makeAttrs(ATmakeList5(
+        ATermList as = ATmakeList4(
             makeBind(toATerm("type"),
                 makeStr("derivation"), makeNoPos()),
             makeBind(toATerm("name"),
                 makeStr(i->name), makeNoPos()),
             makeBind(toATerm("system"),
                 makeStr(i->system), makeNoPos()),
-            makeBind(toATerm("drvPath"),
-                makeStr(drvPath), makeNoPos()),
             makeBind(toATerm("outPath"),
-                makeStr(i->queryOutPath(state)), makeNoPos())
-            ));
-        manifest = ATinsert(manifest, t);
+                makeStr(i->queryOutPath(state)), makeNoPos()));
+        if (drvPath != "") as = ATinsert(as, 
+            makeBind(toATerm("drvPath"),
+                makeStr(drvPath), makeNoPos()));
+        manifest = ATinsert(manifest, makeAttrs(as));
         inputs = ATinsert(inputs, makeStr(i->queryOutPath(state)));
 
         /* This is only necessary when installing store paths, e.g.,