From f514a5357976eb19d4f29a16e4035cc0d3b3114c Mon Sep 17 00:00:00 2001 From: "jonghwan2.park" Date: Tue, 4 Feb 2014 15:07:09 +0900 Subject: [PATCH] DIBS: Fixed getChecksum function DIBS: Added wget option Change-Id: I9e31d377fa643b7b9d337b2e6b40f190c7b443a2 Signed-off-by: jonghwan2.park --- src/common/utils.rb | 2 +- src/pkg_server/downloader.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/utils.rb b/src/common/utils.rb index e3ce1ad..73d79bb 100644 --- a/src/common/utils.rb +++ b/src/common/utils.rb @@ -522,7 +522,7 @@ class Utils def Utils.checksum(file_path) if File.exist? file_path then - return execute_shell_return("shasum -a 256 \"#{file_path}\"")[0].split(" ")[0] + return execute_shell_return("shasum -a 256 \"#{file_path}\"").last.split(" ").first else return nil end diff --git a/src/pkg_server/downloader.rb b/src/pkg_server/downloader.rb index 8a1ef96..82b5ded 100644 --- a/src/pkg_server/downloader.rb +++ b/src/pkg_server/downloader.rb @@ -46,13 +46,13 @@ class FileDownLoader logger.info "Downloading #{url}" if is_remote then if logger.path.nil? or logger.path.empty? then - ret = system "wget #{url} -O #{fullpath} -nv --tries=3 --connect-timeout=10" - else - pid,status = Utils.execute_shell_with_log( "wget #{url} -O #{fullpath} -nv --tries=3 --connect-timeout=10", logger.path ) + ret = system "wget --no-cache #{url} -O #{fullpath} -nv --tries=3 --connect-timeout=10" + else + pid,status = Utils.execute_shell_with_log( "wget --no-cache #{url} -O #{fullpath} -nv --tries=3 --connect-timeout=10", logger.path ) if not status.nil? then ret = (status.exitstatus != 0) ? false : true end - end + end else if not File.exist? url then logger.error "\"#{url}\" file does not exist" -- 2.34.1