Skip to content

Commit 9c990fc

Browse files
committed
Check for debconf kde first and then for gnome, if not found fall back to noninteractive
1 parent 78d627b commit 9c990fc

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/mainwindow.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ QString sanitizeOutputForDisplay(const QString &output)
7070

7171
QString debconfFrontend()
7272
{
73-
return QFile::exists("/usr/share/doc/debconf-kde-helper") ? QStringLiteral("kde") : QStringLiteral("gnome");
73+
if (QFile::exists("/usr/share/doc/debconf-kde-helper")) {
74+
return QStringLiteral("kde");
75+
}
76+
if (QFile::exists("/usr/share/doc/debconf-gnome")) {
77+
return QStringLiteral("gnome");
78+
}
79+
return QStringLiteral("noninteractive");
7480
}
7581

7682
QHash<QString, QString> debconfEnvironment()
@@ -3296,8 +3302,9 @@ void MainWindow::displayPackageInfo(const QModelIndex &index)
32963302

32973303
QString msg = cmd.getOut("aptitude show " + packageName);
32983304
// Remove first 5 lines from aptitude output "Reading package..."
3299-
QString details = cmd.getOut("DEBIAN_FRONTEND=$(dpkg -l debconf-kde-helper 2>/dev/null "
3300-
"| grep -sq ^i && echo kde || echo gnome) aptitude -sy -V -o=Dpkg::Use-Pty=0 install "
3305+
QString details = cmd.getOut("DEBIAN_FRONTEND=$(dpkg -l debconf-kde-helper 2>/dev/null | grep -sq ^i && echo kde "
3306+
"|| dpkg -l debconf-gnome 2>/dev/null | grep -sq ^i && echo gnome "
3307+
"|| echo noninteractive) aptitude -sy -V -o=Dpkg::Use-Pty=0 install "
33013308
+ packageName + " |tail -5");
33023309

33033310
auto detail_list = details.split('\n');

0 commit comments

Comments
 (0)