RemoteLinux: Fix deployment of directories via rsync

If the source path is a directory, we need to append a slash to tell
rsync that it should not interpret the target file path as the parent
directory.

Fixes: QTCREATORBUG-23235
Change-Id: I8bf0737ecf710e6a1c341cf6559b34f6b1d64e38
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-12-02 17:55:22 +01:00
parent 73d3df7908
commit fd39ea9ef9

View File

@@ -159,7 +159,7 @@ void RsyncDeployService::deployNextFile()
const DeployableFile file = m_deployableFiles.takeFirst(); const DeployableFile file = m_deployableFiles.takeFirst();
const RsyncCommandLine cmdLine = RsyncDeployStep::rsyncCommand(*connection(), m_flags); const RsyncCommandLine cmdLine = RsyncDeployStep::rsyncCommand(*connection(), m_flags);
const QStringList args = QStringList(cmdLine.options) const QStringList args = QStringList(cmdLine.options)
<< file.localFilePath().toString() << (file.localFilePath().toString() + (file.localFilePath().isDir() ? "/" : QString()))
<< (cmdLine.remoteHostSpec + ':' + file.remoteFilePath()); << (cmdLine.remoteHostSpec + ':' + file.remoteFilePath());
m_rsync.start("rsync", args); // TODO: Get rsync location from settings? m_rsync.start("rsync", args); // TODO: Get rsync location from settings?
} }