Commit Graph

3517 Commits

Author SHA1 Message Date
Evan Goode d366941804 ci: Remove "Package Build" GitHub Action
We would like to switch to exclusively using Packit for building and
testing pull requests, so we are retiring this GitHub Action workflow.
We will want to configure Packit to check that DNF5 compiles with both
GCC and clang, like the Package Build action did.

In order to fully disable the action, this commit must be applied on
each branch in the upstream DNF5 repository. Otherwise, the action might
be triggered by a pull request to some stale branch.
2025-06-12 19:42:57 +00:00
Marek Blaha eaf5dd982b dnf5: Handle script_output callback for transaction 2024-08-21 15:43:44 +02:00
Marek Blaha 0d6e2cff4d transaction: New script_output callback
Used to pass the outputs (stdout and stderr) of an executed scriptlet to
the user.
2024-08-21 15:43:44 +02:00
Marek Blaha b915955ebe transaction: Move scriptlet outputs to rpm::Transaction
The code works on rpm level anyway and I'd like to use this mechanism in
transaction callback to present the outputs to the user.
Also adds rpm::Transaction class member to store the output of the last
scriptlet.
2024-08-21 15:43:04 +02:00
Aleš Matěj 9635f736cc spec: fix modularity man page 2024-08-20 07:03:57 +00:00
Marek Blaha ea4055fa38 doc: Include modularity documentation 2024-08-19 07:49:02 +00:00
Marek Blaha e725459f2a doc: Revise packages filtering doc section 2024-08-19 07:49:02 +00:00
Marek Blaha b52426e6be package_downloader: Always call download callbacks
The download callbacks were not called in case the source and
destination of locally available downloaded file were the same.
2024-08-16 07:43:47 +00:00
Marek Blaha 0fd5a3bd86 repo: New Repo.get_packages_download_dir() method
Currently, the path where a package should be downloaded is computed in
several places. This patch introduces a single location for this
computation to reduce code duplication.
The patch also fixes usage of incorrect package path in
Package::get_package_path() call - the destdir config option was not
taken into account.
2024-08-16 07:43:47 +00:00
Marek Blaha abeb48ccec doc: Document destdir main config option 2024-08-16 07:43:47 +00:00
Pavla Kratochvilova 0730a53674 doc: Naming of source and debug repos
Resolves: https://github.com/rpm-software-management/dnf5/issues/1355
2024-08-16 07:15:41 +00:00
Aleš Matěj 13aa3ce1b3 doc: fix arguments for `install`, `upgrade` and `remove`
For: https://github.com/rpm-software-management/dnf5/issues/1602
For: https://github.com/rpm-software-management/dnf5/issues/1498
2024-08-13 11:52:20 +00:00
Aleš Matěj b6dffc2402 doc: add `environment-spec` to specs.7.rst 2024-08-13 11:52:20 +00:00
Aleš Matěj 7022b82a3f doc: link `group_package_types` with install and group install 2024-08-13 11:52:20 +00:00
Petr Písař 98e6b01b2d doc: Use ~ instead of /home/$USER
First not every system has user's home directories under /home
directory. Second DNF does not use USER variable at all. It uses HOME
environment variable with a fallback to a home directory listed in
passwd(5) entry.

Alternativelly, we could write "$HOME". But I find "~" shorter, more
aesthetic, more understandible, and more correct in case the HOME
variable does not exist.
2024-08-08 09:55:36 +00:00
Aleš Matěj 8c6409652c Update the man page entry for the countme option
Make it a bit more explanatory, format the age buckets as a table and
reflect the changes from the last update.

Backport from dnf4: a8c77bb0d8
2024-08-08 07:40:41 +00:00
Aleš Matěj d8d677c27a Fix countme bucket calculation
Actually use the system's installation time (if known) as the reference
point, instead of the first-ever countme event recorded for the given
repo.

This is what the dnf5.conf(5) man page always said about the countme
option, the code just never lived up to that.

This makes bucket calculation more accurate:

1. System upgrades will no longer reset the bucket to 1 (this used to be
   the case due to a new persistdir being created whenever $releasever
   changed).

2. Systems that only reach out to the repos after an initial time period
   after being installed will no longer appear younger than they really
   are.

3. Prebuilt OS images that happen to include countme cookies created at
   build time will no longer cause all the instances spawned from those
   images (physical machines, VMs or containers) to appear older than
   they really are.

Use the machine-id(5) file's mtime to infer the installation time.  This
file is semantically tied to the system's lifetime since it's typically
populated at installation time or during the first boot by an installer
tool or init system, respectively, and remains unchanged.

The fact that it's a well-defined file with clear semantics ensures that
OS images won't accidentally include a prepopulated version of this file
with a timestamp corresponding to the image build, unlike our own cookie
files (see point 3 above).

In some cases, such as in OCI containers without an init system running,
the machine-id file may be missing or empty, even though the system is
still used long-term. To cover those, keep the original, relative epoch
as a fallback method. System upgrades aren't really a thing for such
systems so the above point 1 doesn't apply here.

Some containers, such as those created by toolbox(1), may also choose to
bind-mount the host's machine-id file, thus falling into the same bucket
as their host. Conveniently, that's what we want, since the purpose of
such containers is to blend with the host as much as possible.

Backport from dnf4: cc95edd15b
2024-08-08 07:40:41 +00:00
Aleš Matěj 6b642e5780 Fix up some comments in addCountmeFlag()
The buckets aren't really an array that's indexed in the code, they're
just sequential numbers for the URL flag.  Also clarify why we're using
"this window" instead of "the current position of the sliding window" in
the comments.

Backport from dnf4: cc95edd15b
2024-08-08 07:40:41 +00:00
Aleš Matěj 3343196593 doc: enhance `logdir` default description 2024-08-08 07:39:48 +00:00
Aleš Matěj 7cb9f90001 doc: describe `cachedir` and `system_cachedir` relationship
For: https://github.com/rpm-software-management/dnf5/issues/1150
2024-08-08 07:39:48 +00:00
Marek Blaha ea8a9a2092 doc: Add system-upgrade example using D-Bus API 2024-08-07 11:06:29 +00:00
Marek Blaha 779ce23ac9 dnf5daemon-client: system-upgrade command 2024-08-07 11:06:29 +00:00
Marek Blaha b23ceffe92 dnfdaemon: Add system_upgrade() method to Rpm interface
The method fills the goal to perform upgrade of the distribution to the
new release.
2024-08-07 11:06:29 +00:00
Aleš Matěj f85c7fad37 spec: fix cmake focus_new arg 2024-08-07 07:53:14 +00:00
Aleš Matěj 26096c96b0 Use `SOLVER_FLAG_FOCUS_NEW` to install latests versions of deps
This is a new flag in the recent 0.7.30 release.
It is used only in current rawhide.

We previously tried to use `SOLVER_FLAG_FOCUS_BEST` but it turned out to
be too strong, this new flag should update packages only if it is
required for installing the latests versions of dependencies.

We had several reports where users expect this behavior.

This should properly resolve issue such as:
https://bugzilla.redhat.com/show_bug.cgi?id=2150300
https://issues.redhat.com/browse/RHEL-1374
2024-08-06 11:22:15 +00:00
David Michael 62b8ffbc09 builddep: Support the --with/--without options to toggle bconds
This adds the same options used by rpmbuild, mock, etc. for setting
macros to flip build-time conditional switches when parsing spec
files.  It provides a consistent interface across related tools.
2024-08-06 04:32:17 +00:00
Marek Blaha 1be56c542c dnf5: Reduce the noise around running scriptlets
If the scriptlet finishes successfully, do not print the
"Running scriptlet..." / "Stop scriptlet..." pair of messages in the
transaction progress bar.

The "Running scriptlet" message is displayed during the scriptlet
execution to inform the user that a time-consuming operation is in
progress. If the scriptlet completes successfully, the message is
removed. If it fails, the message remains, and an error/warning message
and the "Stop scriptlet" message is printed to enable debugging.
2024-08-05 09:07:52 +00:00
Marek Blaha 95f6b67a60 cli: Method to drop the last progress bar message
Useful to create "temporary" messages, will be used to reduce the
"Running scriptlet" / "Stop scriptlet" rpm transaction noise.
2024-08-05 09:07:52 +00:00
Petr Písař 04d9908f59 spec: Stricten a dependency on DNF libraries in plugin subpackages
ELF plugins of dnf5-plugins and dnf5-plugin-automatic subpackages link
to libdnf and libdnf-cli libraries. Because the libraries come from
the same source package, it is desired to pin the plugin subpackages
to same release of the libraries subpackages.

This was hinted by rpminspect and already partially implemented in
commit 97cdbe57c3 ("Add explicit package
version for libdnf5-cli").
2024-08-02 14:11:55 +00:00
Petr Písař 97ed37c7d3 Fix a use-after-free in EmitterEmail::notify()
When "dnf5 automatic" was configured to send e-mails via SMTP
("emit_via = email" in automatic.conf), it sometimes crashed:

    #0  0x00007ff7fb955184 __memcpy_avx_unaligned_erms (libc.so.6 + 0x147184)
    #1  0x00007ff7fb873bd4 fmemopen_read (libc.so.6 + 0x65bd4)
    #2  0x00007ff7fb875813 _IO_file_underflow@@GLIBC_2.2.5 (libc.so.6 + 0x67813)
    #3  0x00007ff7fb877e45 _IO_default_xsgetn (libc.so.6 + 0x69e45)
    #4  0x00007ff7fb869a40 _IO_fread (libc.so.6 + 0x5ba40)
    #5  0x00007ff7faceb1f7 cr_in_read (libcurl.so.4 + 0x541f7)
    #6  0x00007ff7facf8608 cr_eob_read (libcurl.so.4 + 0x61608)
    #7  0x00007ff7facf0f20 Curl_client_read (libcurl.so.4 + 0x59f20)
    #8  0x00007ff7facf103d Curl_req_send_more (libcurl.so.4 + 0x5a03d)
    #9  0x00007ff7fad068da Curl_readwrite (libcurl.so.4 + 0x6f8da)
    #10 0x00007ff7face6258 multi_runsingle.lto_priv.0 (libcurl.so.4 + 0x4f258)
    #11 0x00007ff7face8c64 curl_multi_perform (libcurl.so.4 + 0x51c64)
    #12 0x00007ff7facbb8a3 curl_easy_perform (libcurl.so.4 + 0x248a3)
    #13 0x00007ff7f9ee30ad _ZN4dnf512EmitterEmail6notifyEv (automatic_cmd_plugin.so + 0x170ad)
    #14 0x00007ff7f9ed61f5 _ZN4dnf516AutomaticCommand3runEv (automatic_cmd_plugin.so + 0xa1f5)
    #15 0x0000557b633d5f78 main (dnf5 + 0x39f78)
    #16 0x00007ff7fb811248 __libc_start_call_main (libc.so.6 + 0x3248)
    #17 0x00007ff7fb81130b __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x330b)
    #18 0x0000557b633d88e5 _start (dnf5 + 0x3c8e5)

or sent an e-mail without a body and some headers (e.g. Subject):

    From root@fedora-41.localdomain  Thu Aug  1 14:49:36 2024
    Return-Path: <root@fedora-41.localdomain>
    X-Original-To: test
    Delivered-To: test@fedora-41.localdomain
    Received: from fedora-41 (localhost [IPv6:::1])
	    by fedora-41.localdomain (Postfix) with ESMTP id E5A1E51
	    for <test>; Thu, 01 Aug 2024 14:49:36 +0200 (CEST)
    Message-Id: <20240801124936.E5A1E51@fedora-41.localdomain>
    Date: Thu, 01 Aug 2024 14:49:36 +0200 (CEST)
    From: root@fedora-41.localdomain

The cause was that a FILE * structure registered to curl as CURLOPT_READDATA
and freed before curl_easy_perform() processed it.

This patch fixes it.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2298385
2024-08-02 08:32:25 +00:00
amatej fdc16b1ebc Clarify `group` command man page: `environment` note
Co-authored-by: David Bold <dschwoerer@users.noreply.github.com>
2024-08-01 09:03:50 +00:00
David Bold 8029720d15 Add some docs about environments 2024-08-01 09:03:50 +00:00
Marek Blaha 6525d28db2 dnfdaemon-client: Fix repoquery command
The transfer id is now generated on the server side, do not pass it in
list_fd() call.
2024-08-01 07:37:42 +00:00
Marek Blaha f1eb048676 dnfdaemon-client: Clean command implemetation 2024-08-01 07:37:42 +00:00
Marek Blaha 92782b9cb9 dnfdaemon: D-Bus API for cleaning caches
Implements `clean()` method on `Base` interface to clean requested types
of caches. Supported types are "all", "packages", "metadata", "dbcache",
and also "expire-cache" for marking repository metadata expired.
2024-08-01 07:37:42 +00:00
Aleš Matěj 80737ffb07 Add an example how to disable repo to `repo` command man page
While this example isn't for the `repo` command it could be useful to
users looking into the man page.

For: https://github.com/rpm-software-management/dnf5/issues/1213
2024-07-31 11:35:38 +00:00
Petr Písař cd56344ed6 Improve "After this operation" disk usage messages
Resolves: #1598
2024-07-31 11:32:37 +00:00
Aleš Matěj 00d00c165d replay: Allow up/down-grade if NA is already installed
This makes a difference if `--ignore-installed` is set and the package
is installed in a different version -> it upgrades/downgrades the
package to the requested version.

This matches dnf4 behavior.
2024-07-31 11:22:55 +00:00
Aleš Matěj 485d3fec2c Add `redo` to and install history documentation 2024-07-31 11:22:55 +00:00
Aleš Matěj f1c2808e51 Add `override_reasons` to `GoalJobSettings` and use it in `redo`
If a package is already installed in the requested version but with a different reason override the reason.
This is useful when redoing an interrupted transaction.
The longest part of a transaction is running rpm changes, saving reasons is done after rpm finishes. If a transaction
is interrupted in the middle of the rpm part some rpms are changed but reasons are not updated at all. To handle this
enforce the reasons in the selected transaction.
2024-07-31 11:22:55 +00:00
Aleš Matěj 96891cb7f4 Add `history redo` command
It adds a new goal API to redo a history transaction.
2024-07-31 11:22:55 +00:00
Aleš Matěj ff0d5dcb49 Extract private API `to_replay()` for `libdnf5::transaction::Transaction`
It will be used later for transaction redo.
2024-07-31 11:22:55 +00:00
Aleš Matěj 4f221da545 Make `get_package_types()` from libdnf5::transaction::CompsGroup public
So it can be used in to_replay() function.
2024-07-31 11:22:55 +00:00
Marek Blaha 59538f3ebd package_downloader: Add local files to callbacks
Execute callbacks when copying local files to the destination during the
download() method.
2024-07-31 05:26:39 +00:00
Marek Blaha 2dc090720c dnf5: Offline transactions work with local rpm files 2024-07-31 05:26:39 +00:00
Marek Blaha 450870a645 package_downloader: Handle local files
Local packages are not passed to librepo for download, but directly
copied to the destination directory.
2024-07-31 05:26:39 +00:00
Marek Blaha 5ea996d7d3 transaction: Flag whether download local packages
By default the transaction during the `download()` call does not copy
local packages to the destination directory. These packages are used
directly from their original location. For some use-cases (like offline
transaction involving the command line repo packages) we need to copy
them to the package cache.
2024-07-31 05:26:39 +00:00
evan-goode 51479b97ec Release 5.2.5.0 2024-07-23 19:44:01 +00:00
GitHub Workflow 19667b16e1 Update translations from weblate 2024-07-23 19:44:01 +00:00
Aleš Matěj 5c76f5e53e Use the same nevra format for history and regular transactions
When serializing a history transaction package nevra use the same format
that is used when serializing base transaction.

It is also described in a comment: https://github.com/rpm-software-management/dnf5/blob/main/libdnf5/transaction/transaction_sr.hpp#L62
2024-07-17 13:35:47 +00:00