std::vector<std::string> getLibrariesInfo(const std::string& rootPath)
{
std::vector<std::string> LibrariesInfo;
- std::string binDir = concatPath(rootPath, "bin");
- if (!exist(binDir))
- return LibrariesInfo;
+ std::vector<std::string> paths = {concatPath(rootPath, "bin"), concatPath(rootPath, "lib")};
auto convert = [&LibrariesInfo](const std::string& filepath, const std::string& filename) {
if (filename.find(".so", filename.size() - 3) != std::string::npos || filepath.rfind(".so.") != std::string::npos) {
- std::string buffer = SHA256(filepath);
- LibrariesInfo.push_back(filepath + ":" + buffer);
- _INFO("Library : [%s] / SHA256 : [%s]", filename.c_str(), buffer.c_str());
+ // Skip symlink file
+ if (!isSymlinkFile(filepath)) {
+ std::string buffer = SHA256(filepath);
+ LibrariesInfo.push_back(filepath + ":" + buffer);
+ _INFO("Library : [%s] / SHA256 : [%s]", filename.c_str(), buffer.c_str());
+ }
}
};
- scanFilesInDirectory(binDir, convert, -1);
+
+ for (auto& path : paths) {
+ scanFilesInDirectory(path, convert, -1);
+ }
return LibrariesInfo;
}