Commit fd560b2d authored by Christian Kandeler's avatar Christian Kandeler
Browse files

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: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent ee635dcf
......@@ -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;
}
......
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