From: jiil.hyoun Date: Fri, 15 Mar 2013 08:24:02 +0000 (+0900) Subject: [Title] fix nil check for download file in cache X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e8f0a208a5ff48937cdec5eead5a521562a4d0d;p=sdk%2Ftools%2Fsdk-build.git [Title] fix nil check for download file in cache [Type] Bugfix [Module] Toolchain / [Priority] Major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] Change-Id: I4a0e77dbdd217d333cc97564f2a542ada21fd992 --- diff --git a/src/pkg_server/client.rb b/src/pkg_server/client.rb index 0f18d73..a55ed22 100644 --- a/src/pkg_server/client.rb +++ b/src/pkg_server/client.rb @@ -314,13 +314,15 @@ class Client file_path = get_file_from_cache(filename, pkg_checksum, pkg_size, loc) if file_path.nil? then - if not FileDownLoader.download(url, loc, @log) then + file_path = File.join(loc, filename) + + result = FileDownLoader.download(url, loc, @log) + if not result or not File.exist? file_path then @log.error "File Download Failed!!" @log.error "* #{url} -> #{loc}" return nil end - file_path = File.join(loc, filename) if validatePkgFile(file_path, pkg_checksum, pkg_size) then add_file_to_cache(file_path) else