diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-07-13 16:22:07 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-07-13 16:22:07 +0300 |
commit | 05df0f6df0bbf628ede1d460a119605a49f7fc56 (patch) | |
tree | ba0dd0e789fbd4b7022ed005248a1e86bf9f7fb7 /apkbuild-gem-resolver.in | |
parent | 09e42ef6c01adf11cb5373a13867dcf0943f4b1e (diff) | |
download | abuild-05df0f6df0bbf628ede1d460a119605a49f7fc56.tar.gz abuild-05df0f6df0bbf628ede1d460a119605a49f7fc56.tar.bz2 abuild-05df0f6df0bbf628ede1d460a119605a49f7fc56.tar.xz abuild-05df0f6df0bbf628ede1d460a119605a49f7fc56.zip |
apkbuild-gem-resolver: automatically update checksums
Diffstat (limited to 'apkbuild-gem-resolver.in')
-rw-r--r-- | apkbuild-gem-resolver.in | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/apkbuild-gem-resolver.in b/apkbuild-gem-resolver.in index 228d3b7..d6782e1 100644 --- a/apkbuild-gem-resolver.in +++ b/apkbuild-gem-resolver.in @@ -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 |