feat(updates): the update history from apt's own log, with Proxmox VE 9.3's ids (NetOrk/netork#2728)
AptHistoryMixin implements get_update_history over run_command: history.log and its
rotations in one round trip as the login user, root only for a file that user may not
read. Dates are read in the host's zone; a transaction's id is its start and the number
of earlier ones with that start in the same file, as GET /nodes/{node}/apt/history names
it. Malformed blocks are left out, a report cut short raises.
This commit is contained in:
1 parent
5985c87cc8
commit
e3420269b7
6 files changed
+843
No files matched your search
@@ -7,6 +7,22 @@ recorded here; their history is the git log.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- `AptHistoryMixin.get_update_history(since)`: apt's own history log as past transactions
|
||||
(NetOrk/netork#2728), for every driver of a Debian-family host that has `run_command`.
|
||||
`APT_HISTORY_COMMAND` prints `/var/log/apt/history.log` and its rotations
|
||||
(`history.log.<n>.gz` through `zcat`) in one round trip, as the login user (the files
|
||||
are 0644), with the host's time zone (`/etc/localtime`'s link, `/etc/timezone`) and
|
||||
`date +%z` for a zone without a name; only a file that user may not read makes the
|
||||
mixin read it again as root. `parse_apt_history(text, since)` reads apt's dates in that
|
||||
zone and names each transaction as Proxmox VE 9.3's `GET /nodes/{node}/apt/history`
|
||||
does: start time and the number of earlier transactions with that start in the same
|
||||
file, so a node that moves to 9.3 keeps its ids. Strict: a block whose package lines
|
||||
do not read as apt writes them is left out (and still counted), one without
|
||||
`End-Date` has `end` None, a report cut short or a file that could not be read raises.
|
||||
- `apt_history_command(log_dir)`, `host_zone(name, offset)` and `AptHistoryUnreadable`
|
||||
(a `PermissionError`), in `apt_history`.
|
||||
|
||||
## [4.46.0] - 2026-11-26
|
||||
|
||||
### Fixed
|
||||
|
||||
Reference in new issue
Block a user