forked from qt-creator/qt-creator
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:
@@ -44,7 +44,6 @@ private:
|
|||||||
void setFinished();
|
void setFinished();
|
||||||
|
|
||||||
void installPackage(const IDeviceConstPtr &deviceConfig, const QString &packageFilePath);
|
void installPackage(const IDeviceConstPtr &deviceConfig, const QString &packageFilePath);
|
||||||
void cancelInstallation();
|
|
||||||
|
|
||||||
State m_state = Inactive;
|
State m_state = Inactive;
|
||||||
FileTransfer m_uploader;
|
FileTransfer m_uploader;
|
||||||
@@ -52,7 +51,6 @@ private:
|
|||||||
|
|
||||||
IDevice::ConstPtr m_device;
|
IDevice::ConstPtr m_device;
|
||||||
QtcProcess m_installer;
|
QtcProcess m_installer;
|
||||||
QtcProcess m_killer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TarPackageDeployService::TarPackageDeployService()
|
TarPackageDeployService::TarPackageDeployService()
|
||||||
@@ -88,15 +86,6 @@ void TarPackageDeployService::installPackage(const IDevice::ConstPtr &deviceConf
|
|||||||
m_installer.start();
|
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)
|
void TarPackageDeployService::setPackageFilePath(const FilePath &filePath)
|
||||||
{
|
{
|
||||||
m_packageFilePath = filePath;
|
m_packageFilePath = filePath;
|
||||||
@@ -127,19 +116,8 @@ void TarPackageDeployService::doDeploy()
|
|||||||
|
|
||||||
void TarPackageDeployService::stopDeployment()
|
void TarPackageDeployService::stopDeployment()
|
||||||
{
|
{
|
||||||
switch (m_state) {
|
QTC_ASSERT(m_state != Inactive, return);
|
||||||
case Inactive:
|
|
||||||
qWarning("%s: Unexpected state 'Inactive'.", Q_FUNC_INFO);
|
|
||||||
break;
|
|
||||||
case Uploading:
|
|
||||||
m_uploader.stop();
|
|
||||||
setFinished();
|
setFinished();
|
||||||
break;
|
|
||||||
case Installing:
|
|
||||||
cancelInstallation();
|
|
||||||
setFinished();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TarPackageDeployService::handleUploadFinished(const ProcessResultData &resultData)
|
void TarPackageDeployService::handleUploadFinished(const ProcessResultData &resultData)
|
||||||
|
Reference in New Issue
Block a user