mirror of
https://github.com/NixOS/nix
synced 2025-07-03 06:11:46 +02:00
rm isLink
isLink util is removed in favour of std::filesystem::is_symlink
This commit is contained in:
parent
52ccaf7971
commit
ddea4c6deb
6 changed files with 6 additions and 13 deletions
|
@ -33,8 +33,9 @@ Path IndirectRootStore::addPermRoot(const StorePath & storePath, const Path & _g
|
|||
|
||||
/* Don't clobber the link if it already exists and doesn't
|
||||
point to the Nix store. */
|
||||
if (pathExists(gcRoot) && (!isLink(gcRoot) || !isInStore(readLink(gcRoot))))
|
||||
if (pathExists(gcRoot) && (!std::filesystem::is_symlink(gcRoot) || !isInStore(readLink(gcRoot))))
|
||||
throw Error("cannot create symlink '%1%'; already exists", gcRoot);
|
||||
|
||||
makeSymlink(gcRoot, printStorePath(storePath));
|
||||
addIndirectRoot(gcRoot);
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ Path Store::followLinksToStore(std::string_view _path) const
|
|||
{
|
||||
Path path = absPath(std::string(_path));
|
||||
while (!isInStore(path)) {
|
||||
if (!isLink(path)) break;
|
||||
if (!std::filesystem::is_symlink(path)) break;
|
||||
auto target = readLink(path);
|
||||
path = absPath(target, dirOf(path));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue