-
Notifications
You must be signed in to change notification settings - Fork 157
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
Expand PkInfoEnum to contain package target states for updates #726
Conversation
Ping @hughsie or maybe @pwithnall - this patch fixes the linked GNOME Software issues and I've been running it without issues for a while, but it is quite the API addition and I find it suspicious that we didn't have these enums already back in ancient times when the Simulate* methods were introduced... |
We have
I guess this is due to this issue as well ? |
I’m definitely not an expert on PackageKit, so can’t comment from a historical or high-level-architectural point of view. But this PR does seem to make sense and I don’t have any suggestions for how to improve it. It’s a good sign that you’ve been running with it locally without issues for a while. |
It is. The InfoEnum is really completely overloaded with state, action and priority information, but disentangling that would be a really annoying API break - it would break everything. So I won't do that yet, maybe for PackageKit 2 😅
I've been involved since forever, so I should know this, which made me suspicious as this is such a basic feature and has not come up in a decade. On my system, the usual suspects (GNOME Software, KDE Discover, ...) work fine, so if something would break it'll be a less-used tool. But I also don't consider the breakage risk very high, tbh :-) |
Maybe, we should test it with
I'm running |
I am thinking the same way actually. The DNF backend somehow emits less status information, so you will probably only have issues on Debian-based systems, if there even would be any. I plan to make a new PK release as soon as I got back to actually reviewing outstanding PRs, and there is some breakage that the previous merging of the GTask modernization may have caused which I would like to have fixed. So, this would stay in Git for a while for sure... Let's merge it :-) |
Much better now with fix.
|
I guess "Install" could also be "New"... But "Install" as a designated action is probably a bit more obvious... |
|
Hi!
I was investigating https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2462 - the gist of that issue is that GNOME Software emits a
Refresh
action. The APT backend in this case has a bunch of packages that the update will install or remove. So it emits them asPK_INFO_ENUM_INSTALLING
/REMOVING
etc. Same for a call toGetUpdates
. GNOME Software reads this as "there is currently a package being installed so the cache may be out of date!" and immediately fires anotherRefresh
, resulting in an endless loop between PK and GS (and a lot of drained batteries on Debian laptops).According to our own documentation, emitting INSTALLING etc. is actually not valid and PackageKit/the APT backend is wrong here. But we also do not seem to have any state conveying the information that the package is supposed to be install/removed/obsoleted/downgraded with the next action / when the update is executed.
So the APT backend can't currently do anything here. From looking at the code (and without testing it), DNF just seems to ignore this problem, other backends do similarly wrong things.
This patch expands PK itself to provide the necessary states. But I am fairly puzzled that this feature hasn't been there since forever. And while this is not a breaking change, it will add some extra work for frontends. So I wonder, am I missing anything here and has this been possible in a different way? I honestly can't recall any, and we just used
INSTALLING
without issues so far until GS ran into it.But maybe @hughsie knows? If this is really missing, I will polish this PR up a bit and merge it.