mirror of
https://github.com/NixOS/nix
synced 2025-06-29 06:21:14 +02:00
nix flake: clarify error message when file is an unknown type
This commit is contained in:
parent
2d9b213cc2
commit
22adffec34
7 changed files with 59 additions and 13 deletions
|
@ -5,6 +5,26 @@ namespace nix {
|
|||
|
||||
static std::atomic<size_t> nextNumber{0};
|
||||
|
||||
bool SourceAccessor::Stat::isNotNARSerialisable()
|
||||
{
|
||||
return this->type != tRegular && this->type != tSymlink && this->type != tDirectory;
|
||||
}
|
||||
|
||||
std::string SourceAccessor::Stat::typeString() {
|
||||
switch (this->type) {
|
||||
case tRegular: return "regular";
|
||||
case tSymlink: return "symlink";
|
||||
case tDirectory: return "directory";
|
||||
case tChar: return "character device";
|
||||
case tBlock: return "block device";
|
||||
case tSocket: return "socket";
|
||||
case tFifo: return "fifo";
|
||||
case tUnknown:
|
||||
default: return "unknown";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
SourceAccessor::SourceAccessor()
|
||||
: number(++nextNumber)
|
||||
, displayPrefix{"«unknown»"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue