Skip to content

Commit

Permalink
[dnf5 plugin] config-manager
Browse files Browse the repository at this point in the history
Manage libdnf5 configuration.

Subcommands:
addrepo       Add a repository from the specified configuration file
              or create a new repository
setopts       Set configuration and repositories options
unsetopts     Uset/remove configuration and repositories options
setvars       Set variables
unsetvars     Unset/remove variables

Note:
Main configuration:
libdnf5 reads the distribution configuration from the drop-in directory
("/usr/share/dnf5/libdnf.conf.d") and system configuration from drop-in
directory ("/etc/dnf/libdnf5.conf.d"). Last, it loads the system
configuration file (by default "/etc/dnf/dnf.conf"). The latter has
the highest priority and is modified by config-manager.

Repository configuration:
Libdnf5 loads the repositories configuration and then loads the configuration
overrides. Configuration overrides are stored in files in
the "/usr/share/dnf5/repos.override.d" and "/etc/dnf/repos.override.d"
directories. The files are sorted alphabetically. The override from the next
file overrides the previous one - the last override value wins.
The config-manager writes the repositories configuration changes to the file
"/etc/dnf/repos.override.d/99-config-manager.repo".
  • Loading branch information
jrohel committed Nov 1, 2023
1 parent 35c6491 commit 24302fd
Show file tree
Hide file tree
Showing 17 changed files with 1,585 additions and 1 deletion.
1 change: 1 addition & 0 deletions dnf5-plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ include_directories("${PROJECT_SOURCE_DIR}/dnf5/include/")

add_subdirectory("builddep_plugin")
add_subdirectory("changelog_plugin")
add_subdirectory("config-manager_plugin")
add_subdirectory("copr_plugin")
add_subdirectory("repoclosure_plugin")
18 changes: 18 additions & 0 deletions dnf5-plugins/config-manager_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# set gettext domain for translations
add_definitions(-DGETTEXT_DOMAIN=\"dnf5_cmd_config-manager\")

add_library(config-manager_cmd_plugin MODULE config-manager.cpp addrepo.cpp setopts.cpp unsetopts.cpp setvars.cpp unsetvars.cpp config-manager_cmd_plugin.cpp)

# disable the 'lib' prefix in order to create changelog_cmd_plugin.so
set_target_properties(config-manager_cmd_plugin PROPERTIES PREFIX "")

pkg_check_modules(LIBFMT REQUIRED fmt)
target_link_libraries(libdnf5-cli PUBLIC ${LIBFMT_LIBRARIES})

find_package(CURL 7.62.0 REQUIRED)
include_directories(${CURL_INCLUDE_DIR})

target_link_libraries(config-manager_cmd_plugin PRIVATE libdnf5 libdnf5-cli)
target_link_libraries(config-manager_cmd_plugin PRIVATE dnf5)

install(TARGETS config-manager_cmd_plugin LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/dnf5/plugins/)
Loading

0 comments on commit 24302fd

Please sign in to comment.