summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2011-11-25 13:34:38 +0100
committerTim Jenssen <tim.jenssen@nokia.com>2011-11-28 09:20:07 +0100
commit5e926ed0864e81fc91edac73322893f5b92a2791 (patch)
tree735f5f5a512809cc31f1d9ee7268a2c86245766a
parent6cbc6dc80d9a8f18c01cbf72291dfe033f9a6534 (diff)
Make sure to create components for local installed packages.
Should fix a problem in case we point the repo to a complete different url or a component get's removed from the original server. The problem then was, there was no component created for the local installed package, which in case of update or package managment would remove the local package as no component cold be found for the stored operations. -> see runPackageUpdater Change-Id: I7394691c533609526d09e994f509b47b9cb9c206 Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
-rw-r--r--installerbuilder/libinstaller/packagemanagercore.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/installerbuilder/libinstaller/packagemanagercore.cpp b/installerbuilder/libinstaller/packagemanagercore.cpp
index e32434a12..476d34650 100644
--- a/installerbuilder/libinstaller/packagemanagercore.cpp
+++ b/installerbuilder/libinstaller/packagemanagercore.cpp
@@ -1558,6 +1558,14 @@ bool PackageManagerCore::fetchAllPackages(const PackagesList &remotes, const Loc
}
}
+ foreach (const QString &key, locals.keys()) {
+ QScopedPointer<QInstaller::Component> component(new QInstaller::Component(this));
+ component->loadDataFromPackage(locals.value(key));
+ const QString &name = component->name();
+ if (!components.contains(name))
+ components.insert(name, component.take());
+ }
+
// store all components that got a replacement
storeReplacedComponents(components, data);
@@ -1581,6 +1589,7 @@ bool PackageManagerCore::fetchUpdaterPackages(const PackagesList &remotes, const
data.installedPackages = &locals;
bool foundEssentialUpdate = false;
+ LocalPackagesHash installedPackages = locals;
foreach (Package *const update, remotes) {
if (d->statusCanceledOrFailed())
@@ -1599,6 +1608,7 @@ bool PackageManagerCore::fetchUpdaterPackages(const PackagesList &remotes, const
const QString &name = d->m_updaterComponentsDeps.last()->name();
const QString replaces = data.package->data(scReplaces).toString();
+ installedPackages.take(name); // remove from local installed packages
bool isValidUpdate = locals.contains(name);
if (!isValidUpdate && !replaces.isEmpty()) {
@@ -1631,6 +1641,12 @@ bool PackageManagerCore::fetchUpdaterPackages(const PackagesList &remotes, const
}
}
+ foreach (const QString &key, installedPackages.keys()) {
+ QInstaller::Component *component = new QInstaller::Component(this);
+ component->loadDataFromPackage(installedPackages.value(key));
+ d->m_updaterComponentsDeps.append(component);
+ }
+
// store all components that got a replacement
storeReplacedComponents(components, data);