aboutsummaryrefslogtreecommitdiff
path: root/src/fstate.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-10 13:41:28 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-10 13:41:28 +0000
commitd072485d2895d01dbbab1d899418726e3349343f (patch)
tree237c23cdb613d363e9205f89d51cac8433cf3b85 /src/fstate.cc
parent5d4b90b689b09965be39c69aceddaf0b165598d0 (diff)
* Get `nix-push' working again. It now uses Nix/Fix to create Nix
archives (using the package in corepkgs/nar). * queryPathByHash -> expandHash, and it takes an argument specifying the target path (which may be empty). * Install the core Fix packages in $prefix/share/fix. TODO: bootstrap Nix and install Nix as a Fix package.
Diffstat (limited to 'src/fstate.cc')
-rw-r--r--src/fstate.cc22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/fstate.cc b/src/fstate.cc
index e289ca7b1..fdd43d1b1 100644
--- a/src/fstate.cc
+++ b/src/fstate.cc
@@ -149,7 +149,7 @@ Hash hashTerm(ATerm t)
ATerm termFromHash(const Hash & hash, string * p)
{
- string path = queryPathByHash(hash);
+ string path = expandHash(hash);
if (p) *p = path;
ATerm t = ATreadFromNamedFile(path.c_str());
if (!t) throw Error(format("cannot read aterm %1%") % path);
@@ -253,26 +253,6 @@ static FState realise(FState fs, StringSet & paths)
/* Expand the hash into the target path. */
expandHash(hash, path);
-#if 0
- /* Perhaps the path already exists and has the right hash? */
- if (pathExists(path)) {
-
- if (hash != hashPath(path))
- throw Error(format("path %1% exists, but does not have hash %2%")
- % path % (string) hash);
-
- debug(format("path %1% already has hash %2%")
- % path % (string) hash);
-
- } else {
-
- /* Do we know a path with that hash? If so, copy it. */
- string path2 = queryPathByHash(hash);
- copyPath(path2, path);
-
- }
-#endif
-
return nf;
}