From 68c11be6bb13d11c25579da2a170e7af57ec050d Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 16 Feb 2022 19:54:21 +0100 Subject: [PATCH] Call `addDepsAndProvidesFromOtherPackage` *before* clearing existing packages --- libpkg/data/database.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libpkg/data/database.cpp b/libpkg/data/database.cpp index 694854e..3bc427a 100644 --- a/libpkg/data/database.cpp +++ b/libpkg/data/database.cpp @@ -362,6 +362,11 @@ StorageID Database::forceUpdatePackage(const std::shared_ptr &package) void Database::replacePackages(const std::vector> &newPackages, DateTime lastModified) { + for (const auto &package : newPackages) { + if (const auto existingPackage = findPackage(package->name)) { + package->addDepsAndProvidesFromOtherPackage(*existingPackage); + } + } clearPackages(); auto updater = PackageUpdater(*this); for (const auto &package : newPackages) {