From e0f0035a7d02098f14e9d800a16d42d4c9380e9c Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期五, 20 十二月 2019 16:22:25 +0800 Subject: [PATCH] test --- service/SysService.go | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/service/SysService.go b/service/SysService.go index 14c3084..4b14658 100644 --- a/service/SysService.go +++ b/service/SysService.go @@ -124,7 +124,7 @@ } defer file.Close() writer := bufio.NewWriter(file) - chunkData := make([]byte, arg.Header.Size) + chunkData := make([]byte, arg.CurrentChunkSize) n, err := (*arg.File).ReadAt(chunkData, 0) if n ==0 || err !=nil { logger.Debug("read chunkData err:",err,"n:",n) @@ -243,15 +243,25 @@ logger.Debug("UnZip err:",err,"zipFile:",zipFilePath) return false } + + //濡傛灉閫氱敤鑴氭湰鏈夋洿鏂帮紝鍒欐洿鏂伴�氱敤鑴氭湰 + if util.Exists(unZipPath+"updatePatch.sh") { + cpStr := fmt.Sprintf("cp %s /opt/vasystem/bin",unZipPath+"updatePatch.sh") + b, err := ExecCmd(cpStr) + if err != nil { + logger.Debug("cp updatePatch.sh to bin err:",err,"result:",string(b)) + return false + } + } + //鍒ゆ柇鏇存柊鍖呴噷鏄惁鏈夎ˉ涓佽剼鏈紝濡傛灉鏈夊垯鎵ц锛屽惁鍒欐墽琛寀pdatePatch.sh updateCmd := fmt.Sprintf("./updatePatch.sh %s %s %s &",unZipPath,zipFilePath,configPatchPath+"/"+identifier) if util.Exists(unZipPath+"upgrade.sh") { updateCmd = fmt.Sprintf("%supgrade.sh %s %s %s &",unZipPath,unZipPath,zipFilePath,configPatchPath+"/"+identifier) } //2.鏇存柊绯荤粺 - var cmd *exec.Cmd - cmd = exec.Command("/bin/sh","-c", updateCmd) - if b, err := cmd.Output(); err != nil { + b,err := ExecCmd(updateCmd) + if err != nil { logger.Debug("upgrade err:",err,"result:",string(b),"cmd:",updateCmd) return false } else { -- Gitblit v1.8.0