-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnfdaemon: system-upgrade API and command #1588
Conversation
Following @options are supported: | ||
|
||
- mode: string (one of "distrosync", "upgrade", default is "distrosync") | ||
By default the system_upgrade behaves like `dnf distro-sync`, always installing packages from the new release, even if they are older then the currently installed version. If set to "upgrade", packages from the new release are not installed if they are older then what is currently installed (behave like `dnf upgrade`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
older than
, twice in the text
- mode: string (one of "distrosync", "upgrade", default is "distrosync") | ||
By default the system_upgrade behaves like `dnf distro-sync`, always installing packages from the new release, even if they are older then the currently installed version. If set to "upgrade", packages from the new release are not installed if they are older then what is currently installed (behave like `dnf upgrade`). | ||
|
||
Unknown options are ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how to I set the release version to be upgraded to? It seems to be "detected" somehow, but one can upgrade both to N+1 and N+2. An explicit "upgrade to releasever
X" would be better.
The python example suggests the releasever
is set within the open_session
. Could there be added an argument, which will override that value if set, here as well, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Releasever should be set using the open_session()
option. It needs to be set before the repositories metadata are loaded and setting it here can be too late. I'll add this information to the method description.
throw sdbus::Error( | ||
dnfdaemon::ERROR, | ||
fmt::format( | ||
"Unsupported system-ugrade mode \"{}\". Only \"distrosync\" and \"upgrade\" modes are supported.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/system-ugrade/system-upgrade/
(missing p
in the second word)
# along with libdnf. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
""" | ||
This is an example how to perform a system-upgrade with dnf5daemon-server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the two spaces near the end of the line intentional?
Following @options are supported: | ||
|
||
- mode: string (one of "distrosync", "upgrade", default is "distrosync") | ||
By default the system_upgrade behaves like `dnf distro-sync`, always installing packages from the new release, even if they are older then the currently installed version. If set to "upgrade", packages from the new release are not installed if they are older then what is currently installed (behave like `dnf upgrade`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the similarities with those modes the dnf5 distro-sync
and dnf5 system-upgrade
? I see some differences between the two, like the first can run "online" or "offline" while the other is always "offline". The first has --download only
, the second is always split into two phases, download
and reboot
.
For the gnome-software it'll be always download
and then reboot-to-install
. It should be possible to change my mind and not install previously prepared system upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more about what method system-upgrade
uses in background. By default the dnf5 system-upgrade download
is roughly equivalent to dnf5 distro-sync --offline
. But with dnf5 system-upgrade download --no-downgrade
option the system upgrade makes sure, that packages from the new release that are of older version then currently installed are not used. In this case its roughly equivalent to dnf5 upgrade --offline
.
I will add code to enforce "offline" behavior to "Rpm.system_upgrade()" call, because currently it relies on offline
option being passed to Goal.do_transaction()
method.
c583173
to
1bd0414
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good I am only thinking how we could CI test it.
Perhaps some special step?
The method fills the goal to perform upgrade of the distribution to the new release.
1bd0414
to
e90f79e
Compare
I'm trying it here, and I noticed one thing:
The This is with the default options, thus the |
Changes:
c583173 (Marek Blaha, 72 minutes ago)
doc: Add system-upgrade example using D-Bus API
960882b (Marek Blaha, 6 days ago)
dnf5daemon-client: system-upgrade command
fe4b380 (Marek Blaha, 7 weeks ago)
dnfdaemon: Add system_upgrade() method to Rpm interface
The method fills the goal to perform upgrade of the distribution to the new
release.