优化,以防问题:135259 【2203自适应升级2209】控制面板备份后升级到2209,系统还原后,关于界面存在系统补丁版本号

This commit is contained in:
赵民勇 2022-08-17 10:50:15 +08:00
parent c1d52cfdf4
commit b98813d429
4 changed files with 15 additions and 4 deletions

View File

@ -296,7 +296,8 @@ void CustomizeSystemRestoreProxy::restoreSystem()
fileIfSync.replace("//", "/"); fileIfSync.replace("//", "/");
QFileInfo file(fileIfSync); QFileInfo file(fileIfSync);
QDateTime beginTime = file.fileTime(QFileDevice::FileModificationTime); QDateTime beginTime = file.fileTime(QFileDevice::FileModificationTime);
Utils::wait(10); QProcess::execute("sync");
Utils::wait(20);
Utils::updateSyncFile(); Utils::updateSyncFile();
while (1) { while (1) {
Utils::wait(2); Utils::wait(2);

View File

@ -90,17 +90,21 @@ void RsyncPathToDirProcess::rsync_finished(int exitCode, QProcess::ExitStatus)
qDebug() << "RsyncPathToDirProcess::rsync_finished invoke begin"; qDebug() << "RsyncPathToDirProcess::rsync_finished invoke begin";
if (exitCode == QProcess::NormalExit || exitCode == 24 || exitCode == 23) { if (exitCode == QProcess::NormalExit || exitCode == 24 || exitCode == 23) {
if (m_block) { if (m_block) {
qDebug() << "RsyncPathToDirProcess::rsync_finished block mode";
m_bSuccess = true; m_bSuccess = true;
emit progress(100); emit progress(100);
emit finished(true); emit finished(true);
} else { } else {
qDebug() << "RsyncPathToDirProcess::rsync_finished unblock mode";
m_syncProcess->start("sync"); m_syncProcess->start("sync");
if (!m_syncProcess->waitForStarted()) { if (!m_syncProcess->waitForStarted()) {
qDebug() << "sync start failed";
m_bSuccess = false; m_bSuccess = false;
emit finished(false); emit finished(false);
} }
} }
} else { } else {
qDebug() << "RsyncPathToDirProcess::rsync_finished failed";
m_bSuccess = false; m_bSuccess = false;
emit finished(false); emit finished(false);
} }
@ -112,10 +116,12 @@ void RsyncPathToDirProcess::sync_finished(int exitCode, QProcess::ExitStatus)
qDebug() << "RsyncPathToDirProcess::sync_finished invoke begin"; qDebug() << "RsyncPathToDirProcess::sync_finished invoke begin";
if (exitCode == QProcess::NormalExit || exitCode == 24 || exitCode == 23) { if (exitCode == QProcess::NormalExit || exitCode == 24 || exitCode == 23) {
qDebug() << "RsyncPathToDirProcess::sync_finished success";
m_bSuccess = true; m_bSuccess = true;
emit progress(100); emit progress(100);
emit finished(true); emit finished(true);
} else { } else {
qDebug() << "RsyncPathToDirProcess::sync_finished failed";
m_bSuccess = false; m_bSuccess = false;
emit finished(false); emit finished(false);
} }

View File

@ -363,7 +363,8 @@ void SystemRestoreProxy::restoreSystem()
// removeHome(Utils::getSysRootPath() + "/home"); // removeHome(Utils::getSysRootPath() + "/home");
// removeHome(Utils::getSysRootPath() + "/data/home"); // removeHome(Utils::getSysRootPath() + "/data/home");
// } // }
Utils::wait(10); QProcess::execute("sync");
Utils::wait(20);
Utils::updateSyncFile(); Utils::updateSyncFile();
while (1) { while (1) {
Utils::wait(2); Utils::wait(2);

View File

@ -411,7 +411,9 @@ void UDiskSystemRestoreProxy::restoreSystem()
fileIfSync.replace("//", "/"); fileIfSync.replace("//", "/");
QFileInfo file(fileIfSync); QFileInfo file(fileIfSync);
QDateTime beginTime = file.fileTime(QFileDevice::FileModificationTime); QDateTime beginTime = file.fileTime(QFileDevice::FileModificationTime);
Utils::wait(10); // sync();
QProcess::execute("sync");
Utils::wait(20);
Utils::updateSyncFile(); Utils::updateSyncFile();
while (1) { while (1) {
Utils::wait(2); Utils::wait(2);
@ -422,9 +424,10 @@ void UDiskSystemRestoreProxy::restoreSystem()
} }
if (m_backupWrapper.m_isOtherMachine) { if (m_backupWrapper.m_isOtherMachine) {
Utils::wait(20); Utils::wait(10);
updateGrubUUid(); updateGrubUUid();
sync(); sync();
QProcess::execute("sync");
Utils::wait(5); Utils::wait(5);
} }
} }