diff options
author | kh1 <karsten.heimrich@nokia.com> | 2011-08-16 16:14:01 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-08-16 16:36:57 +0200 |
commit | 63f0f5378a31336f5b6048651946808e5716a9fe (patch) | |
tree | 0727c31b89a818ac2f8b0c5068ecae8f47f54786 | |
parent | d6527c7d309f4ceb01e8d927ebbea3b61048c1fc (diff) |
Fix the broken update case.
If we have more than one component to update, keep
all components that might have an update though are not
selected (scheduled) for update. Means 3 components to
update, on selected, two deselected, keep the later and
only add the single component operations to the undo list.
Change-Id: I8364a46bf76d8fd73b1bdbce446ba6ea90c2dc53
Reviewed-on: http://codereview.qt.nokia.com/3045
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Niels Weber <niels.2.weber@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
-rw-r--r-- | installerbuilder/libinstaller/packagemanagercore_p.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/installerbuilder/libinstaller/packagemanagercore_p.cpp b/installerbuilder/libinstaller/packagemanagercore_p.cpp index 986b945d2..0ff43fc76 100644 --- a/installerbuilder/libinstaller/packagemanagercore_p.cpp +++ b/installerbuilder/libinstaller/packagemanagercore_p.cpp @@ -1246,10 +1246,22 @@ void PackageManagerCorePrivate::runPackageUpdater() component = m_core->componentByName(name); if (component) { componentsByName.insert(name, component); - // if we're _not_ removing everything and this component is still selected, -> next - if (component->isSelected()) { - nonRevertedOperations.append(operation); - continue; + + if (isUpdater()) { + // If we have a component scheduled for update, do not break as we need whose operations in + // the undo list to be able to properly update (uninstall -> install). In case we had more + // then one update, others might have been deselected - so we need to keep them to avoid + // uninstalling the component the update was possible for. + if (!component->updateRequested() && !componentsToInstall.contains(component)) { + nonRevertedOperations.append(operation); + continue; + } + } else { + // If we're _not_ removing everything and this component is still selected, -> next. + if (component->isSelected()) { + nonRevertedOperations.append(operation); + continue; + } } } |