# @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
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}]"
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 ".:/@"