|
@@ -92,6 +92,63 @@ void CUpgradeMgrEntity::OnStarted()
|
|
|
LogError(Severity_Middle, rc, 0, "subscribe entity [UpgradeRun] broadcast msg fail");
|
|
|
//return;
|
|
|
}
|
|
|
+ //test
|
|
|
+ //CSystemStaticInfo sysInfo;
|
|
|
+ //ZeroMemory(&sysInfo, sizeof(sysInfo));
|
|
|
+ //rc = GetFunction()->GetSystemStaticInfo(sysInfo);
|
|
|
+ //CVersion CurMachineVersion(sysInfo.MachineVersion.GetMajor(), sysInfo.MachineVersion.GetMinor());
|
|
|
+ //Dbg("current version is %s", CurMachineVersion.ToString().GetData());
|
|
|
+ //CSimpleStringA testStr = "1.0-4.9";
|
|
|
+ //DWORD dwMajor1(0), dwMinor1(0);
|
|
|
+ //int n = sscanf(testStr, "%d.%d", &dwMajor1, &dwMinor1);
|
|
|
+ //CVersion beginVersion(dwMajor1, dwMinor1);
|
|
|
+ //Dbg("begin version is %s", beginVersion.ToString().GetData());
|
|
|
+ //auto list = testStr.Split('-');
|
|
|
+ //Dbg("teststr is split %d", list.GetCount());
|
|
|
+
|
|
|
+ //if (list.GetCount() >= 2)
|
|
|
+ //{
|
|
|
+ // DWORD dwMajor2(0), dwMinor2(0);
|
|
|
+ // n = sscanf(list[1], "%d.%d", &dwMajor2, &dwMinor2);
|
|
|
+ // CVersion endVersion(dwMajor2, dwMinor2);
|
|
|
+ // Dbg("end version is %s", endVersion.ToString().GetData());
|
|
|
+ // Dbg("test list[0]=%s", list[0].GetData());
|
|
|
+ // Dbg("test list[1]=%s", list[1].GetData());
|
|
|
+
|
|
|
+ // bool bMatch = CurMachineVersion >= beginVersion && CurMachineVersion <= endVersion;
|
|
|
+ // if (bMatch) {
|
|
|
+ // Dbg("bMatch is true");
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // Dbg("bMatch is false");
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // if (testStr.IsEndWith("-"))
|
|
|
+ // {
|
|
|
+ // Dbg("testStr.IsEndWith is >=");
|
|
|
+ // bool bMatch = CurMachineVersion >= beginVersion;
|
|
|
+ // if (bMatch) {
|
|
|
+ // Dbg("bMatch is true");
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // Dbg("bMatch is false");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // Dbg("testStr.IsEndWith is =");
|
|
|
+ // bool bMatch = CurMachineVersion == beginVersion;
|
|
|
+ // if (bMatch) {
|
|
|
+ // Dbg("bMatch is true");
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // Dbg("bMatch is false");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
|
|
|
//// 监视准入状态
|
|
|
//CSimpleStringA strValue;
|
|
@@ -528,7 +585,7 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
|
|
|
{
|
|
|
return Error_Null;
|
|
|
}
|
|
|
- Dbg("Start to get file hash list, dir=[%s] ", strFolderPath);
|
|
|
+ Dbg("Start to get file hash list, dir=[%s] ", strFolderPath.GetData());
|
|
|
#ifdef RVC_OS_WIN
|
|
|
_finddata_t FileInfo;
|
|
|
CSimpleStringA strfind = strFolderPath + SPLIT_SLASH_STR+"*";
|
|
@@ -738,11 +795,12 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
|
|
|
{//file
|
|
|
CSimpleStringA strFindName = entry->d_name;
|
|
|
{
|
|
|
- if (strFindName.IndexOf(".") == -1)
|
|
|
- {
|
|
|
- Dbg("%s file name is illegal", strFindName);
|
|
|
- continue;
|
|
|
- }
|
|
|
+ //Linux下很多文件是没有后缀名,故放开。
|
|
|
+ //if (strFindName.IndexOf(".") == -1)
|
|
|
+ //{
|
|
|
+ // Dbg("%s file name is illegal", strFindName.GetData());
|
|
|
+ // continue;
|
|
|
+ //}
|
|
|
//整体黑名单文件过滤
|
|
|
bool isBlackFile = false;
|
|
|
list<CSimpleStringA>::iterator itor = m_fsm.m_FileBlacklist.begin();
|
|
@@ -780,7 +838,11 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
|
|
|
itor++;
|
|
|
}
|
|
|
//不是白名单也不是默认so文件,不需要加入hash计算
|
|
|
- if (!isWhiteFile && !strFindName.IsEndWith(".so", true)) {
|
|
|
+ //if (!isWhiteFile && !strFindName.IsEndWith(".so", true)) {
|
|
|
+ // Dbg("WhiteFile Filter don't add to md5 list, file = [%s]", strFindName.GetData());
|
|
|
+ // continue;
|
|
|
+ //}
|
|
|
+ if (!isWhiteFile && strFindName.IndexOf(".so")==-1) {
|
|
|
Dbg("WhiteFile Filter don't add to md5 list, file = [%s]", strFindName.GetData());
|
|
|
continue;
|
|
|
}
|