Commit 05df0f6d authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

apkbuild-gem-resolver: automatically update checksums

parent 09e42ef6
......@@ -89,13 +89,17 @@ end
class Aport < Package
def initialize path
super path.split('/')[-1]
@path = path + '/APKBUILD/'
@path = path[6..-1]
@apath = path + '/APKBUILD/'
for dep in `echo #{get_param 'depends'}`.split
add_dependency dep
end
end
attr_reader :path
def gem
get_param '_gemname'
end
......@@ -117,13 +121,13 @@ class Aport < Package
private
def get_param name
value = @@augeas.get(@path + name)
value = @@augeas.get(@apath + name)
raise name + ' not defined for ' + @name unless value
value
end
def set_param name, value
@@augeas.set(@path + name, value)
@@augeas.set(@apath + name, value)
end
end
......@@ -317,7 +321,8 @@ class Update
{
:name => @package.name,
:version => version,
:obsolete_deps => @obsolete_deps.clone
:obsolete_deps => @obsolete_deps.clone,
:path => @package.path
}
) : nil
end
......@@ -326,13 +331,13 @@ end
testing = false
update_files = false
update_files = nil
OptionParser.new do |opts|
opts.on('-t', '--testing') do |t|
testing = t
end
opts.on('-u', '--update') do |u|
update_files = u
update_files = []
end
end.parse! ARGV
Package.initialize testing
......@@ -366,9 +371,16 @@ for pkg in update
for dep in obsolete
package.del_dependency dep
end
update_files << pkg[:path]
end
end
if update_files
Package.save
for path in update_files
Dir.chdir(path) do
fail unless system('abuild checksum')
end
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