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.
This commit is contained in:
2024-05-04 21:54:23 +02:00
parent d31da80bd8
commit 7000e4af2d

View File

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