summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2011-07-06 10:32:25 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2011-07-06 13:09:21 +0200
commitfd560b2d245a3e9ee1a7b84b07d05ea0c7af8f36 (patch)
treee7cc68c098c82f1f0c2b7ef78744184fa848d5a6
parentee635dcf9e865c7bc405b81b09f0df5245c4b32a (diff)
downloadqt-creator-fd560b2d245a3e9ee1a7b84b07d05ea0c7af8f36.tar.gz
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 <christian.kandeler@nokia.com>
-rw-r--r--src/plugins/remotelinux/maemousedportsgatherer.cpp8
1 files 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;
}