opkg_manager: Refactor version info saving logic in COPKGManager

Update logic in COPKGManager::pullPkgData() to handle various
package names including "neutrino-mp", "neutrino", or falling
back to the generic "PACKAGE" if specific names are not found.


Origin commit data
------------------
Branch: ni/coolstream
Commit: a48d607dab
Author: Thilo Graf <dbt@novatux.de>
Date: 2024-05-13 (Mon, 13 May 2024)



------------------
This commit was generated by Migit
This commit is contained in:
2024-05-13 22:02:13 +02:00
committed by vanhofen
parent 5ede88f472
commit 3d2bfb975e

View File

@@ -945,7 +945,7 @@ void COPKGManager::pullPkgData()
{
pkg_map[name].version = line.substr(9);
// Save version info for neutrino into file, for usage in other classes
if (name == "neutrino-mp")
if (name == "neutrino-mp" || name == "neutrino" || name == PACKAGE || name == PACKAGE_NAME || name == PACKAGE_TARNAME)
{
std::ofstream outfile("/tmp/.neutrino.version");
outfile << pkg_map[name].version;