Hello community, here is the log from the commit of package ruby-common for openSUSE:Factory checked in at 2012-12-05 14:06:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ruby-common (Old) and /work/SRC/openSUSE:Factory/.ruby-common.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ruby-common", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/ruby-common/ruby-common.changes 2012-11-10 16:55:31.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ruby-common.new/ruby-common.changes 2012-12-05 14:06:49.000000000 +0100 @@ -1,0 +2,24 @@ +Tue Dec 4 10:57:13 UTC 2012 - [email protected] + +- Bring back fix from submit request 140568 (Revision 23): + Fix gemspec filtering on SLE_11_SP2: + + Only gemspec files resulting of the built gem matter, not other + gemspec found in-tree + + Newer RPM uses rubygem.attr, which filters correctly + +------------------------------------------------------------------- +Fri Nov 30 16:24:19 UTC 2012 - [email protected] + +- require rubygems for old ruby versions +- strip trailing .0 for ~> operator + +------------------------------------------------------------------- +Fri Nov 23 12:36:58 GMT 2012 - [email protected] + +- Add -g option to rubygemsdeps.rb to allow preview / review + of automatically generated dependencies from: + + gemspecs in packages which have already been installed + + gems/gemspecs which have not yet been packaged + This is useful for learning / debugging the dependency generator. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygemsdeps.rb ++++++ --- /var/tmp/diff_new_pack.yfpM8J/_old 2012-12-05 14:06:49.000000000 +0100 +++ /var/tmp/diff_new_pack.yfpM8J/_new 2012-12-05 14:06:49.000000000 +0100 @@ -23,17 +23,24 @@ require 'optparse' require 'rubygems' +require 'rubygems/format' require 'rubygems/specification' opts = OptionParser.new("Usage: #{$0}") provides=false opts.on("-P", "--provides", "Output the provides of the package") do |val| - provides=true + provides=true end requires=false opts.on("-R", "--requires", "Output the requires of the package") do |val| - requires=true + requires=true +end +in_file=nil +opts.on("-g", "--gemspec FILE", String, + "Take gemspec from FILE, not filename in STDIN", + "Can be a .gem file or a .gemspec file") do |file| + in_file=file end rest = opts.permute(ARGV) @@ -41,17 +48,53 @@ exit(0) end -gemspecs=Array.new +def fatal(msg) + $stderr.puts msg + exit 1 +end + +def register_gemspec_from_file(gemspecs, rubyabi, file) + fatal "Couldn't read '#{file}'" unless File.readable? file + + case file + when /\.gem$/ + gem = Gem::Format.from_file_by_path(file) + fatal "Failed to load gem from '#{file}'" unless gem + spec = gem.spec + when /\.gemspec$/ + spec = Gem::Specification.load(file) + fatal "Failed to load gem spec from '#{file}'" unless spec + else + fatal "'#{file}' must be a .gem or .gemspec file" + end + + gemspecs << [ rubyabi, spec ] +end -$stdin.each_line do |line| - m = line.match(%r{.*/gems/[^/]*/specifications/.*\.gemspec$}) - gemspecs << [m[0], Gem::Specification.load(m[0])] if m +def rubyabi_from_path(path) + m = path.match(%r{.*/gems/([^/]*)/.*}) + return m ? m[1] : nil +end + +gemspecs = Array.new + +if in_file + # This mode will not be used during actual rpm builds, but only by + # gem packagers for debugging / diagnostics, so that they can + # predict in advance what the dependencies will look like. + rubyabi = rubyabi_from_path(in_file) || '$RUBYABI' + register_gemspec_from_file(gemspecs, rubyabi, in_file) +else + $stdin.each_line do |line| + line.chomp! + m = line.match(%r{.*/gems/[^/]*/specifications/.*\.gemspec$}) + if m + register_gemspec_from_file(gemspecs, rubyabi_from_path(line), line) + end + end end -gemspecs.each do |file, spec| - rubyabi=nil - m = file.match(%r{.*/gems/([^/]*)/.*}) - rubyabi=m[1] if m +gemspecs.each do |rubyabi, spec| if provides # old forms puts "rubygem-#{spec.name} = #{spec.version}" @@ -72,16 +115,21 @@ if requires puts "ruby(abi) = #{rubyabi}" if rubyabi + puts "rubygems" if rubyabi.to_f < 1.9 spec.runtime_dependencies.each do |dep| dep.requirement.requirements.each do |r| if r.first == '~>' - versions = r.last.to_s.split('.') - versions = versions[0,versions.length-1] + minversion = r.last.to_s.split('.') + versions = minversion[0,minversion.length-1] # ~> 2 is pretty nonsense, so avoid being tricked if versions.length > 1 - puts "rubygem(#{rubyabi}:#{dep.name}:#{versions.join('.')}) >= #{r.last}" + if minversion[minversion.length-1] == '0' + # ~> 1.2.0 is the same as >= 1.2 for rpm and it avoids problems when 1.2 is followed by 1.2.1 + minversion = versions + end + puts "rubygem(#{rubyabi}:#{dep.name}:#{versions.join('.')}) >= #{minversion.join('.')}" else - puts "rubygem(#{rubyabi}:#{dep.name}) >= #{r.last}" + puts "rubygem(#{rubyabi}:#{dep.name}) >= #{minversion.join('.')}" end elsif r.first == '!=' # this is purely guessing, but we can't generate conflicts here ;( -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
