# 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
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
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
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
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
# 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
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