bin/autoproj_bootstrap in autoproj-1.13.1 vs bin/autoproj_bootstrap in autoproj-1.13.2.b1

- old
+ new

@@ -356,10 +356,18 @@ get('reused_autoproj_installations').each(&proc) else [].each(&proc) end end + def import_log_enabled? + get('import_log_enabled', true) + end + + def import_log_enabled=(value) + set('import_log_enabled', !!value) + end + def ruby_executable @ruby_executable ||= OSDependencies.autodetect_ruby_program end def validate_ruby_executable @@ -868,10 +876,19 @@ super(['emerge'], true, "emerge '%s'", "emerge --noreplace '%s'") end end + # Package manager interface for systems that use pkg (i.e. FreeBSD) as + # their package manager + class PkgManager < ShellScriptManager + def initialize + super(['pkg'], true, + "pkg install -y '%s'", + "pkg install -y '%s'") + end + end #Package manger for OpenSuse and Suse (untested) class ZypperManager < ShellScriptManager def initialize super(['zypper'], true, @@ -1481,11 +1498,12 @@ PackageManagers::PacmanManager, PackageManagers::HomebrewManager, PackageManagers::YumManager, PackageManagers::PortManager, PackageManagers::ZypperManager, - PackageManagers::PipManager] + PackageManagers::PipManager , + PackageManagers::PkgManager] # Mapping from OS name to package manager name # # Package handlers and OSes MUST have different names. The former are # used to resolve packages and the latter to resolve OSes in the osdeps. @@ -1501,11 +1519,12 @@ 'gentoo' => 'emerge', 'arch' => 'pacman', 'fedora' => 'yum', 'macos-port' => 'macports', 'macos-brew' => 'brew', - 'opensuse' => 'zypper' + 'opensuse' => 'zypper', + 'freebsd' => 'pkg' } # The information contained in the OSdeps files, as a hash attr_reader :definitions # All the information contained in all the OSdeps files, as a mapping @@ -1708,10 +1727,13 @@ elsif File.exists?('/etc/SuSE-release') version = File.read('/etc/SuSE-release').strip version =~/.*VERSION\s+=\s+([^\s]+)/ version = $1 [['opensuse'], [version.strip]] + elsif Autobuild.freebsd? + version = `uname -r`.strip.split("-")[0] + [['freebsd'],[version]] end end def self.ensure_derivatives_refer_to_their_parents(names) names = names.dup @@ -1856,10 +1878,24 @@ return [distributor, [codename, version]] end class InvalidRecursiveStatement < Autobuild::Exception; end + # Return the path to the osdeps name for a given package name while + # accounting for package aliases + # + # returns an array contain the path starting with name and + # ending at the resolved name + def self.resolve_name(name) + path = [ name ] + while OSDependencies.aliases.has_key?(name) + name = OSDependencies.aliases[name] + path << name + end + path + end + # Return the list of packages that should be installed for +name+ # # The following two simple return values are possible: # # nil:: +name+ has no definition @@ -1874,13 +1910,12 @@ # packages that should be installed with +package_handler+ for +name+, # and FOUND_NONEXISTENT if the nonexistent keyword is used for this OS # name and version. The package list might be empty even if status == # FOUND_PACKAGES, for instance if the ignore keyword is used. def resolve_package(name) - while OSDependencies.aliases.has_key?(name) - name = OSDependencies.aliases[name] - end + path = OSDependencies.resolve_name(name) + name = path.last os_names, os_versions = OSDependencies.operating_system os_names = os_names.dup os_names << 'default' @@ -2097,11 +2132,12 @@ def resolve_os_dependencies(dependencies) all_packages = [] dependencies.each do |name| result = resolve_package(name) if !result - raise MissingOSDep.new, "there is no osdeps definition for #{name}" + path = OSDependencies.resolve_name(name) + raise MissingOSDep.new, "there is no osdeps definition for #{path.last} (search tree: #{path.join("->")})" end if result.empty? if OSDependencies.supported_operating_system? os_names, os_versions = OSDependencies.operating_system @@ -2927,15 +2963,16 @@ - glibc-devel darwin: ignore opensuse: - "@devel_C_C++" - gcc-c++ + default: clang autobuild: -- gem: autobuild +- gem: autobuild<1.10 - osdep: readline autoproj: -- gem: autoproj +- gem: autoproj<2.0 - osdep: readline readline: debian,ubuntu: libreadline-dev fedora: readline-devel opensuse: readline-devel @@ -2948,34 +2985,38 @@ default: git-core ubuntu: git-core gentoo: dev-vcs/git arch: git fedora: git - macos-port: git-core + macos-port: git macos-brew: git opensuse: git + freebsd: git hg: debian,ubuntu: mercurial gentoo: dev-vcs/mercurial arch: mercurial fedora: mercurial darwin: mercurial opensuse: mercurial + freebsd: mercurial svn: debian,ubuntu: subversion gentoo: dev-util/subversion arch: subversion fedora: subversion darwin: subversion opensuse: subversion + freebsd: subversion cmake: debian,ubuntu: cmake gentoo: dev-util/cmake arch: cmake fedora: cmake darwin: cmake opensuse: cmake + freebsd: cmake autotools: debian,ubuntu: - automake - autoconf gentoo: @@ -2991,10 +3032,13 @@ - automake - autoconf opensuse: - automake - autoconf + freebsd: + - automake + - autoconf archive: debian,ubuntu: - tar - unzip gentoo: @@ -3012,21 +3056,25 @@ macos-brew: - gnu-tar opensuse: - tar - unzip + default: ignore cvs: debian,ubuntu: cvs fedora: cvs darwin: cvs arch: cvs opensuse: cvs + freebsd: cvs pip: debian,ubuntu: python-pip arch: python2-pip opensuse: python-pip fedora: python-pip + freebsd: pip sudo: + macos-brew: ignore default: sudo EODEFS # Override Autoproj.root_dir