Skip to content

Commit

Permalink
package_downloader: Ensure creation of intermediate directories
Browse files Browse the repository at this point in the history
Packages in repositories are typically stored in a multi-level directory
structure. Previously, the `download()` method only created the final
directory in the destination path, failing if any intermediate
directories were missing. This patch ensures the entire destination path
is created.
  • Loading branch information
m-blaha committed Nov 20, 2024
1 parent 53cdd9c commit 23cb0c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libdnf5/repo/package_downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void PackageDownloader::download() try {
pkg_target.package.get_nevra());
}

std::filesystem::create_directory(pkg_target.destination);
std::filesystem::create_directories(pkg_target.destination);

if (auto * download_callbacks = pkg_target.package.get_base()->get_download_callbacks()) {
pkg_target.user_cb_data = download_callbacks->add_new_download(
Expand Down

0 comments on commit 23cb0c0

Please sign in to comment.