Skip to content

Commit

Permalink
Use libdnf5/utils/fs/temp.hpp in copr plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura committed Nov 28, 2023
1 parent 1764e21 commit 9f67c83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 43 deletions.
9 changes: 5 additions & 4 deletions dnf5-plugins/copr_plugin/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.
#include "json.hpp"

#include "download_file.hpp"
#include "tempfile.hpp"

#include "libdnf5/utils/fs/temp.hpp"

#include <fstream>
#include <iostream>

Json::Json(libdnf5::Base & base, const std::string & url) {
auto temp_file = TempFile();
download_file(base, url, temp_file.path);
std::ifstream file(temp_file.path);
auto temp_file = libdnf5::utils::fs::TempFile("/tmp", "dnf5-copr-plugin");
download_file(base, url, temp_file.get_path());
std::ifstream file(temp_file.get_path());
std::stringstream buffer;
buffer << file.rdbuf();
root = json_tokener_parse(buffer.str().c_str());
Expand Down
39 changes: 0 additions & 39 deletions dnf5-plugins/copr_plugin/tempfile.hpp

This file was deleted.

0 comments on commit 9f67c83

Please sign in to comment.