[Title] package server auto sync flag
authorhataejun <taejun.ha@samsung.com>
Wed, 22 Aug 2012 08:20:06 +0000 (17:20 +0900)
committerhataejun <taejun.ha@samsung.com>
Wed, 22 Aug 2012 08:20:06 +0000 (17:20 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

src/pkg_server/distribution.rb
src/pkg_server/packageServer.rb

index cc3825e0357812f54290bb7693bdc68a7626b607..f9367cf47e6a7c306bc400acb7a293dc3a116d08 100644 (file)
@@ -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 
index 9338085e6a92787b9b2e2f2c69a56dbe0ea5f001..62796489a0d39fb48ee810dec9df4aabfd31e3c7 100644 (file)
@@ -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("->")