Skip to content

Commit

Permalink
[WIP] manifest: A new plugin for working with RPM package manifest files
Browse files Browse the repository at this point in the history
The plugin currently generates manifest files listing all packages
and dependencies based on input package specs and the system state.
It can then download the packages from the manifest and install all
non-source packages.
  • Loading branch information
jan-kolarik committed Sep 13, 2024
1 parent f458ab6 commit 03e32be
Show file tree
Hide file tree
Showing 6 changed files with 328 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dnf-plugins-core.spec
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Provides: dnf-command(debug-restore)
Provides: dnf-command(debuginfo-install)
Provides: dnf-command(download)
Provides: dnf-command(groups-manager)
Provides: dnf-command(manifest)
Provides: dnf-command(repoclosure)
Provides: dnf-command(repograph)
Provides: dnf-command(repomanage)
Expand All @@ -88,6 +89,7 @@ Provides: dnf-plugin-config-manager = %{version}-%{release}
Provides: dnf-plugin-debuginfo-install = %{version}-%{release}
Provides: dnf-plugin-download = %{version}-%{release}
Provides: dnf-plugin-generate_completion_cache = %{version}-%{release}
Provides: dnf-plugin-manifest = %{version}-%{release}
Provides: dnf-plugin-needs_restarting = %{version}-%{release}
Provides: dnf-plugin-groups-manager = %{version}-%{release}
Provides: dnf-plugin-repoclosure = %{version}-%{release}
Expand All @@ -105,7 +107,7 @@ Conflicts: dnf-plugins-extras-common-data < %{dnf_plugins_extra}

%description
Core Plugins for DNF. This package enhances DNF with builddep, config-manager,
copr, %{?with_debug_plugin:debug, }debuginfo-install, download, needs-restarting, groups-manager, repoclosure,
copr, %{?with_debug_plugin:debug, }debuginfo-install, download, manifest, needs-restarting, groups-manager, repoclosure,
repograph, repomanage, reposync, changelog and repodiff commands. Additionally
provides generate_completion_cache passive plugin.

Expand Down Expand Up @@ -176,6 +178,7 @@ Requires: python3-dbus
Requires: python3-dnf >= %{dnf_lowest_compatible}
Requires: python3-hawkey >= %{hawkey_version}
Requires: python3-dateutil
Requires: python3-libpkgmanifest
Requires: python3-systemd
%if %{with debug_plugin}
Provides: python3-dnf-plugins-extras-debug = %{version}-%{release}
Expand All @@ -199,7 +202,7 @@ Conflicts: python-%{name} < %{version}-%{release}

%description -n python3-%{name}
Core Plugins for DNF, Python 3 interface. This package enhances DNF with builddep,
config-manager, copr, %{?with_debug_plugin:debug, }debuginfo-install, download, needs-restarting,
config-manager, copr, %{?with_debug_plugin:debug, }debuginfo-install, download, manifest, needs-restarting,
groups-manager, repoclosure, repograph, repomanage, reposync, changelog,
repodiff, system-upgrade, offline-upgrade and offline-distrosync commands.
Additionally provides generate_completion_cache passive plugin.
Expand Down Expand Up @@ -595,6 +598,7 @@ ln -sf %{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/man1/repotrack.1
%{_mandir}/man8/dnf*-expired-pgp-keys.*
%{_mandir}/man8/dnf*-generate_completion_cache.*
%{_mandir}/man8/dnf*-groups-manager.*
%{_mandir}/man8/dnf*-manifest.*
%{_mandir}/man8/dnf*-needs-restarting.*
%{_mandir}/man8/dnf*-repoclosure.*
%{_mandir}/man8/dnf*-repodiff.*
Expand Down Expand Up @@ -661,6 +665,7 @@ ln -sf %{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/man1/repotrack.1
%{python3_sitelib}/dnf-plugins/expired-pgp-keys.py
%{python3_sitelib}/dnf-plugins/generate_completion_cache.py
%{python3_sitelib}/dnf-plugins/groups_manager.py
%{python3_sitelib}/dnf-plugins/manifest.py
%{python3_sitelib}/dnf-plugins/needs_restarting.py
%{python3_sitelib}/dnf-plugins/repoclosure.py
%{python3_sitelib}/dnf-plugins/repodiff.py
Expand All @@ -680,6 +685,7 @@ ln -sf %{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/man1/repotrack.1
%{python3_sitelib}/dnf-plugins/__pycache__/expired-pgp-keys.*
%{python3_sitelib}/dnf-plugins/__pycache__/generate_completion_cache.*
%{python3_sitelib}/dnf-plugins/__pycache__/groups_manager.*
%{python3_sitelib}/dnf-plugins/__pycache__/manifest.*
%{python3_sitelib}/dnf-plugins/__pycache__/needs_restarting.*
%{python3_sitelib}/dnf-plugins/__pycache__/repoclosure.*
%{python3_sitelib}/dnf-plugins/__pycache__/repodiff.*
Expand Down
1 change: 1 addition & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dnf4-builddep.8
${CMAKE_CURRENT_BINARY_DIR}/dnf4-generate_completion_cache.8
${CMAKE_CURRENT_BINARY_DIR}/dnf4-groups-manager.8
${CMAKE_CURRENT_BINARY_DIR}/dnf4-leaves.8
${CMAKE_CURRENT_BINARY_DIR}/dnf4-manifest.8
${CMAKE_CURRENT_BINARY_DIR}/dnf4-modulesync.8
${CMAKE_CURRENT_BINARY_DIR}/dnf4-needs-restarting.8
${CMAKE_CURRENT_BINARY_DIR}/dnf4-repoclosure.8
Expand Down
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def version_readout():
('groups-manager', 'dnf4-groups-manager', u'DNF groups-manager Plugin', AUTHORS, 8),
('leaves', 'dnf4-leaves', u'DNF leaves Plugin', AUTHORS, 8),
('local', 'dnf4-local', u'DNF local Plugin', AUTHORS, 8),
('manifest', 'dnf4-manifest', u'DNF manifest Plugin', AUTHORS, 8),
('modulesync', 'dnf4-modulesync', u'DNF modulesync Plugin', AUTHORS, 8),
('needs_restarting', 'dnf4-needs-restarting', u'DNF needs_restarting Plugin', AUTHORS, 8),
('repoclosure', 'dnf4-repoclosure', u'DNF repoclosure Plugin', AUTHORS, 8),
Expand Down
86 changes: 86 additions & 0 deletions doc/manifest.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
====================
DNF manifest Plugin
====================

Working with RPM package manifest files using the ``libpkgmanifest`` library.

:ref:`Strict <strict-label>` mode is enforced for all operations.

--------
Synopsis
--------

``dnf manifest new [options] [<package-name-spec>...]``

``dnf manifest download [options]``

``dnf manifest install [options]``

-----------
Subcommands
-----------

``new``
Generate a new manifest file based on the provided package specs.

The specs are resolved, and all packages and their dependencies
are recorder in the manifest file, considering the current system
state and dnf configuration.

``download``
Download all packages specified in the manifest file to disk.

By default, packages are downloaded to a subfolder named after the
manifest file. You can also use the global ``--destdir`` option to
specify a custom directory for the downloaded packages.

``install``
Install all packages specified in the manifest file.

---------
Arguments
---------

``<package-name-spec>``
Specification for including a package in the manifest file.
Local RPMs or filenames are not supported.
For more information, refer to :ref:`Specifying Packages <specifying_packages-label>`.

-------
Options
-------

``--file``
Specify a custom path for the manifest file.
By default, ``packages.manifest.yaml`` is used.

``--source``
Include source packages in consideration.
Not supported for the ``install`` command.

``--url-only``
Use package URLs from the manifest instead of resolving packages from repositories.
Repository metadata is not loaded for this operation.
Applicable only for the ``download`` command.

--------
Examples
--------

``dnf manifest new alsa-lib alsa-tools``
Create a new manifest file at the default ``packages.manifest.yaml`` location,
containing the ``alsa-lib`` and ``alsa-tools`` packages along with all their dependencies.

``dnf manifest download --file /home/user/Downloads/manifest.yaml --source``
Download all packages, including source packages, specified in the given manifest file.

``dnf manifest install -y``
Install all packages specified in the manifest file located in the current directory
under the default file name, automatically answering "yes" to all prompts during the
transaction resolution.

--------
See Also
--------

* `libpkgmanifest upstream <https://github.com/rpm-software-management/libpkgmanifest>`_
1 change: 1 addition & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ INSTALL (FILES leaves.py DESTINATION ${PYTHON_INSTALL_DIR}/dnf-plugins)
if (${WITHOUT_LOCAL} STREQUAL "0")
INSTALL (FILES local.py DESTINATION ${PYTHON_INSTALL_DIR}/dnf-plugins)
endif()
INSTALL (FILES manifest.py DESTINATION ${PYTHON_INSTALL_DIR}/dnf-plugins)
if (${PYTHON_VERSION_MAJOR} STREQUAL "2")
INSTALL (FILES migrate.py DESTINATION ${PYTHON_INSTALL_DIR}/dnf-plugins)
endif()
Expand Down
Loading

0 comments on commit 03e32be

Please sign in to comment.