Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion libs/rtemodel/include/RteInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -1589,10 +1589,17 @@ class RteFileInstance : public RteItemInstance
*/
std::string GetComponentUniqueID() const override;

/**
* @brief get partial component ID (without vendor)
* @param withBundle flag to include bundle in the ID
* @return partial component ID
*/
std::string GetPartialComponentID(bool withBundle) const override;

/**
* @brief get component aggregate ID
* @param withVersion
* @return
* @return component aggregate ID
*/
std::string GetComponentAggregateID() const override;

Expand Down
4 changes: 4 additions & 0 deletions libs/rtemodel/src/RteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,10 @@ string RteFileInstance::GetComponentID(bool withVersion) const
return m_componentAttributes.GetComponentID(withVersion);
}

string RteFileInstance::GetPartialComponentID(bool withBundle) const
{
return m_componentAttributes.GetPartialComponentID(withBundle);
}

string RteFileInstance::GetComponentAggregateID() const
{
Expand Down
5 changes: 3 additions & 2 deletions tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2344,10 +2344,11 @@ bool ProjMgrWorker::CheckConfigPLMFiles(ContextItem& context) {
regex_match(baseVersion, base, regEx);
regex_match(updateVersion, update, regEx);
if (base.size() == 4 && update.size() == 4) {
const string componentId = fi.second->GetPartialComponentID(true).empty() ? "" : " from component '" + fi.second->GetPartialComponentID(true) + "'";
auto GetUpdateMsg = [&](const string& severity) {
return "file '" + file + "' " + severity +
return severity + " for file '" + file + "'" + componentId +
(!RteFsUtils::Exists(file + '.' + RteUtils::UPDATE_STRING + '@' + updateVersion) ? "; use --update-rte" :
"; merge content from update file, rename update file to base file and remove previous base file");
".\nMerge content from update file, rename update file to base file and remove previous base file");
};
if (base[1] != update[1]) {
// major
Expand Down
16 changes: 8 additions & 8 deletions tools/projmgr/test/src/ProjMgrUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6692,11 +6692,11 @@ TEST_F(ProjMgrUnitTests, ConfigFilesUpdate) {

// --no-update-rte
std::vector<std::tuple<std::string, int, std::string, std::string>> testDataVector1 = {
{ "BaseUnknown", 0, "warning csolution: file '.*/startup_ARMCM3.c.base' not found; base version unknown", "missing base" },
{ "Patch", 0, "warning csolution: file '.*/startup_ARMCM3.c' update suggested; use --update-rte", "update suggested" },
{ "Minor", 0, "warning csolution: file '.*/startup_ARMCM3.c' update recommended; use --update-rte", "update recommended" },
{ "Major", 1, "error csolution: file '.*/startup_ARMCM3.c' update required; use --update-rte", "update required" },
{ "Missing", 1, "error csolution: file '.*/startup_ARMCM3.c' not found; use --update-rte", "missing file" },
{ "BaseUnknown", 0, "warning csolution: file '.*/startup_ARMCM3.c.base' not found; base version unknown", "missing base" },
{ "Patch", 0, "warning csolution: update suggested for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'; use --update-rte", "update suggested" },
{ "Minor", 0, "warning csolution: update recommended for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'; use --update-rte", "update recommended" },
{ "Major", 1, "error csolution: update required for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'; use --update-rte", "update required" },
{ "Missing", 1, "error csolution: file '.*/startup_ARMCM3.c' not found; use --update-rte", "missing file" },
};

for (const auto& [build, errCode, errMsg, status] : testDataVector1) {
Expand All @@ -6716,9 +6716,9 @@ TEST_F(ProjMgrUnitTests, ConfigFilesUpdate) {
// --update-rte
std::vector<std::tuple<std::string, int, std::string>> testDataVector2 = {
{ "BaseUnknown", 0, "" },
{ "Patch", 0, "warning csolution: file '.*/startup_ARMCM3.c' update suggested; merge content from update file, rename update file to base file and remove previous base file" },
{ "Minor", 0, "warning csolution: file '.*/startup_ARMCM3.c' update recommended; merge content from update file, rename update file to base file and remove previous base file" },
{ "Major", 1, "error csolution: file '.*/startup_ARMCM3.c' update required; merge content from update file, rename update file to base file and remove previous base file" },
{ "Patch", 0, "warning csolution: update suggested for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'.\nMerge content from update file, rename update file to base file and remove previous base file" },
{ "Minor", 0, "warning csolution: update recommended for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'.\nMerge content from update file, rename update file to base file and remove previous base file" },
{ "Major", 1, "error csolution: update required for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'.\nMerge content from update file, rename update file to base file and remove previous base file" },
{ "Missing", 0, "" },
};

Expand Down
Loading