bin/autoproj_bootstrap in autoproj-1.9.5.rc3 vs bin/autoproj_bootstrap in autoproj-1.9.5.rc4

- old
+ new

@@ -10,16 +10,16 @@ Encoding.default_external = Encoding::UTF_8 end require 'rbconfig' module Autobuild - @windows = RbConfig::CONFIG["host_os"] =~%r!(msdos|mswin|djgpp|mingw|[Ww]indows)! + @windows = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw|[Ww]indows)! def self.windows? @windows end - @macos = RbConfig::CONFIG["host_os"] = ~%r!([Dd]arwin)! + @macos = RbConfig::CONFIG["host_os"] =~ %r!([Dd]arwin)! def self.macos? @macos end end @@ -448,15 +448,12 @@ end.join(":") Autobuild.env_inherit 'GEM_PATH' Autobuild.env_init_from_env 'GEM_PATH' orig_gem_path = Autobuild::ORIGINAL_ENV['GEM_PATH'].split(':') - Gem.default_path.each do |p| - if !orig_gem_path.include?(p) - orig_gem_path << ":#{p}" - end - end + Autobuild::SYSTEM_ENV['GEM_PATH'] = Gem.default_path + Autobuild::ORIGINAL_ENV['GEM_PATH'] = orig_gem_path.join(":") Autoproj.manifest.each_reused_autoproj_installation do |p| p_gems = File.join(Autoproj.root_dir, '.gems') if File.directory?(p_gems) Autobuild.env_add_path 'GEM_PATH', p_gems @@ -569,12 +566,12 @@ dep = Gem::Dependency.new(name, version_requirements) available = if gem_fetcher.respond_to?(:find_matching) gem_fetcher.find_matching(dep, true, true, GemManager.with_prerelease).map(&:first) else # Post RubyGems-2.0 - type = if GemManager.with_prerelease then :prerelease - else :complete + type = if GemManager.with_prerelease then :complete + else :released end gem_fetcher.detect(type) do |tuple| tuple.name == name && dep.match?(tuple) end.map { |tuple, _| [tuple.name, tuple.version] } @@ -806,17 +803,19 @@ PACKAGE_HANDLERS = [PackageManagers::AptDpkgManager, PackageManagers::GemManager, PackageManagers::EmergeManager, PackageManagers::PacmanManager, + PackageManagers::PacmanManager, PackageManagers::YumManager, PackageManagers::PortManager, PackageManagers::PipManager] OS_PACKAGE_HANDLERS = { 'debian' => 'apt-dpkg', 'gentoo' => 'emerge', 'arch' => 'pacman', + 'manjarolinux' => 'pacman', 'fedora' => 'yum', 'darwin' => 'port' } # The information contained in the OSdeps files, as a hash @@ -1001,16 +1000,18 @@ end else Autoproj.message " autodetecting the operating system" lsb_name, lsb_versions = os_from_lsb if lsb_name - if lsb_name != "debian" - if File.exists?("/etc/debian_version") - @operating_system = [[lsb_name, "debian"], lsb_versions] - else - @operating_system = [[lsb_name], lsb_versions] - end + if lsb_name != 'debian' && File.exists?("/etc/debian_version") + @operating_system = [[lsb_name, "debian"], lsb_versions] + elsif lsb_name != 'arch' && File.exists?("/etc/arch-release") + @operating_system = [[lsb_name, "arch"], lsb_versions] + elsif lsb_name != 'debian' + # Debian unstable cannot be detected with lsb_release, + # so debian has its own detection logic + @operating_system = [[lsb_name], lsb_versions] end end end if @operating_system.nil? @@ -1422,29 +1423,31 @@ packages, packages from your operating system/distribution, ...). Autoproj is usually able to install those automatically, but unfortunately your operating system is not (yet) supported by autoproj's osdeps mechanism, it can only offer you some limited support. -RubyGem packages are a cross-platform mechanism, and are therefore supported. -However, you will have to install the kind of OS dependencies (so-called OS -packages) +Some package handlers are cross-platform, and are therefore supported. However, +you will have to install the kind of OS dependencies (so-called OS packages) This option is meant to allow you to control autoproj's behaviour while handling OS dependencies. +* if you say "all", all OS-independent packages are going to be installed. * if you say "gem", the RubyGem packages will be installed. +* if you say "pip", the Pythin PIP packages will be installed. * if you say "none", autoproj will not do anything related to the OS dependencies. As any configuration value, the mode can be changed anytime by calling autoproj reconfigure -Finally, the "autoproj osdeps" command will give you the necessary information about the OS packages that you will need to install manually. +Finally, the "autoproj osdeps" command will give you the necessary information +about the OS packages that you will need to install manually. -So, what do you want ? (either 'all', 'none', or a comma-separated list of 'gem' and 'pip' -- without the quotes) +So, what do you want ? (all, none or a comma-separated list of: gem pip) EOT - message = [ "Which prepackaged software (a.k.a. 'osdeps') should autoproj install automatically ('all', 'none', or a comma-separated list of 'gem' and 'pip' -- without the quotes) ?", long_doc.strip ] + message = [ "Which prepackaged software (a.k.a. 'osdeps') should autoproj install automatically (all, none or a comma-separated list of: gem pip) ?", long_doc.strip ] Autoproj.configuration_option 'osdeps_mode', 'string', :default => 'ruby', :doc => message, :lowercase => true @@ -1471,18 +1474,21 @@ * if you say "os", only the OS-provided packages will be installed. Installing these packages requires root access. * if you say "none", autoproj will not do anything related to the OS dependencies. +Finally, you can provide a comma-separated list of pip gem and os. + As any configuration value, the mode can be changed anytime by calling autoproj reconfigure -Finally, the "autoproj osdeps" command +Finally, the "autoproj osdeps" command will give you the necessary information +about the OS packages that you will need to install manually. -So, what do you want ? (either 'all', 'none', or a comma-separated list of 'os', 'gem' and 'pip' -- without the quotes) +So, what do you want ? (all, none or a comma-separated list of: os gem pip) EOT - message = [ "Which prepackaged software (a.k.a. 'osdeps') should autoproj install automatically ('all', 'none', or a comma-separated list of 'os', 'gem' and 'pip' -- without the quotes) ?", long_doc.strip ] + message = [ "Which prepackaged software (a.k.a. 'osdeps') should autoproj install automatically (all, none or a comma-separated list of: os gem pip) ?", long_doc.strip ] Autoproj.configuration_option 'osdeps_mode', 'string', :default => 'all', :doc => message, :lowercase => true @@ -1495,18 +1501,24 @@ osdeps_mode_option_unsupported_os end end def self.osdeps_mode_string_to_value(string) - string = string.to_s.downcase - case string - when 'all' then ['os', 'gem', 'pip'] - when 'ruby' then ['gem'] - when 'os' then ['os'] - when 'none' then ['none'] - else string.split(',') + string = string.to_s.downcase.split(',') + modes = [] + string.map do |str| + case str + when 'all' then modes.concat(['os', 'gem', 'pip']) + when 'ruby' then modes << 'gem' + when 'gem' then modes << 'gem' + when 'pip' then modes << 'pip' + when 'os' then modes << 'os' + when 'none' then modes << 'none' + else raise ArgumentError, "#{str} is not a known package handler" + end end + modes end # If set to true (the default), #install will try to remove the list of # already uptodate packages from the installed packages. Set to false to # install all packages regardless of their status @@ -1582,11 +1594,11 @@ os_package_handler.enabled = false package_handlers.each_value do |handler| handler.enabled = false end - osdeps_mode.each do |m| + options[:osdeps_mode].each do |m| if m == 'os' os_package_handler.enabled = true else package_handlers[m].enabled = true end @@ -2079,130 +2091,133 @@ end @root_dir = Dir.pwd end DEFS = <<EODEFS ---- -ruby20: ignore -archive: - darwin: - - gnutar - - unzip - debian,ubuntu: - - tar - - unzip - fedora: - - tar - - unzip - arch: - - tar - - unzip - gentoo: - - app-arch/tar - - app-arch/unzip -autoproj: gem -lsb_release: - darwin: ignore - debian,ubuntu: lsb-release - fedora: redhat-lsb - arch: ignore - gentoo: sys-apps/lsb-release -svn: - darwin: subversion - debian,ubuntu: subversion - fedora: subversion - arch: subversion - gentoo: dev-util/subversion -autobuild: gem -build-essential: - darwin: ignore - debian,ubuntu: build-essential - fedora: ignore - arch: ignore - gentoo: ignore -ruby19: - darwin: - - ruby19 +--- +none: ignore +ruby18: + debian,ubuntu: + - ruby1.8-dev + - ruby1.8 + - rubygems1.8 + - ri1.8 + - libopenssl-ruby1.8 - rake + gentoo: + - dev-lang/ruby:1.8 + - rake + fedora: + '15,16': + - ruby + - rubygems + darwin: + - ruby + - rb-rake default: nonexistent - debian: +ruby19: + debian: - ruby1.9.1 - ruby1.9.1-dev - rubygems1.9.1 - rake - rubygems-integration - ubuntu: + ubuntu: - ruby1.9.1 - ruby1.9.1-dev - rubygems1.9.1 - ri1.9.1 - libopenssl-ruby1.9.1 - rake - fedora: - "17": - - ruby - - rubygems - arch: - - ruby - - rake - gentoo: + gentoo: - dev-lang/ruby:1.9 - rake -ruby18: - darwin: + arch,manjarolinux: - ruby - - rb-rake - default: nonexistent - debian,ubuntu: - - ruby1.8-dev - - ruby1.8 - - rubygems1.8 - - ri1.8 - - libopenssl-ruby1.8 - - rake - fedora: - "15,16": + fedora: + '17': - ruby - rubygems - gentoo: - - dev-lang/ruby:1.8 + darwin: + - ruby19 - rake -git: - darwin: git-core - debian: - default: git-core + default: nonexistent +ruby20: ignore +build-essential: + debian,ubuntu: build-essential + gentoo: ignore + arch,manjarolinux: base-dev + fedora: ignore + darwin: ignore +autobuild: gem +autoproj: gem +git: + debian: lenny: git + default: git-core ubuntu: git-core - fedora: git - arch: git gentoo: dev-vcs/git -autotools: - darwin: + arch,manjarolinux: git + fedora: git + darwin: git-core +svn: + debian,ubuntu: subversion + gentoo: dev-util/subversion + arch,manjarolinux: subversion + fedora: subversion + darwin: subversion +cmake: + debian,ubuntu: cmake + gentoo: dev-util/cmake + arch,manjarolinux: cmake + fedora: cmake + darwin: cmake +autotools: + debian,ubuntu: + - automake1.9 + - autoconf + gentoo: + - sys-devel/automake:1.9 + - sys-devel/autoconf + arch,manjarolinux: - automake - autoconf - debian,ubuntu: - - automake1.9 + fedora: + - automake - autoconf - fedora: + darwin: - automake - autoconf - arch: automake autoconf - gentoo: - - sys-devel/automake:1.9 - - sys-devel/autoconf -cmake: - darwin: cmake - debian,ubuntu: cmake - fedora: cmake - arch: cmake - gentoo: dev-util/cmake -none: ignore -pip: - debian,ubuntu: python-pip -cvs: - darwin: cvs +lsb_release: + debian,ubuntu: lsb-release + gentoo: sys-apps/lsb-release + arch,manjarolinux: lsb-release + fedora: redhat-lsb + darwin: ignore +archive: + debian,ubuntu: + - tar + - unzip + gentoo: + - app-arch/tar + - app-arch/unzip + arch,manjarolinux: + - tar + - unzip + fedora: + - tar + - unzip + darwin: + - gnutar + - unzip +cvs: debian,ubuntu: cvs fedora: cvs + darwin: cvs + arch,manjarolinux: cvs +pip: + debian,ubuntu: python-pip + arch,manjarolinux: python2-pip EODEFS Autoproj::OSDependencies.define_osdeps_mode_option osdeps_mode = Autoproj::OSDependencies.osdeps_mode.join(",")