about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-01-23T16·57+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-01-23T16·57+0000
commitfac63d6416ae0f7aec6c986d9d258b25047a24e2 (patch)
tree9955cb6a2a800ee6d3f81cfa000d0c175e78e5f7 /src/libstore
parentbae75ca5a18edbb9fb959e2e48065a1987ffb61a (diff)
* exportReferencesGraph: work on paths within store paths as well.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 9bcf336a4f66..1789eeda2f50 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1411,11 +1411,19 @@ void DerivationGoal::startBuilder()
         throw BuildError(format("odd number of tokens in `exportReferencesGraph': `%1%'") % s);
     for (Strings::iterator i = ss.begin(); i != ss.end(); ) {
         string fileName = *i++;
+        checkStoreName(fileName); /* !!! abuse of this function */
+
+        /* Check that the store path is valid. */
         Path storePath = *i++;
+        if (!isInStore(storePath))
+            throw BuildError(format("`exportReferencesGraph' contains a non-store path `%1%'")
+                % storePath);
+        storePath = toStorePath(storePath);
         if (!store->isValidPath(storePath))
-            throw BuildError(format("`exportReferencesGraph' refers to an invalid path `%1%'")
+            throw BuildError(format("`exportReferencesGraph' contains an invalid path `%1%'")
                 % storePath);
-        checkStoreName(fileName); /* !!! abuse of this function */
+
+        /* Write closure info to `fileName'. */
         PathSet refs;
         computeFSClosure(storePath, refs);
         /* !!! in secure Nix, the writing should be done on the