summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-10-17 15:41:38 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-10-18 10:00:30 +0300
commit20b0089be0c45ebf682f48e5d721762aa6eeda6c (patch)
treed418d8a62df11505a5d779b3b97dbbc9716455b8 /src/libs
parent59ce8c088fca01cfbabe9918302bdb0ee2eaf037 (diff)
Metadatajob: allow replacing existing items to metadata cache
It is a possible situation that a repository with the same Updates.xml checksum is retrieved from multiple URL:s on a single metadata fetch. This creates a scenario where more than one metadata item with the same checksum is pending registration to the cache, which will fail for the next item after the first registered one. Replacing existing items should be allowed instead. Change-Id: I8957202046231d03b3ac26aa8db0534650d49bfb Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/metadatajob.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp
index 62bd747f4..5ec4d0fde 100644
--- a/src/libs/installer/metadatajob.cpp
+++ b/src/libs/installer/metadatajob.cpp
@@ -331,7 +331,7 @@ bool MetadataJob::updateCache()
// Register items from current run to cache
QStringList registeredKeys;
for (auto *meta : qAsConst(m_fetchedMetadata)) {
- if (!m_metaFromCache.registerItem(meta)) {
+ if (!m_metaFromCache.registerItem(meta, true)) {
emitFinishedWithError(QInstaller::CacheError, m_metaFromCache.errorString()
+ tr(" Clearing the cache directory and restarting the application may solve this."));
return false;