From: jiil.hyoun Date: Fri, 4 Jan 2013 06:24:37 +0000 (+0900) Subject: [Title] fix client initializeing error X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0835bd08edb049a3d2f2957e5317f7f064a0cce8;p=sdk%2Ftools%2Fsdk-build.git [Title] fix client initializeing error [Type] Bugfix [Module] Toolchain / [Priority] Minor [Jira#] [Redmine#] 7954 [Problem] [Cause] [Solution] [TestCase] Change-Id: I725c88ed008d3282bb2f31cd2754626fdaa34bce --- diff --git a/src/pkg_server/client.rb b/src/pkg_server/client.rb index 2039d25..f1407f5 100644 --- a/src/pkg_server/client.rb +++ b/src/pkg_server/client.rb @@ -69,6 +69,13 @@ class Client # @location = client location (download and install file to this location) def initialize(server_addr, location, logger) + # set log + if logger.nil? or logger.class.to_s.eql? "String" then + @log = DummyLog.new() + else + @log = logger + end + # create directory if not File.exist? CONFIG_PATH then FileUtils.mkdir_p "#{CONFIG_PATH}" end @@ -107,13 +114,6 @@ class Client if not File.exist? @snapshots_path then FileUtils.mkdir_p "#{@snapshots_path}" end if not File.exist? @tmp_path then FileUtils.mkdir_p "#{@tmp_path}" end - # set log - if logger.nil? or logger.class.to_s.eql? "String" then - @log = DummyLog.new() - else - @log = logger - end - # read installed pkg list, and create hash if not File.exist? @location then FileUtils.mkdir_p "#{@location}" end @log.info "Update local package list.. [#{@location}]" @@ -518,7 +518,8 @@ class Client server = @server_addr if server.nil? or server.empty? then @log.error "Server addr is nil" - return nil + @log.error "check sync_pkg_servers table pkgsvr_url column is null" + return "nil" end server = server.delete ".:/@"