Qnx: Get rid of chmod step, it's a part of sftp transfer now

Change-Id: I692a8e03a7f628a4a1bfca1858b89291f854bb1b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2023-12-08 11:01:09 +01:00
parent 465259eb3b
commit 867570d8dd

View File

@@ -36,8 +36,6 @@ using namespace Utils;
namespace Qnx::Internal { namespace Qnx::Internal {
const int MaxConcurrentStatCalls = 10;
class QnxDeployQtLibrariesDialogPrivate : public QObject class QnxDeployQtLibrariesDialogPrivate : public QObject
{ {
public: public:
@@ -93,8 +91,6 @@ private:
GroupItem checkDirTask(); GroupItem checkDirTask();
GroupItem removeDirTask(); GroupItem removeDirTask();
GroupItem uploadTask(); GroupItem uploadTask();
GroupItem chmodTask(const DeployableFile &file);
GroupItem chmodTree();
enum class CheckResult { RemoveDir, SkipRemoveDir, Abort }; enum class CheckResult { RemoveDir, SkipRemoveDir, Abort };
CheckResult m_checkResult = CheckResult::Abort; CheckResult m_checkResult = CheckResult::Abort;
@@ -179,7 +175,10 @@ GroupItem QnxDeployQtLibrariesDialogPrivate::uploadTask()
emitErrorMessage(message); emitErrorMessage(message);
return SetupResult::StopWithError; return SetupResult::StopWithError;
} }
files.append({file.localFilePath(), m_device->filePath(file.remoteFilePath())}); const FilePermissions permissions = file.isExecutable()
? FilePermissions::ForceExecutable : FilePermissions::Default;
files.append({file.localFilePath(), m_device->filePath(file.remoteFilePath()),
permissions});
} }
if (files.isEmpty()) { if (files.isEmpty()) {
emitProgressMessage(Tr::tr("No files need to be uploaded.")); emitProgressMessage(Tr::tr("No files need to be uploaded."));
@@ -196,43 +195,6 @@ GroupItem QnxDeployQtLibrariesDialogPrivate::uploadTask()
return FileTransferTask(onSetup, onError, CallDoneIf::Error); return FileTransferTask(onSetup, onError, CallDoneIf::Error);
} }
GroupItem QnxDeployQtLibrariesDialogPrivate::chmodTask(const DeployableFile &file)
{
const auto onSetup = [this, file](Process &process) {
process.setCommand({m_device->filePath("chmod"),
{"a+x", Utils::ProcessArgs::quoteArgUnix(file.remoteFilePath())}});
};
const auto onError = [this, file](const Process &process) {
const QString error = process.errorString();
if (!error.isEmpty()) {
emitWarningMessage(Tr::tr("Remote chmod failed for file \"%1\": %2")
.arg(file.remoteFilePath(), error));
} else if (process.exitCode() != 0) {
emitWarningMessage(Tr::tr("Remote chmod failed for file \"%1\": %2")
.arg(file.remoteFilePath(), process.cleanedStdErr()));
}
};
return ProcessTask(onSetup, onError, CallDoneIf::Error);
}
GroupItem QnxDeployQtLibrariesDialogPrivate::chmodTree()
{
const auto onSetup = [this](TaskTree &tree) {
QList<DeployableFile> filesToChmod;
for (const DeployableFile &file : std::as_const(m_deployableFiles)) {
if (file.isExecutable())
filesToChmod << file;
}
QList<GroupItem> chmodList{finishAllAndSuccess, parallelLimit(MaxConcurrentStatCalls)};
for (const DeployableFile &file : std::as_const(filesToChmod)) {
QTC_ASSERT(file.isValid(), continue);
chmodList.append(chmodTask(file));
}
tree.setRecipe(chmodList);
};
return TaskTreeTask(onSetup);
}
Group QnxDeployQtLibrariesDialogPrivate::deployRecipe() Group QnxDeployQtLibrariesDialogPrivate::deployRecipe()
{ {
const auto setupHandler = [this] { const auto setupHandler = [this] {
@@ -269,8 +231,7 @@ Group QnxDeployQtLibrariesDialogPrivate::deployRecipe()
Group { Group {
onGroupSetup(subGroupSetupHandler), onGroupSetup(subGroupSetupHandler),
removeDirTask(), removeDirTask(),
uploadTask(), uploadTask()
chmodTree()
}, },
onGroupDone(doneHandler, CallDoneIf::Success) onGroupDone(doneHandler, CallDoneIf::Success)
}; };