From: donghee yang Date: Tue, 26 Mar 2013 04:54:42 +0000 (+0900) Subject: [Title] Fixed bug that "--rebuild" option is not working when source changes X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ec013bf1811081d6e3591b8fa8a288174afa46d;p=sdk%2Ftools%2Fsdk-build.git [Title] Fixed bug that "--rebuild" option is not working when source changes --- diff --git a/src/build_server/BuildJob.rb b/src/build_server/BuildJob.rb index 490c93b..c44f939 100644 --- a/src/build_server/BuildJob.rb +++ b/src/build_server/BuildJob.rb @@ -581,7 +581,9 @@ class BuildJob < CommonJob # 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) @@ -598,8 +600,10 @@ class BuildJob < CommonJob 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 diff --git a/src/build_server/CommonProject.rb b/src/build_server/CommonProject.rb index a2b46ac..9d89645 100644 --- a/src/build_server/CommonProject.rb +++ b/src/build_server/CommonProject.rb @@ -299,6 +299,9 @@ class CommonProject 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