mirror of
https://github.com/NixOS/nix.git
synced 2025-11-27 20:51:00 +01:00
* 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.
This commit is contained in:
parent
5d4b90b689
commit
d072485d28
16 changed files with 154 additions and 54 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue