when sync can recognize origin snapshot by name 41/25641/1
authorHyoun Jiil <jiil.hyoun@samsung.com>
Thu, 7 Aug 2014 12:00:55 +0000 (21:00 +0900)
committerHyoun Jiil <jiil.hyoun@samsung.com>
Thu, 7 Aug 2014 12:00:55 +0000 (21:00 +0900)
Change-Id: I9c8b875d5688a8ef5194cd0ae5981174d3410ef8

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

index 523a51794189938904cadda0dd15227380dba8a8..0342bb40a8a7464e8a918542d308fa23ac40f2f5 100644 (file)
@@ -221,6 +221,8 @@ class Distribution
                        raise RuntimeError, "Cannot create package client."
                end
 
+        snapshot = client.snapshot_path.split("/").pop
+
                # parents package server check
                if client.pkg_hash_os.keys.empty? then
                        @log.error("Sync process stopped by error.")
@@ -350,7 +352,7 @@ class Distribution
                        @last_sync_changes = "SYSTEM: sync parents server \n#{changes.uniq.join("\n\n")}"
                end
 
-               return distribution_update_flag
+               return distribution_update_flag, snapshot
        end
 
        def add_os(os)
index 9cb6cf54b39b03d1096b8117f6498d0f9611637c..950c938a97009124ef3833f8348c524b32d2ca70 100644 (file)
@@ -315,10 +315,9 @@ class PackageServer
                end
 
                begin
-                       ret = distribution.sync(mode, snapshot)
-
-                       if ret then
-                               distribution.generate_snapshot("", "", false, distribution.last_sync_changes)
+                       update, snapshot = distribution.sync(mode, snapshot)
+                       if update then
+                               distribution.generate_snapshot("sync_#{snapshot}", "", false, distribution.last_sync_changes)
                        end
     
                        @log.output( "package server [#{@id}]'s distribution [#{dist_name}] has been synchronized.", Log::LV_USER )