From 707d9e12cf687c0ff61a3acf35d743c6f1f3adc7 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 23 Feb 2017 13:26:02 +0000 Subject: [PATCH] Fix issues with package upgrades on Windows. --- simgear/package/Install.cxx | 5 +++++ simgear/package/Root.cxx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/simgear/package/Install.cxx b/simgear/package/Install.cxx index 4ba1dcbc..a365b46a 100644 --- a/simgear/package/Install.cxx +++ b/simgear/package/Install.cxx @@ -152,6 +152,11 @@ protected: return; } + // disable caching on the owner's path, otherwise the upcoming + // delete & rename confuse everything + m_owner->m_path.set_cached(false); + m_extractPath.set_cached(false); + if (m_owner->path().exists()) { Dir destDir(m_owner->path()); destDir.remove(true /* recursive */); diff --git a/simgear/package/Root.cxx b/simgear/package/Root.cxx index 5ca36ccd..6040e936 100644 --- a/simgear/package/Root.cxx +++ b/simgear/package/Root.cxx @@ -477,7 +477,7 @@ void Root::installProgress(InstallRef aInstall, unsigned int aBytes, unsigned in void Root::startNext(InstallRef aCurrent) { - if (d->updateDeque.front() != aCurrent) { + if (d->updateDeque.empty() || (d->updateDeque.front() != aCurrent)) { SG_LOG(SG_GENERAL, SG_ALERT, "current install of package not head of the deque"); } else { d->updateDeque.pop_front();