From e1612029630739d93a9cee135e90ff758323decf Mon Sep 17 00:00:00 2001 From: hataejun Date: Thu, 11 Oct 2012 11:10:55 +0900 Subject: [PATCH] [Title] package server sync : download only higher package and print log [Type] [Module] [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- src/pkg_server/distribution.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pkg_server/distribution.rb b/src/pkg_server/distribution.rb index 182e808..4226a32 100644 --- a/src/pkg_server/distribution.rb +++ b/src/pkg_server/distribution.rb @@ -240,6 +240,7 @@ class Distribution server_pkg_name_list = client.pkg_hash_os[os].keys local_pkg_name_list = @pkg_hash_os[os].keys full_pkg_name_list = server_pkg_name_list + local_pkg_name_list + full_pkg_name_list.uniq! full_pkg_name_list.each do |pkg_name| ret = sync_package( pkg_name, client, os, force ) @@ -279,6 +280,8 @@ class Distribution # if package is update when sync time then skip if Utils.compare_version(local_pkg.version, pkg.version) == -1 then next + else + @log.info( "update package [#{pkg.package_name}] in #{pkg.os}", Log::LV_USER) end end @@ -287,6 +290,8 @@ class Distribution when "REMOVE" if not force then if @pkg_hash_os[os][pkg.package_name].origin.eql? "local" then + else + @log.info( "remove package [#{pkg.package_name}] in #{pkg.os}", Log::LV_USER) next end end @@ -729,6 +734,11 @@ class Distribution return nil end + if ( version_cmp == -1 ) then + # local package's version is higher than server packages's version then skip update + return nil + end + if ( local_pkg.origin.eql? "local" ) and (not force) then # local_pkg is generated from local and not force mode then skip update return nil -- 2.34.1