Commit 76fcc0ec authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

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

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.

Reviewers: #discover_software_store, apol, ngraham

Reviewed By: #discover_software_store, apol

Subscribers: plasma-devel

Tags: #plasma, #discover_software_store

Differential Revision:
parent 20528c82
......@@ -255,7 +255,7 @@ QProcess* PackageKitNotifier::checkAptVariable(const QString &aptconfig, const Q
if (code != 0)
QRegularExpression rx(QLatin1Char('^') + varname + QStringLiteral(" \"(.*?)\"$"));
QRegularExpression rx(QLatin1Char('^') + varname + QStringLiteral(" \"(.*?)\";?$"), QRegularExpression::CaseInsensitiveOption);
QTextStream stream(process);
QString line;
while (stream.readLineInto(&line)) {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment