mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-03-11 06:37:31 +00:00
apkbuild-gem-resolver: automatically update checksums
This commit is contained in:
parent
09e42ef6c0
commit
05df0f6df0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user