1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 06:01:00 +01:00

Improve symlink handling

This commit is contained in:
Eelco Dolstra 2022-05-17 13:56:26 +02:00
parent 2a53574675
commit df2aa29690
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 51 additions and 22 deletions

View file

@ -31,6 +31,8 @@ struct InputAccessor
virtual Stat lstat(const CanonPath & path) = 0;
std::optional<Stat> maybeLstat(const CanonPath & path);
typedef std::optional<Type> DirEntry;
typedef std::map<std::string, DirEntry> DirEntries;
@ -101,6 +103,9 @@ struct SourcePath
InputAccessor::Stat lstat() const
{ return accessor.lstat(path); }
std::optional<InputAccessor::Stat> maybeLstat() const
{ return accessor.maybeLstat(path); }
InputAccessor::DirEntries readDirectory() const
{ return accessor.readDirectory(path); }
@ -132,6 +137,8 @@ struct SourcePath
{
return std::tie(accessor, path) < std::tie(x.accessor, x.path);
}
SourcePath resolveSymlinks() const;
};
std::ostream & operator << (std::ostream & str, const SourcePath & path);