about summary refs log tree commit diff
path: root/src/nix-store/xmlgraph.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-10-23T13·56+0200
committerGitHub <noreply@github.com>2018-10-23T13·56+0200
commit1a08ad75eab69d7b54b13111a654a486eac128db (patch)
tree8ee1249eaa3ff9f7e74edd80ada6d269fb0bcc49 /src/nix-store/xmlgraph.cc
parent3cd15c5b1f5a8e6de87d5b7e8cc2f1326b420c88 (diff)
parentd506342aa2b6945899988878b7c58de683cb573a (diff)
Merge pull request #2479 from nlewo/graphml
Add --graphml option to the nix-store --query command
Diffstat (limited to 'src/nix-store/xmlgraph.cc')
-rw-r--r--src/nix-store/xmlgraph.cc66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/nix-store/xmlgraph.cc b/src/nix-store/xmlgraph.cc
deleted file mode 100644
index 0f7be7f7a02d..000000000000
--- a/src/nix-store/xmlgraph.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "xmlgraph.hh"
-#include "util.hh"
-#include "store-api.hh"
-
-#include <iostream>
-
-
-using std::cout;
-
-namespace nix {
-
-
-static inline const string & xmlQuote(const string & s)
-{
-    // Luckily, store paths shouldn't contain any character that needs to be
-    // quoted.
-    return s;
-}
-
-
-static string makeEdge(const string & src, const string & dst)
-{
-    format f = format("  <edge src=\"%1%\" dst=\"%2%\"/>\n")
-      % xmlQuote(src) % xmlQuote(dst);
-    return f.str();
-}
-
-
-static string makeNode(const string & id)
-{
-    format f = format("  <node name=\"%1%\"/>\n") % xmlQuote(id);
-    return f.str();
-}
-
-
-void printXmlGraph(ref<Store> store, const PathSet & roots)
-{
-    PathSet workList(roots);
-    PathSet doneSet;
-
-    cout << "<?xml version='1.0' encoding='utf-8'?>\n"
-         << "<nix>\n";
-
-    while (!workList.empty()) {
-        Path path = *(workList.begin());
-        workList.erase(path);
-
-        if (doneSet.find(path) != doneSet.end()) continue;
-        doneSet.insert(path);
-
-        cout << makeNode(path);
-
-        for (auto & p : store->queryPathInfo(path)->references) {
-            if (p != path) {
-                workList.insert(p);
-                cout << makeEdge(p, path);
-            }
-        }
-
-    }
-
-    cout << "</nix>\n";
-}
-
-
-}