TarPackageDeployService: Get rid of killer process

The installation process is being run in remote shell, so
closing the process with close() should finish the remote
shell together with all running children processes.
There is not need for separate "tar" killer.

Change-Id: Ib3b36ca955fe033cea8abdffbee3f14a5e007905
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2022-11-22 19:40:48 +01:00
parent dfd06ec175
commit 85340d9508

View File

@@ -44,7 +44,6 @@ private:
void setFinished();
void installPackage(const IDeviceConstPtr &deviceConfig, const QString &packageFilePath);
void cancelInstallation();
State m_state = Inactive;
FileTransfer m_uploader;
@@ -52,7 +51,6 @@ private:
IDevice::ConstPtr m_device;
QtcProcess m_installer;
QtcProcess m_killer;
};
TarPackageDeployService::TarPackageDeployService()
@@ -88,15 +86,6 @@ void TarPackageDeployService::installPackage(const IDevice::ConstPtr &deviceConf
m_installer.start();
}
void TarPackageDeployService::cancelInstallation()
{
QTC_ASSERT(m_installer.state() != QProcess::NotRunning, return);
m_killer.setCommand({m_device->filePath("/bin/sh"), {"-c", "pkill tar"}});
m_killer.start();
m_installer.close();
}
void TarPackageDeployService::setPackageFilePath(const FilePath &filePath)
{
m_packageFilePath = filePath;
@@ -127,19 +116,8 @@ void TarPackageDeployService::doDeploy()
void TarPackageDeployService::stopDeployment()
{
switch (m_state) {
case Inactive:
qWarning("%s: Unexpected state 'Inactive'.", Q_FUNC_INFO);
break;
case Uploading:
m_uploader.stop();
setFinished();
break;
case Installing:
cancelInstallation();
setFinished();
break;
}
QTC_ASSERT(m_state != Inactive, return);
setFinished();
}
void TarPackageDeployService::handleUploadFinished(const ProcessResultData &resultData)