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

apkbuild-gem-resolver: exclude testing repository by default

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