Hello community, here is the log from the commit of package golang-packaging for openSUSE:Factory checked in at 2016-04-06 11:52:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/golang-packaging (Old) and /work/SRC/openSUSE:Factory/.golang-packaging.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "golang-packaging" Changes: -------- --- /work/SRC/openSUSE:Factory/golang-packaging/golang-packaging.changes 2016-02-26 00:31:40.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.golang-packaging.new/golang-packaging.changes 2016-04-06 11:52:47.000000000 +0200 @@ -1,0 +2,24 @@ +Tue Apr 5 01:14:25 UTC 2016 - i@marguerite.su + +- update version 14.8.1 + * bugfix release + * fix a typo in cli.rb + * increate timeout to 300s, or go install can't + finish itself sometimes + +------------------------------------------------------------------- +Sun Apr 3 03:14:46 UTC 2016 - i@marguerite.su + +- update version 14.8 + * rpmsysinfo.rb: fix encoding problem in open() + * cli.rb: ruby 1.8.7 doesn't support passing environment + variables in popen(), some commands/tests need time to + finish, an immediate io.close() will get us wrong + exitstatus (broken pipe, code 13). so use 'timeout' + module with a 30s and process.wait for them to quit + successfully. + * golang.req: the oniguruma in ruby 1.8.7 doesn't support + named group in regexp. so ditch the named group used in + go_get_version() + +------------------------------------------------------------------- Old: ---- golang-packaging-14.7.tar.gz New: ---- golang-packaging-14.8.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ golang-packaging.spec ++++++ --- /var/tmp/diff_new_pack.kAcOGY/_old 2016-04-06 11:52:48.000000000 +0200 +++ /var/tmp/diff_new_pack.kAcOGY/_new 2016-04-06 11:52:48.000000000 +0200 @@ -17,7 +17,7 @@ Name: golang-packaging -Version: 14.7 +Version: 14.8.1 Release: 0 Summary: A toolchain to help packaging golang License: GPL-3.0 ++++++ golang-packaging-14.7.tar.gz -> golang-packaging-14.8.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golang-packaging-14.7/golang/cli.rb new/golang-packaging-14.8.1/golang/cli.rb --- old/golang-packaging-14.7/golang/cli.rb 2016-02-24 13:28:12.000000000 +0100 +++ new/golang-packaging-14.8.1/golang/cli.rb 2016-04-05 03:09:28.000000000 +0200 @@ -1,33 +1,55 @@ module CLI - def write_status(status) - file = "/tmp/exitstatus.txt" - mode = "w:UTF-8" - if status == 0 - File.open(file,mode) {|f| f.puts(0)} - else - File.open(file,mode) {|f| f.puts(1)} - abort "[ERROR]Go command failed! Please check." - end - end - - def self.run(env={},cmd="") - unless RUBY_VERSION.to_f > 1.8 - # popen in 1.8 doesn't support env hash - def popen_env(hash, cmd) - hash.each do |k,v| - ENV[k] = v - end - io = IO.popen(cmd) - io.close - write_status($?) - end - popen_env(env,cmd) {|f| f.each_line {|l| puts l}} - else - IO.popen(env,cmd) {|f| f.each_line {|l| puts l}} - write_status($?) - end - end + require 'timeout' + + def write_status(status) + file = "/tmp/exitstatus.txt" + mode = "w:UTF-8" + if status == 0 + File.open(file,mode) {|f| f.puts(0)} + else + File.open(file,mode) {|f| f.puts(1)} + abort "[ERROR]Go command failed! Please check." + end + end + + # popen in 1.8 doesn't support env hash + def popen_env(hash, cmd) + # set ENV separately + hash.each {|k,v| ENV[k] = v} + + # some commands need time, an immediate close + # will get a wrong status, so wait them with + # timeout 30s + # set timeout 300s, because go install takes + # lots of time sometimes + begin + Timeout.timeout(300) do + @pipe = IO.popen(cmd) + Process.wait(@pipe.pid) + end + rescue Timeout::Error + Process.kill(9,@pipe.pid) + # collect status + Process.wait(@pipe.pid) + end + + write_status($?) + + end + + def self.run(env={},cmd="") + + puts "GOPATH: #{env}" + puts "Command: #{cmd}" + unless RUBY_VERSION.to_f > 1.8 + popen_env(env,cmd) {|f| f.each_line {|l| puts l}} + else + IO.popen(env,cmd) {|f| f.each_line {|l| puts l}} + write_status($?) + end + + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golang-packaging-14.7/golang/rpmsysinfo.rb new/golang-packaging-14.8.1/golang/rpmsysinfo.rb --- old/golang-packaging-14.7/golang/rpmsysinfo.rb 2016-02-24 13:28:12.000000000 +0100 +++ new/golang-packaging-14.8.1/golang/rpmsysinfo.rb 2016-04-05 03:09:28.000000000 +0200 @@ -104,7 +104,7 @@ specfile = Dir.glob(@@topdir + "/SOURCES/*.spec")[0] - File.open(specfile) do |f| + File.open(specfile,'r:UTF-8') do |f| f.each_line do |l| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golang-packaging-14.7/golang-macros.rb new/golang-packaging-14.8.1/golang-macros.rb --- old/golang-packaging-14.7/golang-macros.rb 2016-02-24 13:28:12.000000000 +0100 +++ new/golang-packaging-14.8.1/golang-macros.rb 2016-04-05 03:09:28.000000000 +0200 @@ -43,7 +43,7 @@ # export IMPORTPATH to a temp file, as ruby can't export system environment variables # like shell scripts - File.open("/tmp/importpath.txt","w") do |f| + File.open("/tmp/importpath.txt","w:UTF-8") do |f| f.puts(importpath) end @@ -83,7 +83,7 @@ buildflags = "-s -v -p 4 -x" # get importpath from /tmp/importpath.txt saved by prep() - importpath = open("/tmp/importpath.txt","r").gets.strip! + importpath = open("/tmp/importpath.txt","r:UTF-8").gets.strip! opts = Opts.get_opts mods = Opts.get_mods diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/golang-packaging-14.7/golang.req new/golang-packaging-14.8.1/golang.req --- old/golang-packaging-14.7/golang.req 2016-02-24 13:28:12.000000000 +0100 +++ new/golang-packaging-14.8.1/golang.req 2016-04-05 03:09:28.000000000 +0200 @@ -9,9 +9,10 @@ def go_get_version() IO.popen("go version") do |process| process.each_line do |l| - version_re = /^go version go(?<version>\S+)\s+(?<goos>[^\/]+)\/(?<goarch>.*)$/ + version_re = /^go version go(\S+)\s+([^\/]+)\/(.*)$/ md = version_re.match(l.chomp) - return md[:version] if md + # 1:"1.6" 2:"linux" 3:"amd64" + return md[1] if md end end end