| | |
| | | |
| | | zipFilePath := configPatchPath + "/"+identifier+ext |
| | | unPackTargetPath := configPatchPath+"/"+identifier+"_basic/" |
| | | md5DirPath := configPatchPath+"/"+identifier |
| | | if util.Exists(zipFilePath) { |
| | | strMd5, e := util.FileMd5(zipFilePath) |
| | | if e !=nil || strMd5 == "" { |
| | | go os.Remove(zipFilePath) |
| | | if util.DirExists(unPackTargetPath) { |
| | | go os.RemoveAll(unPackTargetPath) |
| | | } |
| | | if util.DirExists(md5DirPath) { |
| | | go os.RemoveAll(md5DirPath) |
| | | } |
| | | return false,errors.New("获取安装包md5失败") |
| | | } |
| | |
| | | go os.Remove(zipFilePath) |
| | | if util.DirExists(unPackTargetPath) { |
| | | go os.RemoveAll(unPackTargetPath) |
| | | } |
| | | if util.DirExists(md5DirPath) { |
| | | go os.RemoveAll(md5DirPath) |
| | | } |
| | | logger.Debug("strMd5 is", strMd5,"identifier is",identifier,"not equal") |
| | | return false,errors.New("校验安装文件失败") |
| | |
| | | //1.解压缩更新包 |
| | | unPackTargetPath := configPatchPath+"/"+identifier+"_basic/" |
| | | unPackFilePath := configPatchPath+"/"+identifier+ext |
| | | md5DirPath := configPatchPath+"/"+identifier |
| | | defer func() { |
| | | if util.Exists(unPackTargetPath) { |
| | | os.RemoveAll(unPackTargetPath) |
| | | } |
| | | if util.Exists(unPackFilePath) { |
| | | os.RemoveAll(unPackFilePath) |
| | | } |
| | | if util.DirExists(md5DirPath) { |
| | | go os.RemoveAll(md5DirPath) |
| | | } |
| | | }() |
| | | |
| | |
| | | } |
| | | } |
| | | if util.DirExists(unPackPath+sdkType+"/models") { |
| | | if _,cE := util.CopyDirByCmd(unPackPath+sdkType+"/models", "./zconf"); cE != nil { |
| | | if _,cE := util.CopyDirByCmd(unPackPath+sdkType+"/models", "./"); cE != nil { |
| | | return false, cE |
| | | } |
| | | //拷贝完成后删除libs下sdkType文件夹下models |
| | | } |
| | | if util.DirExists(libPath+sdkType+"/models") { |
| | | os.RemoveAll(libPath+sdkType+"/models") |
| | | } |
| | | if util.DirExists(libPath+sdkType+"/zconf") { |
| | | os.RemoveAll(libPath+sdkType+"/zconf") |
| | | } |
| | | } else { |
| | | logger.Debug("unTarGzE sdkType.tar.gz err:", unTarGzE) |
| | |
| | | cM,cEM := strconv.Atoi(curIVArr[1]) |
| | | cL,cEL := strconv.Atoi(curIVArr[2]) |
| | | |
| | | dH,dEH := strconv.Atoi(curIVArr[0]) |
| | | dM,dEM := strconv.Atoi(curIVArr[1]) |
| | | dL,dEL := strconv.Atoi(curIVArr[2]) |
| | | dH,dEH := strconv.Atoi(dstIVArr[0]) |
| | | dM,dEM := strconv.Atoi(dstIVArr[1]) |
| | | dL,dEL := strconv.Atoi(dstIVArr[2]) |
| | | if cEH !=nil || cEM != nil || cEL != nil || dEH != nil ||dEM !=nil || dEL !=nil { |
| | | return false |
| | | } |