Commit 4329ca27 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

apkbuild-gem-resolver: support community repo

parent c85fc5b5
...@@ -12,7 +12,7 @@ require 'rubygems/spec_fetcher' ...@@ -12,7 +12,7 @@ require 'rubygems/spec_fetcher'
class Package class Package
@@packages = {} @@packages = {}
def self.initialize testing def self.initialize level
@@augeas = Augeas::open(nil, nil, Augeas::NO_MODL_AUTOLOAD) @@augeas = Augeas::open(nil, nil, Augeas::NO_MODL_AUTOLOAD)
dir = Dir.pwd dir = Dir.pwd
@@augeas.transform( @@augeas.transform(
...@@ -23,8 +23,8 @@ class Package ...@@ -23,8 +23,8 @@ class Package
apath = '/files' + dir apath = '/files' + dir
fail unless @@augeas.match("/augeas#{apath}//error").empty? fail unless @@augeas.match("/augeas#{apath}//error").empty?
repos = ['main'] repos = ['main', 'community', 'testing']
repos << 'testing' if testing repos = repos[0..repos.index(level)]
for repo in repos for repo in repos
for pkg in @@augeas.match "#{apath}/#{repo}/*" for pkg in @@augeas.match "#{apath}/#{repo}/*"
Aport.new(pkg) unless pkg.end_with? '/ruby' Aport.new(pkg) unless pkg.end_with? '/ruby'
...@@ -346,17 +346,20 @@ class Update ...@@ -346,17 +346,20 @@ class Update
end end
testing = false level = 'main'
update_files = nil update_files = nil
OptionParser.new do |opts| OptionParser.new do |opts|
opts.on('-c', '--community') do |c|
level = 'community'
end
opts.on('-t', '--testing') do |t| opts.on('-t', '--testing') do |t|
testing = t level = 'testing'
end end
opts.on('-u', '--update') do |u| opts.on('-u', '--update') do |u|
update_files = [] update_files = []
end end
end.parse! ARGV end.parse! ARGV
Package.initialize testing Package.initialize level
latest = {} latest = {}
for source, gems in Gem::SpecFetcher::fetcher.available_specs(:latest)[0] for source, gems in Gem::SpecFetcher::fetcher.available_specs(:latest)[0]
......
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