From: donghyuk.yang Date: Wed, 22 Aug 2012 01:59:00 +0000 (+0900) Subject: [Title] Update list only if url is not snapshot url X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80b8a8754ee83dfeea20231201c9b06cee4272f3;p=sdk%2Ftools%2Fsdk-build.git [Title] Update list only if url is not snapshot url [Type] [Module] [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/src/pkg_server/client.rb b/src/pkg_server/client.rb index 9061c80..acb3e6f 100644 --- a/src/pkg_server/client.rb +++ b/src/pkg_server/client.rb @@ -55,7 +55,7 @@ class Client OS_INFO_FILE = "os_info" ARCHIVE_PKG_LIST_FILE = "archive_pkg_list" - attr_accessor :server_addr, :location, :pkg_hash_os, :is_server_remote, :installed_pkg_hash_loc, :archive_pkg_list, :all_dep_list, :log, :support_os_list, :config_dist_path, :download_path, :snapshot_path, :snapshots_path + attr_accessor :server_addr, :location, :pkg_hash_os, :is_server_remote, :installed_pkg_hash_loc, :archive_pkg_list, :all_dep_list, :log, :support_os_list, :config_dist_path, :download_path, :snapshot_path, :snapshots_path, :is_snapshot_url public # initialize @@ -75,7 +75,10 @@ class Client if server_addr.strip.end_with? "/" then server_addr = server_addr.chop end @snapshot_path = nil + @is_snapshot_url = false + if is_snapshot_url(server_addr) then + @is_snapshot_url = true @server_addr, @snapshot_path = split_addr_and_snapshot(server_addr) else @server_addr = server_addr @@ -118,12 +121,11 @@ class Client public # update package list from server def update() - - if @snapshot_path.nil? then + if not @is_snapshot_url then $get_snapshot_mutex.synchronize { @snapshot_path = get_lastest_snapshot(@is_server_remote) - } - end + } + end @log.info "The lastest snapshot : #{@snapshot_path}" if @snapshot_path.nil? then @log.warn "Failed to get the lastest package list"