From fd560b2d245a3e9ee1a7b84b07d05ea0c7af8f36 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 6 Jul 2011 10:32:25 +0200 Subject: [PATCH] RemoteLinux: Fix port collecting for Harmattan. At some point, the devrootsh tool turned from a sudo implementation to some stupid magic crap thing, so we can't use it anymore. Change-Id: Ice175eb8a1e64e210a26c2cbfb463414e4a91982 Reviewed-on: http://codereview.qt.nokia.com/1213 Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/maemousedportsgatherer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/remotelinux/maemousedportsgatherer.cpp b/src/plugins/remotelinux/maemousedportsgatherer.cpp index b5711b5db6..c72371989c 100644 --- a/src/plugins/remotelinux/maemousedportsgatherer.cpp +++ b/src/plugins/remotelinux/maemousedportsgatherer.cpp @@ -64,10 +64,12 @@ void MaemoUsedPortsGatherer::start(const Utils::SshConnection::Ptr &connection, SLOT(handleRemoteStdOut(QByteArray))); connect(m_procRunner.data(), SIGNAL(processErrorOutputAvailable(QByteArray)), SLOT(handleRemoteStdErr(QByteArray))); - const QString command = MaemoGlobal::remoteSudo(devConf->osType(), - m_procRunner->connection()->connectionParameters().userName) - + QLatin1String(" lsof -nPi4tcp:") + devConf->freePorts().toString() + QString command = QLatin1String("lsof -nPi4tcp:") + devConf->freePorts().toString() + QLatin1String(" -F n |grep '^n' |sed -r 's/[^:]*:([[:digit:]]+).*/\\1/g' |sort -n |uniq"); + if (devConf->osType() != LinuxDeviceConfiguration::HarmattanOsType) { // devrootsh is broken on Harmattan + command.prepend(MaemoGlobal::remoteSudo(devConf->osType(), + devConf->sshParameters().userName) + QLatin1Char(' ')); + } m_procRunner->run(command.toUtf8()); m_running = true; } -- 2.11.0