A release upgrade leaves third-party apt sources on the old release. They still answer, so apt says nothing, and their packages stop getting updates once the vendor stops building for that release. z2m-house (Ubuntu 24.04, noble) kept Docker's source on focal and never saw a Docker newer than 28.1.1 (NetOrk/netork#2614).
What changes
AptReleaseMixin.get_apt_source_releases(): the host's /etc/os-release (ID, ID_LIKE, VERSION_CODENAME, UBUNTU_CODENAME) and every enabled source apt reads, from sources.list and the *.list / *.sources files of sources.list.d wherever apt-config puts them. Each source carries its file, line, types, URI, suites and components. Commented-out lines and Enabled: no paragraphs are not sources. Read-only, no privileges, one command.
AptReleaseMixin.set_apt_source_release(path, release, codename): three steps. read refuses a path that is none of apt's source files. check fetches each new suite's InRelease, else Release, with apt-helper through apt's own proxy; when one is missing, nothing is written. rewrite writes the file whole through the driver's _write_apt_file (root, mode 644), with every suite of release on codename (focal-security → noble-security), enabled lines only. A URI or comment that names the release stays as it is.
AptProxyMixin now inherits AptReleaseMixin, so every apt driver (napalm-linux, napalm-proxmox) gets it without a change of its own. It reuses the transports those drivers already supply.
Which words are releases is the caller's decision. suite_release only gives the first word of a suite.
Tests
tests/test_apt_releases.py: parsing one-line and deb822 files (options blocks, comments, disabled lines, several URIs and suites, continuation lines, the HTTPS/// cache form), the read command run for real against a temporary apt tree, the rewrite (suffixes, URIs that name the release, prefixes that are not it, disabled paragraphs), and the mixin against a fake host (served / not served, Release fallback, one missing suite keeps the whole file, a path apt does not read is never written, nothing left to move, bad codenames). The full suite passes (1820), and ruff and mypy are clean.
A release upgrade leaves third-party apt sources on the old release. They still answer, so apt says nothing, and their packages stop getting updates once the vendor stops building for that release. z2m-house (Ubuntu 24.04, noble) kept Docker's source on `focal` and never saw a Docker newer than 28.1.1 (NetOrk/netork#2614).
## What changes
- `AptReleaseMixin.get_apt_source_releases()`: the host's `/etc/os-release` (`ID`, `ID_LIKE`, `VERSION_CODENAME`, `UBUNTU_CODENAME`) and every enabled source apt reads, from `sources.list` and the `*.list` / `*.sources` files of `sources.list.d` wherever `apt-config` puts them. Each source carries its file, line, types, URI, suites and components. Commented-out lines and `Enabled: no` paragraphs are not sources. Read-only, no privileges, one command.
- `AptReleaseMixin.set_apt_source_release(path, release, codename)`: three steps. `read` refuses a path that is none of apt's source files. `check` fetches each new suite's `InRelease`, else `Release`, with `apt-helper` through apt's own proxy; when one is missing, nothing is written. `rewrite` writes the file whole through the driver's `_write_apt_file` (root, mode 644), with every suite of *release* on *codename* (`focal-security` → `noble-security`), enabled lines only. A URI or comment that names the release stays as it is.
- `AptProxyMixin` now inherits `AptReleaseMixin`, so every apt driver (napalm-linux, napalm-proxmox) gets it without a change of its own. It reuses the transports those drivers already supply.
- Which words are releases is the caller's decision. `suite_release` only gives the first word of a suite.
## Tests
`tests/test_apt_releases.py`: parsing one-line and deb822 files (options blocks, comments, disabled lines, several URIs and suites, continuation lines, the `HTTPS///` cache form), the read command run for real against a temporary apt tree, the rewrite (suffixes, URIs that name the release, prefixes that are not it, disabled paragraphs), and the mixin against a fake host (served / not served, `Release` fallback, one missing suite keeps the whole file, a path apt does not read is never written, nothing left to move, bad codenames). The full suite passes (1820), and ruff and mypy are clean.
## Docs
README, `docs/STRUCTURE.md`, CHANGELOG (Unreleased).
A release upgrade leaves third-party apt sources on the old release, where they
still answer and their packages stop getting updates once the vendor stops
building for it: z2m-house, Ubuntu 24.04, kept Docker's source on focal and never
saw a Docker newer than 28.1.1.
AptReleaseMixin.get_apt_source_releases() reports the host's /etc/os-release and
every enabled source apt reads, one-line and deb822, with its file, line, types,
URI, suites and components. set_apt_source_release(path, release, codename) moves
every suite of release in one of apt's source files to codename, once each new
suite's InRelease or Release is fetched with apt-helper through apt's own proxy;
where the vendor has none, nothing is written. AptProxyMixin brings it, so every
apt driver has it.
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.
A release upgrade leaves third-party apt sources on the old release. They still answer, so apt says nothing, and their packages stop getting updates once the vendor stops building for that release. z2m-house (Ubuntu 24.04, noble) kept Docker's source on
focaland never saw a Docker newer than 28.1.1 (NetOrk/netork#2614).What changes
AptReleaseMixin.get_apt_source_releases(): the host's/etc/os-release(ID,ID_LIKE,VERSION_CODENAME,UBUNTU_CODENAME) and every enabled source apt reads, fromsources.listand the*.list/*.sourcesfiles ofsources.list.dwhereverapt-configputs them. Each source carries its file, line, types, URI, suites and components. Commented-out lines andEnabled: noparagraphs are not sources. Read-only, no privileges, one command.AptReleaseMixin.set_apt_source_release(path, release, codename): three steps.readrefuses a path that is none of apt's source files.checkfetches each new suite'sInRelease, elseRelease, withapt-helperthrough apt's own proxy; when one is missing, nothing is written.rewritewrites the file whole through the driver's_write_apt_file(root, mode 644), with every suite of release on codename (focal-security→noble-security), enabled lines only. A URI or comment that names the release stays as it is.AptProxyMixinnow inheritsAptReleaseMixin, so every apt driver (napalm-linux, napalm-proxmox) gets it without a change of its own. It reuses the transports those drivers already supply.suite_releaseonly gives the first word of a suite.Tests
tests/test_apt_releases.py: parsing one-line and deb822 files (options blocks, comments, disabled lines, several URIs and suites, continuation lines, theHTTPS///cache form), the read command run for real against a temporary apt tree, the rewrite (suffixes, URIs that name the release, prefixes that are not it, disabled paragraphs), and the mixin against a fake host (served / not served,Releasefallback, one missing suite keeps the whole file, a path apt does not read is never written, nothing left to move, bad codenames). The full suite passes (1820), and ruff and mypy are clean.Docs
README,
docs/STRUCTURE.md, CHANGELOG (Unreleased).