about summary refs log tree commit diff
path: root/src/values.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-06-23T14·40+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-06-23T14·40+0000
commit692b562342ac7ead43ef06497f6a8b4b6e724ae5 (patch)
tree4cd87673fff6af4c6c5501b274bfc1023246aaba /src/values.cc
parentc0cbaef4bece0c2447828739dd9622c329948064 (diff)
* `nix --delete' command.
Diffstat (limited to 'src/values.cc')
-rw-r--r--src/values.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/values.cc b/src/values.cc
index 22f84c83e61b..c8a3b58cb9e4 100644
--- a/src/values.cc
+++ b/src/values.cc
@@ -135,6 +135,18 @@ string fetchURL(string url)
 #endif
 
 
+void deleteValue(Hash hash)
+{
+    string name;
+    if (queryDB(nixDB, dbRefs, hash, name)) {
+        string fn = absValuePath(name);
+        deletePath(fn);
+        delDB(nixDB, dbRefs, hash);
+    }
+}
+
+
+/* !!! bad name, "query" implies no side effect => getValuePath() */
 string queryValuePath(Hash hash)
 {
     bool checkedNet = false;