[Title] Fixe a bug that package server sync does not work
authordonghee yang <donghee.yang@samsung.com>
Fri, 31 Aug 2012 23:23:51 +0000 (08:23 +0900)
committerdonghee yang <donghee.yang@samsung.com>
Fri, 31 Aug 2012 23:23:51 +0000 (08:23 +0900)
package/pkginfo.manifest
src/pkg_server/distribution.rb

index 15533a01efa659e4e5019655df74d8e0f7e873f5..c82c6cc70923ca131d41998d59e2d639d8b53a97 100644 (file)
@@ -1,5 +1,5 @@
 Source : dibs
-Version :0.99.26
+Version :0.99.27
 Maintainer : taejun ha<taejun.ha@samsung.com>, jiil hyoun <jiil.hyoun@samsung.com>, donghyuk yang <donghyouk.yang@samsung.com>, donghee yang <donghee.yang@samsung.com>, sungmin kim <dev.sungmin.kim@samsung.com
 
 Package : dibs
index c7c7aaab87d160c02ab103c6307ec5a38edd0723..d386890f3b1633401603d52242fa6d604f1fcf04 100644 (file)
@@ -72,7 +72,7 @@ class Distribution
           
                # version check and if existing version is higher then upload version?
                if (not exist_pkg.nil?) and (not internal_flag) then
-                       if not ( Utils.compare_version( exist_pkg.version, pkg.version ).eql? 1 ) then
+                       if not ( Utils.compare_version( exist_pkg.version, pkg.version ) == 1 ) then
                                raise RuntimeError, "existing package's version is higher then register package : [#{pkg.package_name}] in [#{pkg.os}]"
                        end
                end
@@ -257,16 +257,16 @@ class Distribution
 
                        case update_option
                        when "ADD"
-                               new_pkg = @pkg_hash_os[os][pkg.package_name]
+                               local_pkg = @pkg_hash_os[os][pkg.package_name]
                                
-                               if (not force) and (not new_pkg.nil?) then
+                               if (not force) and (not local_pkg.nil?) then
                                        # if updated package 'local' package then skip
-                                       if new_pkg.origin.eql? "local" then 
+                                       if local_pkg.origin.eql? "local" then 
                                                next
                                        end
 
                                        # if package is update when sync time then skip
-                                       if Utils.compare_version(new_pkg.version, pkg.version).eql?(-1) then
+                                       if Utils.compare_version(local_pkg.version, pkg.version) == -1 then
                                                next
                                        end
                                end
@@ -314,6 +314,7 @@ class Distribution
        def add_os(os)
                if @support_os_list.include? os then
                        @log.error("#{os} is already exist ", Log::LV_USER)
+                       return 
                end
 
                # update os information
@@ -649,6 +650,7 @@ class Distribution
                end 
 
                # get support_os_list 
+               @support_os_list = []
                File.open( "#{@location}/#{OS_INFO_FILE}", "r" ) do |f|
                        f.each_line do |l|
                                @support_os_list.push l.strip
@@ -686,7 +688,7 @@ class Distribution
 
                        compare_version = Utils.compare_version(pkg.version, exist_pkg.version)
                        # if version same then compatible package 
-                       if compare_version.eql? 0 then 
+                       if compare_version == 0 then 
                                return exist_pkg
                        end
                end
@@ -704,7 +706,7 @@ class Distribution
                # if server and local has package
                if ( not server_pkg.nil? ) and ( not local_pkg.nil? ) then
                        version_cmp = Utils.compare_version( local_pkg.version, server_pkg.version )
-                       if ( version_cmp.eql? 0 ) then
+                       if ( version_cmp == 0 ) then
                                # version is same then skip update
                                return nil
                        end
@@ -823,6 +825,7 @@ class Distribution
                end 
 
                # get support_os_list 
+               @support_os_list = []
                File.open( "#{@location}/#{OS_INFO_FILE}", "r" ) do |f|
                        f.each_line do |l|
                                @support_os_list.push l.strip