From: hataejun Date: Wed, 22 Aug 2012 08:20:06 +0000 (+0900) Subject: [Title] package server auto sync flag X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca31a2b16480b599b3b8d1070095e12810e0c6f0;p=sdk%2Ftools%2Fsdk-build.git [Title] package server auto sync flag [Type] [Module] [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/src/pkg_server/distribution.rb b/src/pkg_server/distribution.rb index cc3825e..f9367cf 100644 --- a/src/pkg_server/distribution.rb +++ b/src/pkg_server/distribution.rb @@ -191,6 +191,9 @@ class Distribution archive_update_flag = false distribution_update_flag = false + # reload pkg list from newest pkg list file + reload_distribution_information() + # check distribution's server_url if @server_url.empty? then @log.error("This distribution has not remote server", Log::LV_USER) @@ -214,7 +217,6 @@ class Distribution pkg_list_update_flag = true end end - update_pkg_list = [] for os in @support_os_list diff --git a/src/pkg_server/packageServer.rb b/src/pkg_server/packageServer.rb index 9338085..6279648 100644 --- a/src/pkg_server/packageServer.rb +++ b/src/pkg_server/packageServer.rb @@ -54,10 +54,11 @@ class PackageServer # distribution name -> server_url hash @dist_to_server_url = {} @integrity = "YES" + @auto_sync_flag = "NO" @finish = false @port = 3333 @test_time=0 #test time in mili-seconds - @lock_file=nil + @lock_file= nil @sync_interval = 3600 @passwd = "" @@ -109,7 +110,8 @@ class PackageServer File.open( @config_file_path, "w" ) do |f| f.puts "location : #{@location}" f.puts "integrity check : #{@integrity}" - f.puts "auto sync interval : #{@sync_interval}" + f.puts "auto sync : #{@auto_sync_flag}" + f.puts "sync interval : #{@sync_interval}" f.puts "server_url : #{dist_name} -> #{server_url}" end @@ -450,9 +452,11 @@ class PackageServer listener.start # set auto sync - @log.info "Setting auto sync..." - autosync = DistSync.new(self) - autosync.start + if @auto_sync_flag.eql? "YES" then + @log.info "Setting auto sync..." + autosync = DistSync.new(self) + autosync.start + end # set password @passwd = passwd @@ -578,7 +582,9 @@ class PackageServer @location = l.split(" :")[1].strip elsif l.start_with?( "integrity check :") then @integrity = l.split(" :")[1].strip.upcase - elsif l.start_with?( "auto sync interval :" ) then + elsif l.start_with?( "auto sync :" ) then + @auto_sync_flag = l.split(" :")[1].strip.upcase + elsif l.start_with?( "sync interval :" ) then @sync_interval = l.split(" :")[1].strip.to_i elsif l.start_with?( "server_url :" ) then info = l.split(" :")[1].split("->")