Skip to content

Commit da982e4

Browse files
grasci-armedriouk
andauthored
Fix Pack filter when changing scope all/solution packs (#1442) (#2394)
Co-authored-by: Evgueni Driouk <edriouk@arm.com>
1 parent 34b686d commit da982e4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

libs/rtemodel/src/RtePackage.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,17 +1175,20 @@ bool RtePackageFilter::IsPackageFiltered(const string& packId) const
11751175
}
11761176
if (!IsUseAllPacks()) {
11771177
string commonId = RtePackage::CommonIdFromId(packId);
1178-
if (m_latestPacks.find(commonId) == m_latestPacks.end())
1178+
if(IsPackageSelected(commonId) && contains_key(m_latestInstalledPacks, packId)) {
1179+
return true; // pack is explicitly selected as a common ID
1180+
}
1181+
if(!contains_key(m_latestPacks, commonId)) {
11791182
return false;
1180-
1183+
}
11811184
for (auto& it : m_selectedPacks) {
11821185
string id = RtePackage::CommonIdFromId(it);
11831186
if (id == commonId) {
11841187
return false; // another pack version is explicitly selected
11851188
}
11861189
}
11871190
}
1188-
if(m_latestInstalledPacks.find(packId) != m_latestInstalledPacks.end()) {
1191+
if(contains_key(m_latestInstalledPacks, packId)) {
11891192
return true;
11901193
}
11911194
return false;

tools/projmgr/src/ProjMgrRpcServer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,17 @@ void RpcHandler::UpdateFilter(const string& context, RteTarget* rteTarget, bool
307307
// construct and apply filter
308308
// use resolved pack ID's from selected references
309309
set<string> packIds;
310+
set<string> latestIds;
310311
for(auto& ref : GetPackReferences(context)) {
311312
if(ref.selected && ref.resolvedPack.has_value()) {
312-
packIds.insert(ref.resolvedPack.value());
313+
auto& packId = ref.resolvedPack.value();
314+
packIds.insert(packId);
315+
string commonId = RtePackage::CommonIdFromId(packId);
316+
latestIds.insert(commonId);
313317
}
314318
}
315319
packFilter.SetSelectedPackages(packIds);
320+
packFilter.SetLatestPacks(latestIds);
316321
packFilter.SetUseAllPacks(all);
317322

318323
// only update filter if differs from current state

0 commit comments

Comments
 (0)