about summary refs log tree commit diff
path: root/src/nix-instantiate/nix-instantiate.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-27T15·09-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-27T15·09-0400
commite94806d03098f1d6e654542500bbea1eaa0ec60b (patch)
tree4e967f3d39a984d86bb93849d76cab92512a07ce /src/nix-instantiate/nix-instantiate.cc
parent9c2decaa1935ae4bf99a9b723d4eab188f8f88ef (diff)
parenta9e6752bbd888ab8fbc1cda6e4d539b2858c4cef (diff)
Merge branch 'master' into no-manifests
Diffstat (limited to 'src/nix-instantiate/nix-instantiate.cc')
-rw-r--r--src/nix-instantiate/nix-instantiate.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index 270b4ddc2e90..beb7fa024959 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -64,9 +64,11 @@ void processExpr(EvalState & state, const Strings & attrPaths,
                     Path drvPath = i->queryDrvPath(state);
                     if (gcRoot == "")
                         printGCWarning();
-                    else
-                        drvPath = addPermRoot(*store, drvPath,
-                            makeRootName(gcRoot, rootNr), indirectRoot);
+                    else {
+                        Path rootName = gcRoot;
+                        if (++rootNr > 1) rootName += "-" + int2String(rootNr);
+                        drvPath = addPermRoot(*store, drvPath, rootName, indirectRoot);
+                    }
                     std::cout << format("%1%\n") % drvPath;
                 }
             }