Skip to content

Commit

Permalink
doc: add typical dnf5 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura committed Aug 28, 2024
1 parent 2f32bb2 commit a8538b1
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/dnf5.conf.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ For a given repository with an identifier in the form "<ID>-rpms", its correspon

For example, for repository "fedora", the source repository is "fedora-source" and debuginfo repository is "fedora-debuginfo". For repository "fedora-rpms", the source repository is "fedora-source-rpms" and debuginfo repository is "fedora-debug-rpms".

.. _repo_variables-label:

Repo Variables
==============
Expand Down
71 changes: 71 additions & 0 deletions doc/dnf5_workflow.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#############
DNF5 Workflow
#############


Typical DNF5 workflow consists of:

#. set up loggers
#. create base
#. add dnf5 commands
#. load dnf5 plugins: (See :ref:`DNF5 Plugins <dnf5 plugins tutorial>` for details.)
#. dnf5 plugin ``init`` hook
#. dnf5 plugin ``create_commands`` hook
#. run command specific ``set_parent_command`` step
#. run command specific ``set_argument_parser`` step
#. | run command specific ``register_subcommands`` step
| (for native dnf5 commands the last 3 steps are done as a part of 'add dnf5 commands')
#. load aliases
#. parse command line arguments
#. run command specific ``pre_configure`` step
#. load main configuration
#. enable/disable libdnf5 plugins
#. base setup:
#. load libdnf5 plugins (See :ref:`LIBDNF5 Plugins <libdnf5 plugins tutorial>` for details.)
#. libdnf5 plugin ``init`` hook
#. libdnf5 plugin ``pre_base_setup`` hook
#. lock installroot
#. load Vars and lock varsdir
#. libdnf5 plugin ``post_base_setup`` hook
#. create repo sack
#. create repos from system configuration
* perform Vars substitution on repository id and all values (See :ref:`Repo Variables <repo_variables-label>` for details.)
#. create repos from paths (such as --repofrompath arg)
* perform Vars substitution on specified id and path
#. apply repository setopts (such as --setopt=fedora.metadata_expire=0)
#. run command specific ``configure`` step
#. libdnf5 plugin ``repos_configured`` hook
#. if command requires privileges check for them
#. load repositories:
#. if required load system repository
#. if required load enabled repositories:
#. load metadata from cache if valid
#. try to reuse root's cache
#. metadata download
#. metadata gpg check
#. if required import repository gpg keys and try again
#. libdnf5 plugin ``repos_loaded`` hook
#. run command specific ``load_additional_packages`` step
#. run command specific ``run`` step
#. if the command produced a goal:
#. libdnf5 plugin ``pre_add_cmdline_packages`` hook
#. add commandline packages
#. libdnf5 plugin ``post_add_cmdline_packages`` hook
#. resolve goal (resolve dependencies)
#. run command specific ``goal_resolved`` step
#. print transaction table
#. check for user approval
#. download inbound transaction packages
#. check gpg signatures for inbound transaction packages
#. lock transaction ``libdnf5::utils::Locker``
#. create rpm transaction
#. run rpm test transaction
#. libdnf5 plugin ``pre_transaction`` hook
#. start database transaction
#. run rpm transaction
#. update system_state (See :manpage:`dnf5-system-state(7)`, :ref:`System state <systemstate_misc_ref-label>` for details.)
#. finish database transaction
#. libdnf5 plugin ``post_transaction`` hook
#. unlock transaction ``libdnf5::utils::Locker``
#. libdnf5 plugin ``finish`` hook
#. dnf5 plugin ``finish`` hook
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Welcome to DNF5's documentation!
dnf5_plugins/index
dnf5.8
dnf5.conf.5
dnf5_workflow
dnf_daemon/index
misc/index
best_practices/index
Expand Down

0 comments on commit a8538b1

Please sign in to comment.