[neon/neon/debug-installer/Neon/release] src: filter debug package candidates by name
Harald Sitter
null at kde.org
Tue Nov 17 15:04:13 GMT 2020
Git commit f9a565b582b3b378531974bbc7aebd33dca4751f by Harald Sitter.
Committed on 17/11/2020 at 14:23.
Pushed by sitter into branch 'Neon/release'.
filter debug package candidates by name
searchNames is really *foo* while we want ==foo
M +10 -1 src/DebugResolver.cpp
M +2 -1 src/DebugResolver.h
https://invent.kde.org/neon/neon/debug-installer/commit/f9a565b582b3b378531974bbc7aebd33dca4751f
diff --git a/src/DebugResolver.cpp b/src/DebugResolver.cpp
index 9de1dcc..8131356 100644
--- a/src/DebugResolver.cpp
+++ b/src/DebugResolver.cpp
@@ -1,5 +1,5 @@
/*
- Copyright © 2017 Harald Sitter <sitter at kde.org>
+ Copyright © 2017-2020 Harald Sitter <sitter at kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -26,6 +26,7 @@
void DebugResolver::resolve(const QStringList &candidates)
{
+ m_possibleCandidates = candidates;
for (const auto &candidate : candidates) {
auto *transaction =
PackageKit::Daemon::searchNames(candidate, PackageKit::Transaction::FilterNotInstalled);
@@ -53,6 +54,14 @@ void DebugResolver::transactionFinished()
void DebugResolver::packageFound(PackageKit::Transaction::Info, const QString &packageID, const QString &)
{
+ // searchNames matches the search string anywhere in the name so we need
+ // to further filter the list to exact matches.
+ // Otherwise foo-dbgsym will have libfoo-dbgsym as candidate even though
+ // it may be entirely unrelated to the crash.
+ const auto packageName = PackageKit::Daemon::packageName(packageID);
+ if (!m_possibleCandidates.contains(packageName)) {
+ return;
+ }
qDebug() << this << "dbgfound" << packageID << m_candidates;
if (!m_candidates.contains(packageID)) {
m_candidates << packageID;
diff --git a/src/DebugResolver.h b/src/DebugResolver.h
index 15fb45b..4bcb2ad 100644
--- a/src/DebugResolver.h
+++ b/src/DebugResolver.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2017 Harald Sitter <sitter at kde.org>
+ Copyright © 2017-2020 Harald Sitter <sitter at kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -43,6 +43,7 @@ private slots:
void packageFound(PackageKit::Transaction::Info, const QString &packageID, const QString &/* summary */);
private:
+ QStringList m_possibleCandidates;
QStringList m_candidates;
QSet<QObject *> m_transactions;
};
More information about the Neon-commits
mailing list