bin/autoproj in autoproj-1.6.0.rc5 vs bin/autoproj in autoproj-1.6.0.rc6

- old
+ new

@@ -11,11 +11,10 @@ require 'autoproj/cmdline' include Autoproj InputError = Autoproj::InputError -selected_packages = Autoproj::CmdLine.parse_arguments(ARGV.dup) def color(*args) Autoproj.console.color(*args) end @@ -26,15 +25,17 @@ end rescue ConfigError => e STDERR.puts STDERR.puts color(e.message, :red, :bold) - root_dir = /^#{Regexp.quote(Autoproj.root_dir)}(?!\/\.gems)/ - e.backtrace.find_all { |path| path =~ root_dir }. - each do |path| - STDERR.puts color(" in #{path}", :red, :bold) - end + if Autoproj.in_autoproj_installation?(Dir.pwd) + root_dir = /^#{Regexp.quote(Autoproj.root_dir)}(?!\/\.gems)/ + e.backtrace.find_all { |path| path =~ root_dir }. + each do |path| + STDERR.puts color(" in #{path}", :red, :bold) + end + end if debug then raise else exit 1 end rescue Interrupt STDERR.puts @@ -46,11 +47,32 @@ Autoproj::OSDependencies.autodetect_ruby # Find the autoproj root dir report(Autobuild.debug) do + selected_packages = + begin Autoproj::CmdLine.parse_arguments(ARGV.dup) + rescue Exception => e + if Autoproj::CmdLine.bootstrap? && !Autoproj.in_autoproj_installation?(Dir.pwd) + STDERR.puts <<EOTEXT + +#{color('autoproj bootstrap failed', :red, :bold)} +To retry, first source the env.sh script with + source #{Dir.pwd}/env.sh +and then re-run autoproj bootstrap with + autoproj bootstrap <vcs_type> <vcs_url> <vcs_options> + +where + 'vcs_type' is git, svn, darcs, cvs + 'vcs_url' is the vcs-specific URL to the repository, and + 'vcs_options' are optional values that can be given to the chosen VCS +EOTEXT + end + raise + end + # Expand directories in the selected_packages set, before we chdir to the # autoproj root root_dir = Autoproj.root_dir selected_packages.map! do |name| if File.directory?(name) @@ -80,9 +102,33 @@ end # If in verbose mode, or if we only update sources, list the sources if Autoproj.verbose || Autoproj::CmdLine.display_configuration? Autoproj::CmdLine.display_sources(manifest) + end + + if Autoproj::CmdLine.bootstrap? + 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 #{Dir.pwd}/env.sh + +WARNING: autoproj will not work until your restart all +your consoles, or run the following in them: + $ source #{Dir.pwd}/env.sh + +#{color('To import and build the packages', :bold)}, you can now run + autoproj update + autoproj build + +The resulting software is installed in + #{Dir.pwd}/install + +EOTEXT end if Autoproj::CmdLine.only_config? exit(0) end