# check if version is same and source_info is different
ver_local = @pkginfo.packages[0].version
old_source_info = @project.get_source_info( ver_local )
- if not old_source_info.nil? and old_source_info != source_info then
+ if ( not @force_rebuild and
+ not old_source_info.nil? and old_source_info != source_info ) then
+
@log.error( "Source code has been changed without increasing version!", Log::LV_USER)
@log.error( " * Version : #{ver_local}", Log::LV_USER)
@log.error( " * Before : #{old_source_info}", Log::LV_USER)
if ver_svr.nil? then next end
# compare version
- if Version.new(ver_local) < Version.new(ver_svr) or
- ( not @force_rebuild and Version.new(ver_local) == Version.new(ver_svr) ) then
+ if ( not @force_rebuild and
+ ( Version.new(ver_local) < Version.new(ver_svr) or
+ Version.new(ver_local) == Version.new(ver_svr) ) ) then
+
@log.error( "Version must be increased : #{ver_local} <= #{ver_svr}", Log::LV_USER)
return false
end
if row1.nil? then
db.do "INSERT INTO sources(project_id, pkg_ver,location)
VALUES(#{@prj_id},'#{src_ver}','#{info}')"
+ else
+ db.do "UPDATE sources SET location='#{info}' "+
+ "WHERE project_id=#{@prj_id} and pkg_ver='#{src_ver}'"
end
end