1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 19:57:59 +02:00

* Make dbRefs a mapping from Hash to [Path].

This commit is contained in:
Eelco Dolstra 2003-07-07 09:25:26 +00:00
parent 609a224848
commit 5895c160c4
11 changed files with 172 additions and 49 deletions

View file

@ -33,13 +33,18 @@ string absPath(string path, string dir)
dir = buf;
}
path = dir + "/" + path;
/* !!! canonicalise */
char resolved[PATH_MAX];
if (!realpath(path.c_str(), resolved))
throw SysError(format("cannot canonicalise path %1%") % path);
path = resolved;
}
return path;
return canonPath(path);
}
string canonPath(const string & path)
{
char resolved[PATH_MAX];
if (!realpath(path.c_str(), resolved))
throw SysError(format("cannot canonicalise path `%1%'") % path);
/* !!! check that this removes trailing slashes */
return resolved;
}