about summary refs log tree commit diff
path: root/src/nix-store
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/help.txt2
-rw-r--r--src/nix-store/nix-store.cc66
2 files changed, 2 insertions, 66 deletions
diff --git a/src/nix-store/help.txt b/src/nix-store/help.txt
index df84a2a763bc..0662f67962c7 100644
--- a/src/nix-store/help.txt
+++ b/src/nix-store/help.txt
@@ -11,8 +11,6 @@ Operations:
   --query / -q: query information
   --read-log / -l: print build log of given store paths
 
-  --register-substitutes: register a substitute expression (dangerous!)
-  --clear-substitutes: clear all substitutes
   --register-validity: register path validity (dangerous!)
   --check-validity: check path validity
 
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index c600a5b9a7dc..176dc39f9bf6 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -413,54 +413,6 @@ static void opReadLog(Strings opFlags, Strings opArgs)
 }
 
 
-static void opRegisterSubstitutes(Strings opFlags, Strings opArgs)
-{
-    if (!opFlags.empty()) throw UsageError("unknown flag");
-    if (!opArgs.empty()) throw UsageError("no arguments expected");
-
-    Transaction txn;
-    createStoreTransaction(txn);
-
-    while (1) {
-        Path srcPath;
-        Substitute sub;
-        PathSet references;
-        getline(cin, srcPath);
-        if (cin.eof()) break;
-        getline(cin, sub.deriver);
-        getline(cin, sub.program);
-        string s; int n;
-        getline(cin, s);
-        if (!string2Int(s, n)) throw Error("number expected");
-        while (n--) {
-            getline(cin, s);
-            sub.args.push_back(s);
-        }
-        getline(cin, s);
-        if (!string2Int(s, n)) throw Error("number expected");
-        while (n--) {
-            getline(cin, s);
-            references.insert(s);
-        }
-        if (!cin || cin.eof()) throw Error("missing input");
-        registerSubstitute(txn, srcPath, sub);
-        setReferences(txn, srcPath, references);
-    }
-
-    txn.commit();
-}
-
-
-static void opClearSubstitutes(Strings opFlags, Strings opArgs)
-{
-    if (!opFlags.empty()) throw UsageError("unknown flag");
-    if (!opArgs.empty())
-        throw UsageError("no arguments expected");
-
-    clearSubstitutes();
-}
-
-
 static void opRegisterValidity(Strings opFlags, Strings opArgs)
 {
     bool reregister = false; // !!! maybe this should be the default
@@ -475,18 +427,8 @@ static void opRegisterValidity(Strings opFlags, Strings opArgs)
     ValidPathInfos infos;
     
     while (1) {
-        ValidPathInfo info;
-        getline(cin, info.path);
-        if (cin.eof()) break;
-        getline(cin, info.deriver);
-        string s; int n;
-        getline(cin, s);
-        if (!string2Int(s, n)) throw Error("number expected");
-        while (n--) {
-            getline(cin, s);
-            info.references.insert(s);
-        }
-        if (!cin || cin.eof()) throw Error("missing input");
+        ValidPathInfo info = decodeValidPathInfo(cin);
+        if (info.path == "") break;
         if (!store->isValidPath(info.path) || reregister) {
             /* !!! races */
             canonicalisePathMetaData(info.path);
@@ -699,10 +641,6 @@ void run(Strings args)
             op = opQuery;
         else if (arg == "--read-log" || arg == "-l")
             op = opReadLog;
-        else if (arg == "--register-substitutes")
-            op = opRegisterSubstitutes;
-        else if (arg == "--clear-substitutes")
-            op = opClearSubstitutes;
         else if (arg == "--register-validity")
             op = opRegisterValidity;
         else if (arg == "--check-validity")