bin/autoproj_bootstrap in autoproj-1.7.14.rc2 vs bin/autoproj_bootstrap in autoproj-1.7.14.rc4

- old
+ new

@@ -114,12 +114,14 @@ class << self attr_reader :aliases attr_accessor :force_osdeps attr_accessor :gem_with_prerelease + attr_accessor :gem_doc end @aliases = Hash.new + @gem_doc = false attr_writer :silent def silent?; @silent end def self.alias(old_name, new_name) @@ -472,17 +474,35 @@ return IGNORE end # If data is a hash, it means we have to check the OS version as well if data.kind_of?(Hash) - version_entry = data.find do |version_list, _| - version_list.to_s.split(','). - map(&:downcase). - any? do |v| - os_versions.any? { |osv| Regexp.new(v) =~ osv } + # Look in +data+ for specific version. We look, in order, in the + # os_versions field (detected OS versions), and return the first + # matching entry + version_entry = nil + # First, look for an exact match + found = os_versions.find do |os_ver| + version_entry = data.find do |version_list, _| + version_list.to_s.split(','). + map(&:downcase). + any? { |v| v == os_ver } + end + end + if !found + # Then relax the matching ... + found = os_versions.find do |os_ver| + version_entry = data.find do |version_list, _| + version_list.to_s.split(','). + map(&:downcase). + any? { |v| Regexp.new(v) =~ os_ver } end + end end + if Autoproj.verbose + Autoproj.progress "selected OS version #{found} for osdep #{name}: #{version_entry.inspect}" + end if !version_entry return WRONG_OS_VERSION end data = version_entry.last @@ -497,11 +517,11 @@ return [PACKAGES, data] elsif data.respond_to?(:to_str) # Single package return [PACKAGES, [data.to_str]] else - raise ConfigError.new, "invalid package specificiation #{data} in #{source_of(name)}" + raise ConfigError.new, "invalid package specification #{data} in #{source_of(name)}" end end # Resolves the given OS dependencies into the actual packages that need # to be installed on this particular OS. @@ -1024,10 +1044,14 @@ # Now install the RubyGems if !gems.empty? guess_gem_program base_cmdline = [Autobuild.tool('gem'), 'install'] + if !OSDependencies.gem_doc + base_cmdline << '--no-rdoc' << '--no-ri' + end + if Autoproj::OSDependencies.gem_with_prerelease base_cmdline << "--prerelease" end with_version, without_version = gems.partition { |name, v| v } @@ -1532,11 +1556,10 @@ debian,ubuntu: build-essential libxslt: arch: libxslt gentoo: dev-libs/libxslt debian,ubuntu: libxslt1-dev -rdoc: gem EODEFS Autoproj::OSDependencies.define_osdeps_mode_option osdeps_mode = Autoproj::OSDependencies.osdeps_mode @@ -1563,10 +1586,10 @@ STDERR.puts "failed: #{e.message}" exit(1) end # Now try to find out the name of the gem binary -PACKAGES = %w{rdoc autobuild libxml2 libxslt zlib build-essential lsb_release} +PACKAGES = %w{autobuild libxml2 libxslt zlib build-essential lsb_release} ENV['RUBYOPT'] = "-rubygems" require 'rubygems' STDERR.puts "autoproj: installing autoproj and its dependencies (this can take a long time)"