about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Maudoux <layus.on@gmail.com>2019-03-09T23·04+0100
committerGuillaume Maudoux <layus.on@gmail.com>2019-03-09T23·56+0100
commit9d7221183a6825d798267288ebe7d3e2adcd8cde (patch)
treec43ebea8f040bc0574282a5e0aaa61bb9c697db1
parent9d87e3fbd2c690f03eadbcada7ff8b880033155c (diff)
unify naming of roots as links & targets
-rw-r--r--src/nix-store/nix-store.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 11d0d573f077..b5530b39e1c2 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -428,10 +428,10 @@ static void opQuery(Strings opFlags, Strings opArgs)
                     referrers, true, settings.gcKeepOutputs, settings.gcKeepDerivations);
             }
             Roots roots = store->findRoots();
-            for (auto & [path, links] : roots)
-                if (referrers.find(path) != referrers.end())
+            for (auto & [target, links] : roots)
+                if (referrers.find(target) != referrers.end())
                     for (auto & link : links)
-                        cout << format("%1% -> %2%\n") % link % path;
+                        cout << format("%1% -> %2%\n") % link % target;
             break;
         }
 
@@ -592,9 +592,9 @@ static void opGC(Strings opFlags, Strings opArgs)
 
     if (printRoots) {
         Roots roots = store->findRoots();
-        for (auto & [path, roots] : roots)
-            for (auto & root : roots)
-                cout << root << " -> " << path << std::endl;
+        for (auto & [target, links] : roots)
+            for (auto & link : links)
+                cout << link << " -> " << target << std::endl;
     }
 
     else {