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:
parent
2a53574675
commit
df2aa29690
7 changed files with 51 additions and 22 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue