Skip to content

Commit 84c4049

Browse files
authored
Merge pull request NixOS#12778 from NixOS/mergify/bp/2.27-maintenance/pr-12767
use createDirs consistently everywhere (backport NixOS#12767)
2 parents 52049bc + e308524 commit 84c4049

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/libstore/builtins/unpack-channel.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ void builtinUnpackChannel(
2323
throw Error("channelName is not allowed to contain filesystem separators, got %1%", channelName);
2424
}
2525

26-
try {
27-
fs::create_directories(out);
28-
} catch (fs::filesystem_error &) {
29-
throw SysError("creating directory '%1%'", out.string());
30-
}
26+
createDirs(out);
3127

3228
unpackTarfile(src, out);
3329

src/libutil/tarfile.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@ void unpackTarfile(Source & source, const fs::path & destDir)
166166
{
167167
auto archive = TarArchive(source);
168168

169-
fs::create_directories(destDir);
169+
createDirs(destDir);
170170
extract_archive(archive, destDir);
171171
}
172172

173173
void unpackTarfile(const fs::path & tarFile, const fs::path & destDir)
174174
{
175175
auto archive = TarArchive(tarFile);
176176

177-
fs::create_directories(destDir);
177+
createDirs(destDir);
178178
extract_archive(archive, destDir);
179179
}
180180

src/nix/flake.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
905905
std::function<void(const SourcePath & from, const fs::path & to)> copyDir;
906906
copyDir = [&](const SourcePath & from, const fs::path & to)
907907
{
908-
fs::create_directories(to);
908+
createDirs(to);
909909

910910
for (auto & [name, entry] : from.readDirectory()) {
911911
checkInterrupt();

0 commit comments

Comments
 (0)