Build-Sever:Fixed marshal error when file-transfer 33/15533/1
authordonghee yang <donghee.yang@samsung.com>
Thu, 23 Jan 2014 02:40:04 +0000 (11:40 +0900)
committerdonghee yang <donghee.yang@samsung.com>
Thu, 23 Jan 2014 02:40:04 +0000 (11:40 +0900)
[Description]

Change-Id: Ia6d0166a95d221db5e2c52ea9d5cf6eec645b7af
Signed-off-by: donghee yang <donghee.yang@samsung.com>
package/changelog
package/pkginfo.manifest
src/build_server/RemoteBuilder.rb
src/build_server/receive_file.rb
src/build_server/send_file.rb

index 75725d9a128a30571ead398584f90066ac47f416..5221be24040fcbb2ec333037058e47c9a5984692 100644 (file)
@@ -1,3 +1,6 @@
+* 2.1.57
+- Fixed marshar error bug and some minor bugs
+== donghee yang <donghee.yang@samsung.com> 2014-01-23
 * 2.1.56
 - add gen dependency graph tool in pkg-cli
 == hyoun jiil <jiil.hyoun@samsung.com> 2014-01-17
index 066bb837129a605180d11adc8ef47add899c042c..c7d4c038f137a7de7f09ed2de4d5c906805fa524 100644 (file)
@@ -1,5 +1,5 @@
 Source : dibs
-Version :2.1.56
+Version :2.1.57
 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 : tizen-dibs-test
index d6b017f7c77966b1369329eb1fc6e3530075c338..f1160c00f01703c86db704e8b417b4bfdba2d775 100644 (file)
@@ -246,7 +246,6 @@ class RemoteBuilder
 
        protected
        def send_file_to_remote2(file_path, dock = "0")
-               result = true
 
                ruby_path=File.join(Config::CONFIG["bindir"],
                                                        Config::CONFIG["RUBY_INSTALL_NAME"] +
@@ -271,20 +270,25 @@ class RemoteBuilder
                end
 
                cmd = Utils.generate_shell_command( cmd )
-               IO.popen("#{cmd} 2>&1") do |io|
-                       if @log.path.nil? then
-                               io.each do |l|
-                                       if l.start_with?("=TRANSFER_END") then
-                                               break
-                                       else 
-                                               puts l
-                                       end
+               proc1 = IO.popen("#{cmd} 2>&1");
+               if @log.path.nil? then
+            while line = proc1.gets()
+                               if line.start_with?("=TRANSFER_END") then
+                                       break
+                               else
+                                       puts line
                                end
                        end
-                       result = Marshal.load(io.read)
                end
 
-               return result
+        status = nil
+               begin
+            pid, status = Process.waitpid2( proc1.pid )
+               rescue Errno::ECHILD
+                       return false
+               end
+
+        return ((not status.nil? and status.exitstatus == 0) ? true : false);
        end
 
 
@@ -517,23 +521,24 @@ class RemoteBuilder
                        cmd = "#{ruby_path} \"#{File.expand_path(File.dirname(__FILE__))}/receive_file.rb\" #{@addr} #{@port} #{dock} \"#{file_path}\" #{ftp_addr} #{ftp_port} #{ftp_username} #{ftp_passwd} \"#{@log.path}\""
                end
                cmd = Utils.generate_shell_command( cmd )
-               IO.popen("#{cmd} 2>&1") do |io|
-                       if @log.path.nil? then
-                               io.each do |l|
-                                       if l.start_with?("=TRANSFER_END") then
-                        @log.info("transfered")
-                        @log.info(l)
-                                               break
-                                       else 
-                                               puts l
-                                       end
+               proc1 = IO.popen("#{cmd} 2>&1");
+               if @log.path.nil? then
+            while line = proc1.gets()
+                               if line.start_with?("=TRANSFER_END") then
+                                       break
+                               else
+                                       puts line
                                end
                        end
-            ioread = io.read
-            @log.info("marshal load : [#{ioread}]")
-                       result = Marshal.load(ioread)
                end
 
-               return result
+        status = nil
+               begin
+            pid, status = Process.waitpid2( proc1.pid )
+               rescue Errno::ECHILD
+                       return false
+               end
+
+        return ((not status.nil? and status.exitstatus == 0) ? true : false);
        end
 end
index 327c507ece7806336f5beddeac337206762828b3..30638341fc966b3c0e37d2ded887179dc7d74915 100755 (executable)
@@ -89,6 +89,10 @@ ensure
                puts "=TRANSFER_END"
                STDOUT.flush
        end
-       Marshal.dump(result, $stdout)
+    if result then
+        exit 0
+    else
+        exit 1
+    end
 end
 
index 496164dc708b072a1e31c4d21f1d3534d57973da..d3195edeafabb06bfa1f3f083f6b0b6a17c3de3b 100755 (executable)
@@ -91,6 +91,10 @@ ensure
                puts "=TRANSFER_END"
                STDOUT.flush
        end
-       Marshal.dump(result, $stdout)
+    if result then
+        exit 0
+    else
+        exit 1
+    end
 end