DIBS: Fixed getChecksum function 85/15985/1
authorjonghwan2.park <jonghwan2.park@samsung.com>
Tue, 4 Feb 2014 06:07:09 +0000 (15:07 +0900)
committerjonghwan2.park <jonghwan2.park@samsung.com>
Tue, 4 Feb 2014 06:07:09 +0000 (15:07 +0900)
DIBS: Added wget option

Change-Id: I9e31d377fa643b7b9d337b2e6b40f190c7b443a2
Signed-off-by: jonghwan2.park <jonghwan2.park@samsung.com>
src/common/utils.rb
src/pkg_server/downloader.rb

index e3ce1ad7477b5cd4c2da63704d5a8ec51b2c2fc2..73d79bb65fceef172fd7487ff852dd9793b1a7fd 100644 (file)
@@ -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
index 8a1ef961afb75bdb0bcc69b49fa6c3a87cc70f2a..82b5dede483eb419045117bcd3feef30c1392bdf 100644 (file)
@@ -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"