packagekit: Fix checking of APT::Periodic::Update-Package-Lists
ClosedPublic

Authored by eliac on Mar 20 2020, 6:20 PM.

Details

Summary

BUG: 419055

Currently PackageKitNotifier attempts to check the frequency by running apt-config dump and looking for the Apt::Periodic::Update-Package-Lists property in its output. However, on my system the property name starts with uppercase APT rather than Apt, and ends with a semicolon.

This patch is a defensive, backward-compatible fix. It assumes that under some circumstances the previous code was correct to look for Apt and no ending semicolon. To cover both cases, I edited the regexp to allow for an optional semicolon, and to make the comparison case-insensitive.

Diff Detail

Repository
R134 Discover Software Store
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
eliac created this revision.Mar 20 2020, 6:20 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 20 2020, 6:20 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
eliac requested review of this revision.Mar 20 2020, 6:20 PM
apol accepted this revision.Mar 20 2020, 10:56 PM
apol retitled this revision from Let Discover take the frequency of automatic update checks from apt. to packagekit: Fix checking of APT::Periodic::Update-Package-Lists.
This revision is now accepted and ready to land.Mar 20 2020, 10:57 PM
apol added a comment.Mar 23 2020, 4:22 AM

Do you want me to land the change?

eliac added a comment.Mar 23 2020, 8:05 AM

On the off-chance it's me you're asking - sure :)
(First time contributor, not sure how the process works...)

This revision was automatically updated to reflect the committed changes.

Very nice patch! May it be the first of many. :)