When running dnf-automatic in RHEL 10.0 where releasever_minor should
default to "0", releasever_minor variable was incorrectly detected as
undefined. That led to expanding a metalink for an EPEL repository to
a wrong URL.
The cause was a bad logic in updating the release, releasever_major,
and releasever_minor triplet in dnf.cli.cli.Cli._read_conf_file():
Setting release invalidates releasever_major and releasever_minor. At
the same time for backward compatibilty detected release only contains
the major number.
This bug did not manifest in "dnf upgrade" command because "dnf"
program does not explicitly construct dnf.Base() before calling
_read_conf_file(). That is dnf-automtic first detected releasever=10
and releasever_minor=0 when calling _setup_default_conf() via
dnf.Base(). But then _read_conf_file() called by dnf-automatic set
releasever again to 10, that rewrote releasever_minor to None and
then _read_conf_file() set releasever_minor to releasever_minor, i.e
to None.
This patch does not change the code flow to minimize regressions.
Instead it saves the original releasever_minor value to be able to
default to it again.
Resolve: #2259
If /etc/dnf/automatic.conf has:
[emitters]
emit_via = command_email
[command_email]
email_to = root,test
a command incompatible with s-nail-14.9.25, a "mail" command
implementation, was executed:
execve("/usr/bin/mail", ["mail", "-Ssendwait", "-s", "Updates available on 'fedora-43'.", "-r", "root", "root test"], ...) = 0
The cause was that s-nail does not support multiple recipients in
a single argument.
This patch changes how "{email_to}" expands in command_format
formatting string. Now it expands into multiple, space separated arguments.
The new syntax is also accepted by mailx tool.
Implementation detail: A list of email_to recipients passed in
CommandEmitterMixIn does not inherit from "list" Python class or any
other iterator. It's libdnf.module.VectorString class generated by
Swig without. There the custom ShellQuotedLists formatting dictionary
needs to refer to libdnf.module.VectorString type and include "libdnf"
Python module explicitly.
A test will be added to ci-dnf-stack repository.
Resolve: #2241
This is required because rpmsoftwaremanagement/dnf-nightly switched to
it as well.
We keep the `tests` job as `centos-stream-9-x86_64` because `Testing
Farm` doesn't recognize `centos-stream+epel-next-9-x86_64`.
We would like to switch to exclusively using Packit for building and
testing pull requests, so we are retiring this GitHub Actions workflow.
In order to fully disable the action, this commit must be applied on
each branch in the upstream repository. Otherwise, the action might be
triggered by a pull request to some stale branch.
Commit ab1a0d54d2 (spec: Allow to build
with ninja) broke spec parsing on RHEL 9 because %ctest macro is does
not recongize any arguments there:
$ rpm --eval '%ctest -VV'
error: Unknown option V in ctest(:-:)
This patch falls back to a manual ctest invocation on RHEL < 10.
For all transactions, store whether the transaction was persistent or
transient in the history DB. Requires libdnf 0.75.0.
Moves some of the bootc logic to the `configure` phase.
For https://github.com/rpm-software-management/dnf/issues/2196.
The logic in `dnf.cli.cli.BaseCli.latest_changelogs()` would loop over
installed packages with the target package name to find one with
changelog times, take the newest date from that, and break out of the
loop immediately afterwards.
This behavior was presumably implemented for efficiency, but it assumes
that there is only one version of the package installed. For some
packages (e.g., `kernel`), multiple versions can be installed at once.
If the first version returned is not the latest, then the function would
calculate the date of the newest changelog entry incorrectly.
The solution is simple: loop over all versions of the package and take
the latest changelog entry from the entire set.
= changelog =
msg: Check all installed versions of package for newest changelog date
type: bugfix
There were warnings about unclosed file handles in the logging logic. We
now close the file handles before removing the log handlers that opened
the files in the first place.
Both dnf-automatic and dnf5-plugin-automatic packages deliver
dnf-automatic.timer. When upgrading from dnf to dnf5, dnf-automatic's
preun script saw that dnf-automatic package was being uninstalled and
hence disabled dnf-automatic.timer. As a result upgrading people found
the upgraded system without automatically applied updates.
It is supposed that people who have enabled dnf-automatic.timer want
to keep it enabled even after migrating to DNF5.
This patch stops disabling dnf-automatic.timer when dnf-automatic
package is uinstalled and there is dnf5-automatic.timer. Existence of
dnf5-automatic.timer means that dnf5-plugin-automatic is installed.
The new dnf-automatic.timer is a symbolic link to
dnf5-automatic.timer and both names can be used interchangably by
systemd.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2358865
This function was undocumented, but appears intended to be public and is
very important to anyone wanting to report on all transaction
activities.
Signed-off-by: Chris Riches <chris.riches@nutanix.com>
The scriptout hook receives a lot of gratuitous calls when there is no
scriptlet output, leading to it being called with a None value. This is
pointless and confusing to consumers, so skip calling the hook if
`_scriptOutput()` returns None.
Signed-off-by: Chris Riches <chris.riches@nutanix.com>
Adds dnf.rpm.detect_releasevers to the API docs and mention it is
now preferred over dnf.rpm.detect_releasever.
Updates examples/install_extension.py to use detect_releasevers and set
the releasever_major and releasever_minor substitution variables.
The releasever_major and releasever_minor substitution variables are
usually derived by splitting releasever on the first `.`. However, to
support EPEL 10 [1], we would like a way for distributions to override these
values. Specifically, we would like RHEL 10 to have a releasever of `10`
with a releasever_major of `10` and a releasever_minor of `0` (later
incrementing to `1`, `2`, to correspond with the RHEL minor version).
This commit adds a new API function, `detect_releasevers`, which derives
releasever, releasever_major, and releasever_minor from virtual provides
on the system-release package (any of `DISTROVERPKG`). The detection of
releasever is unchanged. releasever_major and releasever_minor are
specified by the versions of the `system-release-major` and
`system-release-minor` provides, respectively.
If the user specifies a `--releasever=X.Y` on the command line, the
distribution settings for releasever, releasever_major, and releasever_minor
will all be overridden: releasever will be set to X.Y, releasever_major will be
set to X, and releasever_minor will be set to Y, same as before. If a user
wants to specify a custom releasever_major and releasever_minor, they have to
set all three with `--setopt=releasever=X --setopt=releasever_major=Y
--setopt=releasever_minor=z`, taking care to put `releasever_major` and
`releasever_minor` after `releasever` so they are not overridden.
[1] https://issues.redhat.com/browse/RHEL-68034
dnf-bootc's only job is to Require python3-gobject-base, ostree,
ostree-libs, and util-linux-core, which are needed to interact with
bootc systems. We don't want to add these dependencies on `python3-dnf`
because we don't want them on non-bootc systems, so we use a subpackage.