bin/autoproj in autoproj-1.4.1 vs bin/autoproj in autoproj-1.4.2
- old
+ new
@@ -467,10 +467,11 @@
if $LOADED_FEATURES.any? { |l| l =~ /rubygems/ }
if ENV['GEM_HOME'] != Autoproj.gem_home
raise ConfigError, "RubyGems is already loaded with a different GEM_HOME, make sure you are loading the right env.sh script !"
end
end
+
# Set up some important autobuild parameters
Autoproj.env_inherit 'PATH', 'PKG_CONFIG_PATH', 'RUBYLIB', 'LD_LIBRARY_PATH'
Autoproj.env_set 'GEM_HOME', Autoproj.gem_home
Autoproj.env_add 'PATH', File.join(Autoproj.gem_home, 'bin')
Autoproj.env_set 'RUBYOPT', "-rubygems"
@@ -479,10 +480,24 @@
Autobuild.logdir = File.join(Autobuild.prefix, 'log')
if mail_config[:to]
Autobuild::Reporting << Autobuild::MailReporter.new(mail_config)
end
+
+ ruby = RbConfig::CONFIG['RUBY_INSTALL_NAME']
+ if ruby != 'ruby'
+ bindir = File.join(Autoproj.build_dir, 'bin')
+ FileUtils.mkdir_p bindir
+ File.open(File.join(bindir, 'ruby'), 'w') do |io|
+ io.puts "#! /bin/sh"
+ io.puts "exec #{ruby} \"$@\""
+ end
+ FileUtils.chmod 0755, File.join(bindir, 'ruby')
+
+ Autoproj.env_add 'PATH', bindir
+ end
+
# First things first, see if we need to update ourselves
osdeps = Autoproj::OSDependencies.load_default
if osdeps.install(%w{autobuild autoproj})
# We updated autobuild or autoproj themselves ... Restart !
require 'rbconfig'
@@ -554,12 +569,12 @@
Autoproj.save_config
if Autoproj.verbose
# List defined packages, and in which autobuild files they are defined
STDERR.puts "Available packages:"
- manifest.packages.each_value do |package, source, file|
- STDERR.puts " #{package.name}: #{file} from #{source.name}"
+ manifest.packages.each_value do |pkg|
+ STDERR.puts " #{pkg.autobuild.name}: #{pkg.file} from #{pkg.package_set.name}"
end
end
# If in verbose mode, or if we only update sources, list the sources
#
@@ -652,9 +667,17 @@
pkg.prefix = prefix
pkg.doc_target_dir = File.join(Autoproj.build_dir, 'doc', name, pkg_name)
pkg.logdir = logdir
end
seen |= packages
+ end
+
+ # Now call the blocks that the user defined in the autobuild files. We do it
+ # now so that the various package directories are properly setup
+ manifest.packages.each_value do |pkg|
+ if pkg.user_block
+ pkg.user_block[pkg.autobuild]
+ end
end
if only_do_status
STDERR.puts
all_packages = Set.new