mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 07:22:43 +01:00
Merge pull request #12667 from NixOS/in-dir-cleanup
Cleanup `isInDir` and `isDirOrInDir`
This commit is contained in:
commit
3d333e0aff
5 changed files with 16 additions and 18 deletions
|
|
@ -245,7 +245,7 @@ void LocalStore::findRoots(const Path & path, std::filesystem::file_type type, R
|
|||
else {
|
||||
target = absPath(target, dirOf(path));
|
||||
if (!pathExists(target)) {
|
||||
if (isInDir(path, stateDir + "/" + gcRootsDir + "/auto")) {
|
||||
if (isInDir(path, std::filesystem::path{stateDir.get()} / gcRootsDir / "auto")) {
|
||||
printInfo("removing stale link from '%1%' to '%2%'", path, target);
|
||||
unlink(path.c_str());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1046,7 +1046,7 @@ void LocalDerivationGoal::startBuilder()
|
|||
/* If only we had a trie to do this more efficiently :) luckily, these are generally going to be pretty small */
|
||||
for (auto & a : allowedPaths) {
|
||||
Path canonA = canonPath(a);
|
||||
if (canonI == canonA || isInDir(canonI, canonA)) {
|
||||
if (isDirOrInDir(canonI, canonA)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue