forked from qt-creator/qt-creator
RemoteLinux: Let sftp work on the last hop
... even if the final target is not directly accessible. This does not affect existing use cases but allows one more: DesktopDevice --ssh--> Source/Build --sft--> RunDevice, with the RunDevice not directly accessible from the Desktop. That setup exists in reality for our QNX CI machines. Change-Id: I5cda28cc835af914f2438f99d6a3facf584c74c6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1174,6 +1174,8 @@ protected:
|
|||||||
connect(&m_process, &QtcProcess::done, this, &SshTransferInterface::doneImpl);
|
connect(&m_process, &QtcProcess::done, this, &SshTransferInterface::doneImpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IDevice::ConstPtr device() const { return m_device; }
|
||||||
|
|
||||||
bool handleError()
|
bool handleError()
|
||||||
{
|
{
|
||||||
ProcessResultData resultData = m_process.resultData();
|
ProcessResultData resultData = m_process.resultData();
|
||||||
@@ -1281,7 +1283,13 @@ public:
|
|||||||
private:
|
private:
|
||||||
void startImpl() final
|
void startImpl() final
|
||||||
{
|
{
|
||||||
const FilePath sftpBinary = SshSettings::sftpFilePath();
|
FilePath sftpBinary = SshSettings::sftpFilePath();
|
||||||
|
|
||||||
|
// This is a hack. We only test the last hop here.
|
||||||
|
const Id linkDeviceId = Id::fromSetting(device()->extraData(Constants::LinkDevice));
|
||||||
|
if (const auto linkDevice = DeviceManager::instance()->find(linkDeviceId))
|
||||||
|
sftpBinary = linkDevice->filePath(sftpBinary.fileName()).searchInPath();
|
||||||
|
|
||||||
if (!sftpBinary.exists()) {
|
if (!sftpBinary.exists()) {
|
||||||
startFailed(Tr::tr("\"sftp\" binary \"%1\" does not exist.")
|
startFailed(Tr::tr("\"sftp\" binary \"%1\" does not exist.")
|
||||||
.arg(sftpBinary.toUserOutput()));
|
.arg(sftpBinary.toUserOutput()));
|
||||||
|
Reference in New Issue
Block a user