Commit 78ea4d2d authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: More stable check for on-device Qt packages.

According to the man page, dpkg -l ist not suitable for automated parsing.

Reviewed-by: kh1
parent 1d978a36
...@@ -89,9 +89,8 @@ void MaemoConfigTestDialog::handleConnected() ...@@ -89,9 +89,8 @@ void MaemoConfigTestDialog::handleConnected()
if (!m_connection) if (!m_connection)
return; return;
QLatin1String sysInfoCmd("uname -rsm"); QLatin1String sysInfoCmd("uname -rsm");
QLatin1String qtInfoCmd("dpkg -l |grep libqt |grep '^ii'" QLatin1String qtInfoCmd("dpkg-query -W -f '${Package} ${Version} ${Status}\n' 'libqt*' "
"|sed 's/[[:space:]][[:space:]]*/ /g' " "|grep ' installed$'");
"|cut -d ' ' -f 2,3 |sed 's/~.*//g'");
QString command(sysInfoCmd + " && " + qtInfoCmd); QString command(sysInfoCmd + " && " + qtInfoCmd);
m_infoProcess = m_connection->createRemoteProcess(command.toUtf8()); m_infoProcess = m_connection->createRemoteProcess(command.toUtf8());
connect(m_infoProcess.data(), SIGNAL(closed(int)), this, connect(m_infoProcess.data(), SIGNAL(closed(int)), this,
...@@ -205,7 +204,7 @@ QString MaemoConfigTestDialog::parseTestOutput() ...@@ -205,7 +204,7 @@ QString MaemoConfigTestDialog::parseTestOutput()
output = tr("Hardware architecture: %1\n").arg(unamePattern.cap(2)); output = tr("Hardware architecture: %1\n").arg(unamePattern.cap(2));
output.append(tr("Kernel version: %1\n").arg(unamePattern.cap(1))); output.append(tr("Kernel version: %1\n").arg(unamePattern.cap(1)));
const QRegExp dkpgPattern(QLatin1String("libqt\\S+\\s+(?:\\d:)?(\\d)\\.(\\d)\\.(\\d)")); const QRegExp dkpgPattern(QLatin1String("(\\S+) (\\S*(\\d+)\\.(\\d+)\\.(\\d+)\\S*) \\S+ \\S+ \\S+"));
index = dkpgPattern.indexIn(m_deviceTestOutput); index = dkpgPattern.indexIn(m_deviceTestOutput);
if (index == -1) { if (index == -1) {
output.append(tr("No Qt packages installed.")); output.append(tr("No Qt packages installed."));
...@@ -214,11 +213,12 @@ QString MaemoConfigTestDialog::parseTestOutput() ...@@ -214,11 +213,12 @@ QString MaemoConfigTestDialog::parseTestOutput()
output.append(tr("List of installed Qt packages:") + QLatin1Char('\n')); output.append(tr("List of installed Qt packages:") + QLatin1Char('\n'));
do { do {
output.append(QLatin1Char('\t') + dkpgPattern.cap(0) output.append(QLatin1Char('\t') + dkpgPattern.cap(1) + QLatin1Char(' ')
+ QLatin1Char('\n')); + dkpgPattern.cap(2) + QLatin1Char('\n'));
index = dkpgPattern.indexIn(m_deviceTestOutput, index + 1); index = dkpgPattern.indexIn(m_deviceTestOutput, index
if (!m_qtVersionOk && QT_VERSION_CHECK(dkpgPattern.cap(1).toInt(), + dkpgPattern.cap(0).length());
dkpgPattern.cap(2).toInt(), dkpgPattern.cap(3).toInt()) >= 0x040602) { if (!m_qtVersionOk && QT_VERSION_CHECK(dkpgPattern.cap(3).toInt(),
dkpgPattern.cap(4).toInt(), dkpgPattern.cap(5).toInt()) >= 0x040602) {
m_qtVersionOk = true; m_qtVersionOk = true;
} }
} while (index != -1); } while (index != -1);
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>395</width> <width>661</width>
<height>190</height> <height>324</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment