Skip to content

Commit

Permalink
[projmgr] Fall back to file version defined in the pack
Browse files Browse the repository at this point in the history
When resolving the base file version for RTE files when the RTE directory
has not yet been populated, fall back to the version defined in the pack.

Contributed by STMicroelectronics

Signed-off-by: Torbjörn SVENSSON <[email protected]>
Co-authored-by: Samuel HULTGREN <[email protected]>
  • Loading branch information
Torbjorn-Svensson and slhultgren committed Dec 12, 2023
1 parent 455dbd7 commit aaa5502
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/rtemodel/src/RteProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,18 @@ void RteProject::AddCprjComponents(const Collection<RteItem*>& selItems, RteTarg
// update file versions
for (auto [instanceName, fi] : m_files) {
string version;
auto rteFile = fi->GetFile(target->GetName());
auto itver = configFileVersions.find(instanceName); // file in cprj can be specified by its instance name
if (itver == configFileVersions.end())
itver = configFileVersions.find(fi->GetName()); // or by original name
if (itver != configFileVersions.end()) {
version = itver->second;
} else {
// Fall back to the version noted in the pack
version = rteFile->GetVersionString();
}
UpdateFileInstanceVersion(fi, version);
UpdateConfigFileBackups(fi, fi->GetFile(target->GetName()));
UpdateConfigFileBackups(fi, rteFile);
}
}

Expand Down

0 comments on commit aaa5502

Please sign in to comment.