Skip to content

Commit

Permalink
Implement reposync plugin
Browse files Browse the repository at this point in the history
Implements command `dnf5 reposync` for creating local copies of remote
repositories.
The syntax is mostly compatible with the dnf4 version of the command.
  • Loading branch information
m-blaha committed Nov 26, 2024
1 parent d40a0e3 commit 51ef27b
Show file tree
Hide file tree
Showing 16 changed files with 832 additions and 2 deletions.
1 change: 1 addition & 0 deletions dnf5-plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ add_subdirectory("config-manager_plugin")
add_subdirectory("copr_plugin")
add_subdirectory("needs_restarting_plugin")
add_subdirectory("repoclosure_plugin")
add_subdirectory("reposync_plugin")
16 changes: 16 additions & 0 deletions dnf5-plugins/reposync_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# set gettext domain for translations
set(GETTEXT_DOMAIN dnf5-plugin-reposync)
add_definitions(-DGETTEXT_DOMAIN=\"${GETTEXT_DOMAIN}\")

add_library(reposync_cmd_plugin MODULE reposync.cpp reposync_cmd_plugin.cpp)

# disable the 'lib' prefix in order to create reposync_cmd_plugin.so
set_target_properties(reposync_cmd_plugin PROPERTIES PREFIX "")

target_link_libraries(reposync_cmd_plugin PRIVATE libdnf5 libdnf5-cli)
target_link_libraries(reposync_cmd_plugin PRIVATE dnf5)

install(TARGETS reposync_cmd_plugin LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/dnf5/plugins/)
install(DIRECTORY "config/usr/" DESTINATION "${CMAKE_INSTALL_PREFIX}")

add_subdirectory(po)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version = '1.0'

['reposync.downloadpath']
type = 'cloned_named_arg'
long_name = 'download-path'
short_name = 'p'
source = 'reposync.destdir'
5 changes: 5 additions & 0 deletions dnf5-plugins/reposync_plugin/po/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if(NOT WITH_TRANSLATIONS)
return()
endif()

include(Translations)
17 changes: 17 additions & 0 deletions dnf5-plugins/reposync_plugin/po/cs.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-06 03:02+0000\n"
"PO-Revision-Date: 2024-02-02 13:11+0000\n"
"Language-Team: Czech <https://translate.fedoraproject.org/projects/dnf5/dnf5-"
"plugin-reposync/cs/>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Weblate 5.3.1\n"
62 changes: 62 additions & 0 deletions dnf5-plugins/reposync_plugin/po/dnf5-plugin-reposync.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-21 10:44+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: reposync.cpp:64
msgid "Synchronize a remote DNF repository to a local directory."
msgstr ""

#: reposync.cpp:159
msgid "Can't use --norepopath with multiple repositories enabled"
msgstr ""

#: reposync.cpp:243
#, c++-format
msgid ""
"Download destination '{0}' for location '{1}' of '{2}' package from '{3}' "
"repo is outside of safe write path '{4}'."
msgstr ""

#: reposync.cpp:280
#, c++-format
msgid "Failed to create directory '{0}' iterator: {1}"
msgstr ""

#: reposync.cpp:298
#, c++-format
msgid "Failed to delete file {0}: {1}"
msgstr ""

#: reposync.cpp:301
#, c++-format
msgid "[DELETED] {}"
msgstr ""

#: reposync.cpp:317
#, c++-format
msgid "Removing '{}' with failing PGP check: {}"
msgstr ""

#: reposync.cpp:378
#, c++-format
msgid "Failed to get mirror for package: \"{}\""
msgstr ""

#: reposync.cpp:395
msgid "PGP signature check failed"
msgstr ""
Loading

0 comments on commit 51ef27b

Please sign in to comment.