Skip to content

Commit

Permalink
fix: disable providesEnhance in the community edition
Browse files Browse the repository at this point in the history
As title.

Log: Disable providesEnhance in the community edition.
  • Loading branch information
rb-union committed Oct 17, 2024
1 parent ba8d05c commit 6836fab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/deb-installer/manager/packagesmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ bool PackagesManager::targetPackageCanReplace(QApt::Package *targetPackage, QApt
rdepends.remove(installedPackage->name());

// provides package
#ifdef ENABLE_VIRTUAL_PACKAGE_ENHANCE
auto targetProvides = targetPackage->providesListEnhance();
auto installedProvides = installedPackage->providesListEnhance();
QMap<QString, QString> canReplaceProvides;
Expand All @@ -603,6 +604,11 @@ bool PackagesManager::targetPackageCanReplace(QApt::Package *targetPackage, QApt
canReplaceProvides.insert(itr.key(), targetProvides.value(itr.key()));
}
}
#else
auto targetProvides = targetPackage->providesList().toSet();
auto installedProvides = installedPackage->providesList().toSet();
QSet<QString> canReplaceProvides = targetProvides.unite(installedProvides);
#endif // ENABLE_VIRTUAL_PACKAGE_ENHANCE

bool replaceable = false;
bool containsInstalledProvides = false;
Expand All @@ -626,6 +632,7 @@ bool PackagesManager::targetPackageCanReplace(QApt::Package *targetPackage, QApt
if (canReplaceProvides.contains(info.packageName())) {
containsInstalledProvides = true;

#ifdef ENABLE_VIRTUAL_PACKAGE_ENHANCE
// check version match
QString version = canReplaceProvides.value(info.packageName());
if (!version.isEmpty()) {
Expand All @@ -635,6 +642,7 @@ bool PackagesManager::targetPackageCanReplace(QApt::Package *targetPackage, QApt
break;
}
}
#endif // ENABLE_VIRTUAL_PACKAGE_ENHANCE

replaceable = true;
break;
Expand Down

0 comments on commit 6836fab

Please sign in to comment.