Commit 3567ee3f authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

apkbuild-gem-resolver: exclude testing repository by default

parent ddb37cfc
......@@ -4,6 +4,7 @@
# Copyright (C) 2014 Kaarle Ritvanen
require 'augeas'
require 'optparse'
require 'rubygems/dependency'
require 'rubygems/resolver'
require 'rubygems/spec_fetcher'
......@@ -31,7 +32,7 @@ class Aport
@@aports = {}
@@subpackages = []
def self.initialize
def self.initialize testing
Augeas::open(nil, nil, Augeas::NO_MODL_AUTOLOAD) do |aug|
dir = Dir.pwd
aug.transform(:lens => 'Shellvars.lns', :incl => dir + '/*/ruby*/APKBUILD')
......@@ -40,7 +41,9 @@ class Aport
apath = '/files' + dir
fail if aug.match("/augeas#{apath}//error").length > 0
for repo in ['main', 'testing']
repos = ['main']
repos.push 'testing' if testing
for repo in repos
for aport in aug.match "#{apath}/#{repo}/*"
FileAport.new(aug, aport) unless aport.end_with? '/ruby'
end
......@@ -130,9 +133,6 @@ class FileAport < Aport
end
Aport.initialize
class Update
def initialize
@gems = {}
......@@ -264,6 +264,14 @@ class Update
end
testing = false
OptionParser.new do |opts|
opts.on('-t', '--testing') do |t|
testing = t
end
end.parse! ARGV
Aport.initialize testing
latest = {}
for source, gems in Gem::SpecFetcher::fetcher.available_specs(:latest)[0]
for gem in gems
......
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