rpm-software-management / dnf5

Next-generation RPM package management system
Other
240 stars 78 forks source link

`dnf offline status` should also check the /system-update symlink presence #1587

Open m-blaha opened 2 months ago

m-blaha commented 2 months ago

Currently, the dnf offline status command checks only the status file stored in /usr/lib/sysimage/libdnf5/offline/offline-transaction-state.toml.

This approach can cause confusion because the output doesn't clearly convey that the An offline transaction was initiated... message actually only means that there is a transaction prepared by dnf5 in /usr/lib/sysimage/libdnf5/offline/. It does not indicate whether the transaction will be performed during the next reboot or not. Moreover, there might be an offline upgrade scheduled for the next reboot by another tool, but the output does not report this.

See also https://github.com/rpm-software-management/dnf5/issues/1584

ppisar commented 2 months ago

Do you propose "dnf offline status" to:

I asks because wording of the message should match it.

m-blaha commented 2 months ago

Well, it should somehow make it clear, that there are two offline transaction statuses:

  1. from systemd point of view it's the existence of /system-update magic symlink, meaning that there is a pending offline upgrade waiting for the reboot to be triggered (not necessarily initiated by dnf5)
  2. from dnf5 point of view it's presence (and status) of an offline transaction stored in /usr/lib/sysimage/libdnf5/offline, not necessarily scheduled for execution during the next reboot.

Both these statuses should be covered.