Problem:kernel_reboot_pending ordered kernel releases with _version_key. That function compares the text between the numbers as plain strings, so '.el' > '.' and 6.12.0-208.112.5.el9uek counted as newer than the running 6.12.0-208.112.5.1.el9uek. build-arm-01 asks to reboot into an older kernel, and a reboot never clears it.
Fix:_version_cmp follows rpm's rpmvercmp:
A release splits into runs of digits, runs of letters and ~. Everything else only separates them.
Numbers compare as numbers, letters as text. A number is newer than letters in the same place.
Where one release ends and the other goes on, the longer one is newer, unless its next segment is ~, which comes before anything. That is also how dpkg orders a release candidate.
Tests: three new cases in TestKernelRebootPending:
UEK with 112.5.1 running: no reboot.
UEK with 112.5 running: reboot into 112.5.1.
A ~rc kernel before its release.
The existing Debian, Proxmox, Arch, Raspberry Pi and Fedora cases still pass. Full suite: 1618 passed; ruff and mypy are clean.
Live check: 12 pairs compared on build-arm-01 with rpm.labelCompare give the same results as _version_cmp. The pairs include 112.5.1.el9uek/112.5.el9uek, el9_4/el9, 1.0/1, 1.0a/1.0 and ~rc5.
4.36.2: patch release, no API change.
Closes #109
**Problem:** `kernel_reboot_pending` ordered kernel releases with `_version_key`. That function compares the text between the numbers as plain strings, so `'.el' > '.'` and `6.12.0-208.112.5.el9uek` counted as newer than the running `6.12.0-208.112.5.1.el9uek`. build-arm-01 asks to reboot into an older kernel, and a reboot never clears it.
**Fix:** `_version_cmp` follows rpm's `rpmvercmp`:
- A release splits into runs of digits, runs of letters and `~`. Everything else only separates them.
- Numbers compare as numbers, letters as text. A number is newer than letters in the same place.
- Where one release ends and the other goes on, the longer one is newer, unless its next segment is `~`, which comes before anything. That is also how dpkg orders a release candidate.
**Tests:** three new cases in `TestKernelRebootPending`:
- UEK with `112.5.1` running: no reboot.
- UEK with `112.5` running: reboot into `112.5.1`.
- A `~rc` kernel before its release.
The existing Debian, Proxmox, Arch, Raspberry Pi and Fedora cases still pass. Full suite: 1618 passed; ruff and mypy are clean.
**Live check:** 12 pairs compared on build-arm-01 with `rpm.labelCompare` give the same results as `_version_cmp`. The pairs include `112.5.1.el9uek`/`112.5.el9uek`, `el9_4`/`el9`, `1.0`/`1`, `1.0a`/`1.0` and `~rc5`.
4.36.2: patch release, no API change.
_version_key compared the text between numbers as plain strings, so
'.el' outranked '.' and 6.12.0-208.112.5.el9uek counted as newer than
the running 6.12.0-208.112.5.1.el9uek: an Oracle Linux host asked to
reboot into an older kernel, and a reboot never cleared it. The
releases now compare like rpmvercmp: separators only separate, a
number is newer than letters in its place, and '~' comes before
anything. Checked against rpm.labelCompare on Oracle Linux 9.
Closes#109
The quality ratchet refused _version_cmp at complexity 12. Comparing one
segment moves to _segment_cmp, which also takes 01 and 1 as equal, as
rpm does.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #109
Problem:
kernel_reboot_pendingordered kernel releases with_version_key. That function compares the text between the numbers as plain strings, so'.el' > '.'and6.12.0-208.112.5.el9uekcounted as newer than the running6.12.0-208.112.5.1.el9uek. build-arm-01 asks to reboot into an older kernel, and a reboot never clears it.Fix:
_version_cmpfollows rpm'srpmvercmp:~. Everything else only separates them.~, which comes before anything. That is also how dpkg orders a release candidate.Tests: three new cases in
TestKernelRebootPending:112.5.1running: no reboot.112.5running: reboot into112.5.1.~rckernel before its release.The existing Debian, Proxmox, Arch, Raspberry Pi and Fedora cases still pass. Full suite: 1618 passed; ruff and mypy are clean.
Live check: 12 pairs compared on build-arm-01 with
rpm.labelComparegive the same results as_version_cmp. The pairs include112.5.1.el9uek/112.5.el9uek,el9_4/el9,1.0/1,1.0a/1.0and~rc5.4.36.2: patch release, no API change.