From a04c62e0c4f0f8d3bd9cda21173a0193be9eda8a Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <e.dolstra@tudelft.nl>
Date: Wed, 23 Mar 2005 12:06:57 +0000
Subject: [PATCH] * Canonicalise path meta-data in `nix-store
 --register-validity'.

---
 src/nix-store/main.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc
index f7b2233e4..956cbb4fb 100644
--- a/src/nix-store/main.cc
+++ b/src/nix-store/main.cc
@@ -423,8 +423,11 @@ static void opRegisterValidity(Strings opFlags, Strings opArgs)
             references.insert(s);
         }
         if (!cin || cin.eof()) throw Error("missing input");
-        if (!isValidPathTxn(txn, path))
+        if (!isValidPathTxn(txn, path)) {
+            /* !!! races */
+            canonicalisePathMetaData(path);
             registerValidPath(txn, path, hashPath(htSHA256, path), references, deriver);
+        }
     }
 
     txn.commit();