From 2669370c2a862ed0af973f5480c6b1a3a33db676 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 20 Nov 2014 12:46:15 +0000 Subject: rubygems: Add an 'ignore list' This is used to ignore Gems which either come built into Ruby (like Rake) or are supplied with the 'ruby' stratum. As noted in the comment in the .yaml file it is not an ideal solution, but it should work well enough for the time being. --- baserockimport/data/rubygems.yaml | 20 +++++++++++++++++--- baserockimport/exts/rubygems.find_deps | 5 ++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/baserockimport/data/rubygems.yaml b/baserockimport/data/rubygems.yaml index f61defe..8c13689 100644 --- a/baserockimport/data/rubygems.yaml +++ b/baserockimport/data/rubygems.yaml @@ -8,10 +8,24 @@ lorry-prefix: ruby-gems/ # tools because of the number of circular dependencies. Instead, only those # tools which are known to be required at Gem build time are listed as # build-dependencies, and any other :development dependencies are ignored. +# +# This list is currently empty, because everything that was in it has been +# added to the 'ruby' stratum and so is present implicitly. build-dependency-whitelist: [] - # rake is bundled with Ruby, so it is not included in the whitelist. - # hoe is included in the 'ruby' stratum - # rake-compiler is included in the 'ruby' stratum + +# List of Gems which are built into Ruby or included in the 'ruby' stratum +# in http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git +# +# This doesn't take the versions that are provided into account (and it'd be +# quite a maintenance burden if it did). Thus it's not an ideal solution, as +# something may for example depend on Rake 4.9 when Rake 2.0 is actually the +# only thing available and this won't be noticed until the user tries to build +# the generated definitions. +ignore-list: + - bundler + - hoe + - rake + - rake-compiler # The following Gems don't provide a source_code_uri in their Gem metadata. # Ideally ... they would do. diff --git a/baserockimport/exts/rubygems.find_deps b/baserockimport/exts/rubygems.find_deps index 5ae9598..ae08b65 100755 --- a/baserockimport/exts/rubygems.find_deps +++ b/baserockimport/exts/rubygems.find_deps @@ -36,6 +36,7 @@ class RubyGemDependencyFinder < Importer::Base def initialize local_data = YAML.load_file(local_data_path("rubygems.yaml")) @build_dependency_whitelist = local_data['build-dependency-whitelist'] + @ignore_list = local_data['ignore-list'] end def parse_options(arguments) @@ -64,7 +65,9 @@ class RubyGemDependencyFinder < Importer::Base end def runtime_deps_for_gem(spec) - spec.dependencies.select {|d| d.type == :runtime} + spec.dependencies.select do |d| + d.type == :runtime && ! @ignore_list.member?(d.name) + end end def run -- cgit v1.2.1