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