Commit d1deffc9 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

apkbuild-gem-resolver: aport update descriptors

parent 1e3d4338
#!/usr/bin/ruby #!/usr/bin/ruby
# APKBUILD dependency resolver for RubyGems # APKBUILD dependency resolver for RubyGems
# Copyright (C) 2014 Kaarle Ritvanen # Copyright (C) 2014-2015 Kaarle Ritvanen
require 'augeas' require 'augeas'
require 'optparse' require 'optparse'
...@@ -201,12 +201,8 @@ class Update ...@@ -201,12 +201,8 @@ class Update
def each def each
@gems.each_value do |gem| @gems.each_value do |gem|
obs = gem.obsolete_deps update = gem.update
obs = obs.length == 0 ? nil : " (obsolete dependencies: #{obs.join ', '})" yield update if update
if gem.updated? || obs
yield "#{gem.aport.name}-#{gem.version}#{obs}"
end
end end
end end
...@@ -233,7 +229,7 @@ class Update ...@@ -233,7 +229,7 @@ class Update
@aport = aport @aport = aport
end end
attr_reader :aport, :obsolete_deps attr_reader :aport
def require_version version def require_version version
if @version if @version
...@@ -278,6 +274,16 @@ class Update ...@@ -278,6 +274,16 @@ class Update
} }
end end
end end
def update
updated? || @obsolete_deps.length > 0 ? (
{
:name => @aport.name,
:version => version,
:obsolete_deps => @obsolete_deps.clone
}
) : nil
end
end end
end end
...@@ -306,6 +312,9 @@ end ...@@ -306,6 +312,9 @@ end
update.resolve update.resolve
for aport in update for pkg in update
puts aport obs = pkg[:obsolete_deps]
obs = obs.length == 0 ? nil : " (obsolete dependencies: #{obs.join ', '})"
puts "#{pkg[:name]}-#{pkg[:version]}#{obs}"
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment