mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-23 07:22:53 +00:00
apkbuild-gem-resolver: exclude testing repository by default
This commit is contained in:
parent
ddb37cfcd5
commit
3567ee3f49
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user