From 1764e21497bc76fed40154793bbc81b65d37b69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Tue, 28 Nov 2023 09:21:04 +0100 Subject: [PATCH] Expose utis/fs/file.hpp and temp.hpp on API This will be used from plugins and dnf5. --- {libdnf5 => include/libdnf5}/utils/fs/file.hpp | 0 {libdnf5 => include/libdnf5}/utils/fs/temp.hpp | 0 libdnf5/conf/config_main.cpp | 2 +- libdnf5/conf/config_parser.cpp | 2 +- libdnf5/conf/vars.cpp | 2 +- libdnf5/module/module_sack.cpp | 2 +- libdnf5/repo/repo.cpp | 2 +- libdnf5/repo/repo_cache.cpp | 2 +- libdnf5/repo/repo_downloader.cpp | 2 +- libdnf5/repo/repo_pgp.cpp | 3 +-- libdnf5/repo/repo_sack.cpp | 4 ++-- libdnf5/repo/solv_repo.cpp | 2 +- libdnf5/repo/solv_repo.hpp | 2 +- libdnf5/repo/temp_files_memory.cpp | 2 +- libdnf5/rpm/rpm_signature.cpp | 2 +- libdnf5/system/state.cpp | 2 +- libdnf5/utils/fs/file.cpp | 2 +- libdnf5/utils/fs/temp.cpp | 2 +- libdnf5/utils/iniparser.hpp | 3 +-- test/libdnf5/comps/test_group.cpp | 3 ++- test/libdnf5/conf/test_config_parser.cpp | 4 ++-- test/libdnf5/iniparser/test_iniparser.cpp | 5 +++-- test/libdnf5/module/test_module.cpp | 3 ++- test/libdnf5/repo/test_package_downloader.cpp | 3 ++- test/libdnf5/system/test_state.cpp | 3 ++- test/libdnf5/system/test_state.hpp | 3 ++- test/libdnf5/transaction/transaction_test_base.hpp | 2 +- test/libdnf5/utils/test_fs.hpp | 4 ++-- test/shared/base_test_case.hpp | 3 ++- test/shared/test_case_fixture.hpp | 2 +- test/tutorial/test_tutorial.hpp | 2 +- 31 files changed, 40 insertions(+), 35 deletions(-) rename {libdnf5 => include/libdnf5}/utils/fs/file.hpp (100%) rename {libdnf5 => include/libdnf5}/utils/fs/temp.hpp (100%) diff --git a/libdnf5/utils/fs/file.hpp b/include/libdnf5/utils/fs/file.hpp similarity index 100% rename from libdnf5/utils/fs/file.hpp rename to include/libdnf5/utils/fs/file.hpp diff --git a/libdnf5/utils/fs/temp.hpp b/include/libdnf5/utils/fs/temp.hpp similarity index 100% rename from libdnf5/utils/fs/temp.hpp rename to include/libdnf5/utils/fs/temp.hpp diff --git a/libdnf5/conf/config_main.cpp b/libdnf5/conf/config_main.cpp index f300b918e..379cfe27b 100644 --- a/libdnf5/conf/config_main.cpp +++ b/libdnf5/conf/config_main.cpp @@ -21,12 +21,12 @@ along with libdnf. If not, see . #include "config.h" #include "config_utils.hpp" -#include "utils/fs/file.hpp" #include "libdnf5/common/xdg.hpp" #include "libdnf5/conf/config_parser.hpp" #include "libdnf5/conf/const.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" #include diff --git a/libdnf5/conf/config_parser.cpp b/libdnf5/conf/config_parser.cpp index 6c60e5b27..54b69e2cc 100644 --- a/libdnf5/conf/config_parser.cpp +++ b/libdnf5/conf/config_parser.cpp @@ -19,10 +19,10 @@ along with libdnf. If not, see . #include "libdnf5/conf/config_parser.hpp" -#include "utils/fs/file.hpp" #include "utils/iniparser.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" #include diff --git a/libdnf5/conf/vars.cpp b/libdnf5/conf/vars.cpp index dedf6ce6a..84f9dc4e5 100644 --- a/libdnf5/conf/vars.cpp +++ b/libdnf5/conf/vars.cpp @@ -20,12 +20,12 @@ along with libdnf. If not, see . #include "libdnf5/conf/vars.hpp" #include "rpm/rpm_log_guard.hpp" -#include "utils/fs/file.hpp" #include "libdnf5/base/base.hpp" #include "libdnf5/common/exception.hpp" #include "libdnf5/rpm/arch.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" #include #include diff --git a/libdnf5/module/module_sack.cpp b/libdnf5/module/module_sack.cpp index 8746e8476..27badf4d0 100644 --- a/libdnf5/module/module_sack.cpp +++ b/libdnf5/module/module_sack.cpp @@ -23,7 +23,6 @@ along with libdnf. If not, see . #include "module/module_metadata.hpp" #include "module/module_sack_impl.hpp" #include "solv/solv_map.hpp" -#include "utils/fs/file.hpp" #include "libdnf5/base/base.hpp" #include "libdnf5/base/base_weak.hpp" @@ -34,6 +33,7 @@ along with libdnf. If not, see . #include "libdnf5/module/module_sack_weak.hpp" #include "libdnf5/module/nsvcap.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" #include diff --git a/libdnf5/repo/repo.cpp b/libdnf5/repo/repo.cpp index 0a9c1bb01..f1c4543cd 100644 --- a/libdnf5/repo/repo.cpp +++ b/libdnf5/repo/repo.cpp @@ -23,13 +23,13 @@ constexpr const char * REPOID_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmno #include "repo_downloader.hpp" #include "rpm/package_sack_impl.hpp" #include "solv_repo.hpp" -#include "utils/fs/file.hpp" #include "utils/string.hpp" #include "libdnf5/common/exception.hpp" #include "libdnf5/conf/const.hpp" #include "libdnf5/logger/logger.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" extern "C" { #include diff --git a/libdnf5/repo/repo_cache.cpp b/libdnf5/repo/repo_cache.cpp index 062173b2f..01ad6c230 100644 --- a/libdnf5/repo/repo_cache.cpp +++ b/libdnf5/repo/repo_cache.cpp @@ -19,11 +19,11 @@ along with libdnf. If not, see . #include "repo_cache_private.hpp" -#include "utils/fs/file.hpp" #include "libdnf5/base/base.hpp" #include "libdnf5/logger/logger.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" namespace libdnf5::repo { diff --git a/libdnf5/repo/repo_downloader.cpp b/libdnf5/repo/repo_downloader.cpp index db1d8c470..9deb2bab9 100644 --- a/libdnf5/repo/repo_downloader.cpp +++ b/libdnf5/repo/repo_downloader.cpp @@ -19,7 +19,6 @@ along with libdnf. If not, see . #include "repo_downloader.hpp" -#include "utils/fs/temp.hpp" #include "utils/fs/utils.hpp" #include "utils/string.hpp" @@ -27,6 +26,7 @@ along with libdnf. If not, see . #include "libdnf5/conf/const.hpp" #include "libdnf5/repo/repo_errors.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/temp.hpp" #include #include diff --git a/libdnf5/repo/repo_pgp.cpp b/libdnf5/repo/repo_pgp.cpp index b3130214a..fc0c8bcaf 100644 --- a/libdnf5/repo/repo_pgp.cpp +++ b/libdnf5/repo/repo_pgp.cpp @@ -19,12 +19,11 @@ along with libdnf. If not, see . #include "repo_pgp.hpp" -#include "utils/fs/temp.hpp" - #include "libdnf5/base/base.hpp" #include "libdnf5/logger/logger.hpp" #include "libdnf5/repo/repo_errors.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/temp.hpp" #include diff --git a/libdnf5/repo/repo_sack.cpp b/libdnf5/repo/repo_sack.cpp index 6ae116aac..6f364f9b9 100644 --- a/libdnf5/repo/repo_sack.cpp +++ b/libdnf5/repo/repo_sack.cpp @@ -26,8 +26,6 @@ along with libdnf. If not, see . #include "rpm/package_sack_impl.hpp" #include "solv/solver.hpp" #include "solv_repo.hpp" -#include "utils/fs/file.hpp" -#include "utils/fs/temp.hpp" #include "utils/fs/utils.hpp" #include "utils/string.hpp" #include "utils/url.hpp" @@ -42,6 +40,8 @@ along with libdnf. If not, see . #include "libdnf5/conf/option_bool.hpp" #include "libdnf5/repo/file_downloader.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" +#include "libdnf5/utils/fs/temp.hpp" extern "C" { #include diff --git a/libdnf5/repo/solv_repo.cpp b/libdnf5/repo/solv_repo.cpp index 3dbd90445..6e9329b34 100644 --- a/libdnf5/repo/solv_repo.cpp +++ b/libdnf5/repo/solv_repo.cpp @@ -22,10 +22,10 @@ along with libdnf. If not, see . #include "base/base_impl.hpp" #include "repo_cache_private.hpp" #include "solv/pool.hpp" -#include "utils/fs/temp.hpp" #include "libdnf5/base/base.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/temp.hpp" #include "libdnf5/utils/to_underlying.hpp" extern "C" { diff --git a/libdnf5/repo/solv_repo.hpp b/libdnf5/repo/solv_repo.hpp index e6f7fe10f..f3f9b822a 100644 --- a/libdnf5/repo/solv_repo.hpp +++ b/libdnf5/repo/solv_repo.hpp @@ -23,11 +23,11 @@ along with libdnf. If not, see . #include "repo_downloader.hpp" #include "solv/id_queue.hpp" #include "solv/pool.hpp" -#include "utils/fs/file.hpp" #include "libdnf5/base/base_weak.hpp" #include "libdnf5/common/exception.hpp" #include "libdnf5/repo/config_repo.hpp" +#include "libdnf5/utils/fs/file.hpp" #include diff --git a/libdnf5/repo/temp_files_memory.cpp b/libdnf5/repo/temp_files_memory.cpp index 4b2d69697..2d3b1fe27 100644 --- a/libdnf5/repo/temp_files_memory.cpp +++ b/libdnf5/repo/temp_files_memory.cpp @@ -19,12 +19,12 @@ along with libdnf. If not, see . #include "temp_files_memory.hpp" -#include "utils/fs/file.hpp" #include "utils/string.hpp" #include "libdnf5/base/base.hpp" #include "libdnf5/common/exception.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" #include diff --git a/libdnf5/rpm/rpm_signature.cpp b/libdnf5/rpm/rpm_signature.cpp index 0d892d4b4..d9373510a 100644 --- a/libdnf5/rpm/rpm_signature.cpp +++ b/libdnf5/rpm/rpm_signature.cpp @@ -21,7 +21,6 @@ along with libdnf. If not, see . #include "repo/repo_pgp.hpp" #include "rpm/rpm_log_guard.hpp" -#include "utils/fs/temp.hpp" #include "utils/string.hpp" #include "utils/url.hpp" @@ -29,6 +28,7 @@ along with libdnf. If not, see . #include "libdnf5/repo/repo.hpp" #include "libdnf5/utils/bgettext/bgettext-lib.h" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/temp.hpp" #include #include diff --git a/libdnf5/system/state.cpp b/libdnf5/system/state.cpp index a9eded5a5..e14775f2b 100644 --- a/libdnf5/system/state.cpp +++ b/libdnf5/system/state.cpp @@ -19,10 +19,10 @@ along with libdnf. If not, see . #include "system/state.hpp" -#include "utils/fs/file.hpp" #include "utils/string.hpp" #include "libdnf5/utils/bgettext/bgettext-mark-domain.h" +#include "libdnf5/utils/fs/file.hpp" #include #include diff --git a/libdnf5/utils/fs/file.cpp b/libdnf5/utils/fs/file.cpp index 7ef172c1a..fb512f104 100644 --- a/libdnf5/utils/fs/file.cpp +++ b/libdnf5/utils/fs/file.cpp @@ -18,7 +18,7 @@ along with libdnf. If not, see . */ -#include "file.hpp" +#include "libdnf5/utils/fs/file.hpp" #include "libdnf5/common/exception.hpp" diff --git a/libdnf5/utils/fs/temp.cpp b/libdnf5/utils/fs/temp.cpp index 256c657dc..56453b635 100644 --- a/libdnf5/utils/fs/temp.cpp +++ b/libdnf5/utils/fs/temp.cpp @@ -18,7 +18,7 @@ along with libdnf. If not, see . */ -#include "temp.hpp" +#include "libdnf5/utils/fs/temp.hpp" #include "libdnf5/common/exception.hpp" diff --git a/libdnf5/utils/iniparser.hpp b/libdnf5/utils/iniparser.hpp index 209c4fd05..f585ef949 100644 --- a/libdnf5/utils/iniparser.hpp +++ b/libdnf5/utils/iniparser.hpp @@ -20,9 +20,8 @@ along with libdnf. If not, see . #ifndef LIBDNF5_UTILS_INIPARSER_HPP #define LIBDNF5_UTILS_INIPARSER_HPP -#include "utils/fs/file.hpp" - #include "libdnf5/common/exception.hpp" +#include "libdnf5/utils/fs/file.hpp" #include #include diff --git a/test/libdnf5/comps/test_group.cpp b/test/libdnf5/comps/test_group.cpp index bc4a26f5a..b1576bef6 100644 --- a/test/libdnf5/comps/test_group.cpp +++ b/test/libdnf5/comps/test_group.cpp @@ -21,7 +21,8 @@ along with libdnf. If not, see . #include "test_group.hpp" #include "../shared/utils.hpp" -#include "utils/fs/file.hpp" + +#include "libdnf5/utils/fs/file.hpp" #include #include diff --git a/test/libdnf5/conf/test_config_parser.cpp b/test/libdnf5/conf/test_config_parser.cpp index be65ff84e..e0730bef8 100644 --- a/test/libdnf5/conf/test_config_parser.cpp +++ b/test/libdnf5/conf/test_config_parser.cpp @@ -19,8 +19,8 @@ along with libdnf. If not, see . #include "test_config_parser.hpp" -#include "utils/fs/file.hpp" -#include "utils/fs/temp.hpp" +#include "libdnf5/utils/fs/file.hpp" +#include "libdnf5/utils/fs/temp.hpp" #include diff --git a/test/libdnf5/iniparser/test_iniparser.cpp b/test/libdnf5/iniparser/test_iniparser.cpp index 4ad73148d..671287c5e 100644 --- a/test/libdnf5/iniparser/test_iniparser.cpp +++ b/test/libdnf5/iniparser/test_iniparser.cpp @@ -19,10 +19,11 @@ along with libdnf. If not, see . #include "test_iniparser.hpp" -#include "utils/fs/file.hpp" -#include "utils/fs/temp.hpp" #include "utils/iniparser.hpp" +#include "libdnf5/utils/fs/file.hpp" +#include "libdnf5/utils/fs/temp.hpp" + #include #include diff --git a/test/libdnf5/module/test_module.cpp b/test/libdnf5/module/test_module.cpp index 6a8e2e635..86acb1289 100644 --- a/test/libdnf5/module/test_module.cpp +++ b/test/libdnf5/module/test_module.cpp @@ -25,7 +25,8 @@ along with libdnf. If not, see . #include "base/base_impl.hpp" #include "module/module_db.hpp" #include "system/state.hpp" -#include "utils/fs/file.hpp" + +#include "libdnf5/utils/fs/file.hpp" #include #include diff --git a/test/libdnf5/repo/test_package_downloader.cpp b/test/libdnf5/repo/test_package_downloader.cpp index b7593750e..6277f58fc 100644 --- a/test/libdnf5/repo/test_package_downloader.cpp +++ b/test/libdnf5/repo/test_package_downloader.cpp @@ -21,9 +21,10 @@ along with libdnf. If not, see . #include "../shared/utils.hpp" #include "repo/temp_files_memory.hpp" -#include "utils/fs/file.hpp" #include "utils/string.hpp" +#include "libdnf5/utils/fs/file.hpp" + #include #include #include diff --git a/test/libdnf5/system/test_state.cpp b/test/libdnf5/system/test_state.cpp index ef91dc41a..8b3ce6182 100644 --- a/test/libdnf5/system/test_state.cpp +++ b/test/libdnf5/system/test_state.cpp @@ -21,7 +21,8 @@ along with libdnf. If not, see . #include "test_state.hpp" #include "../shared/utils.hpp" -#include "utils/fs/file.hpp" + +#include "libdnf5/utils/fs/file.hpp" CPPUNIT_TEST_SUITE_REGISTRATION(StateTest); diff --git a/test/libdnf5/system/test_state.hpp b/test/libdnf5/system/test_state.hpp index 10a205089..35779a1e3 100644 --- a/test/libdnf5/system/test_state.hpp +++ b/test/libdnf5/system/test_state.hpp @@ -24,7 +24,8 @@ along with libdnf. If not, see . #include "../shared/base_test_case.hpp" #include "system/state.hpp" -#include "utils/fs/temp.hpp" + +#include "libdnf5/utils/fs/temp.hpp" #include #include diff --git a/test/libdnf5/transaction/transaction_test_base.hpp b/test/libdnf5/transaction/transaction_test_base.hpp index 7a9f86143..ef88a3bc2 100644 --- a/test/libdnf5/transaction/transaction_test_base.hpp +++ b/test/libdnf5/transaction/transaction_test_base.hpp @@ -22,7 +22,7 @@ along with libdnf. If not, see . #define LIBDNF5_TEST_TRANSACTION_TRANSACTION_TEST_BASE_HPP -#include "utils/fs/temp.hpp" +#include "libdnf5/utils/fs/temp.hpp" #include #include diff --git a/test/libdnf5/utils/test_fs.hpp b/test/libdnf5/utils/test_fs.hpp index 474bd49de..b7aee6da7 100644 --- a/test/libdnf5/utils/test_fs.hpp +++ b/test/libdnf5/utils/test_fs.hpp @@ -22,8 +22,8 @@ along with libdnf. If not, see . #define LIBDNF5_TEST_UTILS_FS_HPP -#include "utils/fs/file.hpp" -#include "utils/fs/temp.hpp" +#include "libdnf5/utils/fs/file.hpp" +#include "libdnf5/utils/fs/temp.hpp" #include #include diff --git a/test/shared/base_test_case.hpp b/test/shared/base_test_case.hpp index 6f96e7aa7..f25248cb6 100644 --- a/test/shared/base_test_case.hpp +++ b/test/shared/base_test_case.hpp @@ -22,7 +22,8 @@ along with libdnf. If not, see . #define TEST_LIBDNF5_BASE_TEST_CASE_HPP #include "test_case_fixture.hpp" -#include "utils/fs/temp.hpp" + +#include "libdnf5/utils/fs/temp.hpp" #include #include diff --git a/test/shared/test_case_fixture.hpp b/test/shared/test_case_fixture.hpp index a909f563b..41f167bc6 100644 --- a/test/shared/test_case_fixture.hpp +++ b/test/shared/test_case_fixture.hpp @@ -21,7 +21,7 @@ along with libdnf. If not, see . #ifndef TEST_LIBDNF5_TESTCASE_FIXTURE_HPP #define TEST_LIBDNF5_TESTCASE_FIXTURE_HPP -#include "utils/fs/temp.hpp" +#include "libdnf5/utils/fs/temp.hpp" #include #include diff --git a/test/tutorial/test_tutorial.hpp b/test/tutorial/test_tutorial.hpp index 60772e0fe..bd273bda7 100644 --- a/test/tutorial/test_tutorial.hpp +++ b/test/tutorial/test_tutorial.hpp @@ -22,7 +22,7 @@ along with libdnf. If not, see . #define TEST_TUTORIAL_TEST_TUTORIAL_HPP -#include "utils/fs/temp.hpp" +#include "libdnf5/utils/fs/temp.hpp" #include