Sha256: 963e6078b2ca201006a4c3e576dbd1cd14418d96412878678d2aaf3d86093979

Contents?: true

Size: 1.99 KB

Versions: 21

Compression:

Stored size: 1.99 KB

Contents

#! /usr/bin/env ruby
require 'autoproj'
require 'autoproj/ops/main_config_switcher'

root_dir = Dir.pwd
if File.exists?(File.join(root_dir, 'autoproj', "manifest"))
    raise ConfigError.new, "this installation is already bootstrapped. Remove the autoproj directory if it is not the case"
end

Autoproj.root_dir = root_dir
Autoproj.manifest = Autoproj::Manifest.new
Ops::Tools.load_autoprojrc
Autoproj.prepare_environment

# Check if the .autoprojrc changed the PATH and therefore which autoproj script
# should be executed ... and restart if it did
autoproj_path = Autobuild.find_in_path('autoproj')
if $0 != autoproj_path
    puts "your .autoprojrc file changed PATH in a way that requires the restart of autoproj"

    if ENV['AUTOPROJ_RESTARTING']
        puts "infinite loop detected, will not restart this time"
    else
        require 'rbconfig'
        exec(Autoproj.config.ruby_executable, autoproj_path, *Autoproj::CmdLine.argv)
    end
end

Autoproj::CmdLine.report do
    switcher = Autoproj::Ops::MainConfigSwitcher.new(root_dir)
    begin
        switcher.bootstrap(*ARGV)
        Autoproj.save_config

        STDERR.puts <<EOTEXT


#{color('autoproj bootstrap successfully finished', :green, :bold)}

#{color('To further use autoproj and the installed software', :bold)}, you
must add the following line at the bottom of your .bashrc:
  source #{root_dir}/#{Autoproj::ENV_FILENAME}

WARNING: autoproj will not work until your restart all
your consoles, or run the following in them:
  $ source #{root_dir}/#{Autoproj::ENV_FILENAME}

#{color('To import and build the packages', :bold)}, you can now run
  aup
  amake

The resulting software is installed in
  #{root_dir}/install

EOTEXT

    rescue RuntimeError
        STDERR.puts <<-EOTEXT
#{color('autoproj bootstrap failed', :red, :bold)}
To retry, first source the #{Autoproj::ENV_FILENAME} script with
  source #{root_dir}/#{Autoproj::ENV_FILENAME}
and then re-run autoproj bootstrap
  autoproj bootstrap '#{ARGV.join("'")}'
    EOTEXT

        raise
    end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
autoproj-1.13.0.b3 bin/autoproj-bootstrap