Commit d1deffc9 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

apkbuild-gem-resolver: aport update descriptors

parent 1e3d4338
#!/usr/bin/ruby
# APKBUILD dependency resolver for RubyGems
# Copyright (C) 2014 Kaarle Ritvanen
# Copyright (C) 2014-2015 Kaarle Ritvanen
require 'augeas'
require 'optparse'
......@@ -201,12 +201,8 @@ class Update
def each
@gems.each_value do |gem|
obs = gem.obsolete_deps
obs = obs.length == 0 ? nil : " (obsolete dependencies: #{obs.join ', '})"
if gem.updated? || obs
yield "#{gem.aport.name}-#{gem.version}#{obs}"
end
update = gem.update
yield update if update
end
end
......@@ -233,7 +229,7 @@ class Update
@aport = aport
end
attr_reader :aport, :obsolete_deps
attr_reader :aport
def require_version version
if @version
......@@ -278,6 +274,16 @@ class Update
}
end
end
def update
updated? || @obsolete_deps.length > 0 ? (
{
:name => @aport.name,
:version => version,
:obsolete_deps => @obsolete_deps.clone
}
) : nil
end
end
end
......@@ -306,6 +312,9 @@ end
update.resolve
for aport in update
puts aport
for pkg in update
obs = pkg[:obsolete_deps]
obs = obs.length == 0 ? nil : " (obsolete dependencies: #{obs.join ', '})"
puts "#{pkg[:name]}-#{pkg[:version]}#{obs}"
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