1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00

computeBaseName(): Respect the original store path name

This commit is contained in:
Eelco Dolstra 2025-04-24 17:08:33 +02:00
parent 9d87ab1dc8
commit 2aa3655166

View file

@ -61,7 +61,7 @@ std::string EvalState::computeBaseName(const SourcePath & path)
"This can typically be avoided by rewriting an attribute like `src = ./.` " "This can typically be avoided by rewriting an attribute like `src = ./.` "
"to `src = builtins.path { path = ./.; name = \"source\"; }`.", "to `src = builtins.path { path = ./.; name = \"source\"; }`.",
path); path);
return std::string(fetchToStore(*store, path, FetchMode::DryRun).to_string()); return std::string(fetchToStore(*store, path, FetchMode::DryRun, storePath->name()).to_string());
} }
} }
return std::string(path.baseName()); return std::string(path.baseName());