autoproj 1.6.2.rc3 → 1.6.2.rc4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,17 @@
1
+ = Version 1.6.2
2
+ * overhauled osdeps fine-grained configuration. See
3
+ http://orocos.org/dfki/autoproj/osdeps.html
4
+ for more information
5
+ * fix too-aggressive caching of operating system characteristics,
6
+ which breaks on OS upgrades.
7
+ * on Debian-like systems, filter out packages that are already installed
8
+ * on all systems, filter packages that have already been handled by the osdeps
9
+ * add a -k option that continues operation even after errors. The sum of all
10
+ errors are properly presented at the end of the run.
11
+ * when boostrapping, check that the current directory is empty and warn the
12
+ user if it is not.
13
+ * a few minor bugfixes
14
+
1
15
  = Version 1.6.1
2
16
  * fix a limitation of giving directories on the command line. Before, only
3
17
  packages that were explicitely listed in the layout would be selected. Now,
data/Rakefile CHANGED
@@ -52,6 +52,7 @@ namespace 'dist' do
52
52
  require 'yaml'
53
53
  osdeps_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'osdeps.rb'))
54
54
  options_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'options.rb'))
55
+ system_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'system.rb'))
55
56
  osdeps_defaults = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'default.osdeps'))
56
57
  # Filter rubygems dependencies from the OSdeps default. They will be
57
58
  # installed at first build
@@ -69,6 +70,7 @@ namespace 'dist' do
69
70
  bootstrap_code = File.read(File.join(Dir.pwd, 'bin', 'autoproj_bootstrap.in')).
70
71
  gsub('OSDEPS_CODE', osdeps_code).
71
72
  gsub('OPTIONS_CODE', options_code).
73
+ gsub('SYSTEM_CODE', system_code).
72
74
  gsub('OSDEPS_DEFAULTS', osdeps_defaults)
73
75
  File.open(File.join(Dir.pwd, 'doc', 'guide', 'src', 'autoproj_bootstrap'), 'w') do |io|
74
76
  io.write bootstrap_code
@@ -739,6 +739,7 @@ with the corresponding option (--all, --ruby, --os or --none).
739
739
 
740
740
  if mode
741
741
  @osdeps_mode = mode
742
+ Autoproj.change_option('osdeps_mode', mode_name, true)
742
743
  return mode
743
744
  end
744
745
 
@@ -943,11 +944,13 @@ module Autoproj
943
944
  def doc
944
945
  doc = (options[:doc] || "#{name} (no documentation for this option)")
945
946
  if doc.respond_to?(:to_ary) # multi-line
946
- first_line = Autoproj.color(doc[0], :bold)
947
+ first_line = doc[0]
947
948
  remaining = doc[1..-1]
948
- if !remaining.empty?
949
+ if remaining.empty?
950
+ first_line
951
+ else
949
952
  remaining = remaining.join("\n").split("\n").join("\n ")
950
- first_line + "\n " + remaining
953
+ Autoproj.color(first_line, :bold) + "\n " + remaining
951
954
  end
952
955
  else
953
956
  doc
@@ -1096,6 +1099,195 @@ module Autoproj
1096
1099
  end
1097
1100
 
1098
1101
 
1102
+ module Autoproj
1103
+ class UserError < RuntimeError; end
1104
+
1105
+ # Returns true if +path+ is part of an autoproj installation
1106
+ def self.in_autoproj_installation?(path)
1107
+ root_dir(File.expand_path(path))
1108
+ true
1109
+ rescue UserError
1110
+ false
1111
+ end
1112
+
1113
+ # Returns the root directory of the current autoproj installation.
1114
+ #
1115
+ # If the current directory is not in an autoproj installation,
1116
+ # raises UserError.
1117
+ def self.root_dir(dir = Dir.pwd)
1118
+ while dir != "/" && !File.directory?(File.join(dir, "autoproj"))
1119
+ dir = File.dirname(dir)
1120
+ end
1121
+ if dir == "/"
1122
+ raise UserError, "not in a Autoproj installation"
1123
+ end
1124
+ dir
1125
+ end
1126
+
1127
+ # Returns the configuration directory for this autoproj installation.
1128
+ #
1129
+ # If the current directory is not in an autoproj installation,
1130
+ # raises UserError.
1131
+ def self.config_dir
1132
+ File.join(root_dir, "autoproj")
1133
+ end
1134
+
1135
+ class << self
1136
+ # The directory in which packages will be installed.
1137
+ #
1138
+ # If it is a relative path, it is relative to the root dir of the
1139
+ # installation.
1140
+ #
1141
+ # The default is "install"
1142
+ attr_reader :prefix
1143
+
1144
+ # Change the value of 'prefix'
1145
+ def prefix=(new_path)
1146
+ @prefix = new_path
1147
+ Autoproj.change_option('prefix', new_path, true)
1148
+ end
1149
+ end
1150
+ @prefix = "install"
1151
+
1152
+ # Returns the build directory (prefix) for this autoproj installation.
1153
+ #
1154
+ # If the current directory is not in an autoproj installation, raises
1155
+ # UserError.
1156
+ def self.build_dir
1157
+ File.expand_path(Autoproj.prefix, root_dir)
1158
+ end
1159
+
1160
+ # Returns the path to the provided configuration file.
1161
+ #
1162
+ # If the current directory is not in an autoproj installation, raises
1163
+ # UserError.
1164
+ def self.config_file(file)
1165
+ File.join(config_dir, file)
1166
+ end
1167
+
1168
+ # Run the provided command as user
1169
+ def self.run_as_user(*args)
1170
+ if !system(*args)
1171
+ raise "failed to run #{args.join(" ")}"
1172
+ end
1173
+ end
1174
+
1175
+ # Run the provided command as root, using sudo to gain root access
1176
+ def self.run_as_root(*args)
1177
+ if !system('sudo', *args)
1178
+ raise "failed to run #{args.join(" ")} as root"
1179
+ end
1180
+ end
1181
+
1182
+ # Return the directory in which remote package set definition should be
1183
+ # checked out
1184
+ def self.remotes_dir
1185
+ File.join(root_dir, ".remotes")
1186
+ end
1187
+
1188
+ # Return the directory in which RubyGems package should be installed
1189
+ def self.gem_home
1190
+ ENV['AUTOPROJ_GEM_HOME'] || File.join(root_dir, ".gems")
1191
+ end
1192
+
1193
+ # Find the given program in PATH. It raises ArgumentError if the program
1194
+ # can't be found
1195
+ def self.find_in_path(name)
1196
+ result = ENV['PATH'].split(':').find { |dir| File.file?(File.join(dir, name)) }
1197
+ if !result
1198
+ raise ArgumentError, "#{name} can not be found in PATH"
1199
+ end
1200
+ File.join(result, name)
1201
+ end
1202
+
1203
+ # Initializes the environment variables to a "sane default"
1204
+ #
1205
+ # Use this in autoproj/init.rb to make sure that the environment will not
1206
+ # get polluted during the build.
1207
+ def self.set_initial_env
1208
+ Autoproj.env_set 'RUBYOPT', "-rubygems"
1209
+ Autoproj.env_set 'GEM_HOME', Autoproj.gem_home
1210
+ Autoproj.env_set_path 'PATH', "#{Autoproj.gem_home}/bin", "/usr/local/bin", "/usr/bin", "/bin"
1211
+ Autoproj.env_set 'PKG_CONFIG_PATH'
1212
+ Autoproj.env_set 'RUBYLIB'
1213
+ Autoproj.env_set 'LD_LIBRARY_PATH'
1214
+ end
1215
+
1216
+ # Create the env.sh script in +subdir+. In general, +subdir+ should be nil.
1217
+ def self.export_env_sh(subdir = nil)
1218
+ filename = if subdir
1219
+ File.join(Autoproj.root_dir, subdir, "env.sh")
1220
+ else
1221
+ File.join(Autoproj.root_dir, "env.sh")
1222
+ end
1223
+
1224
+ File.open(filename, "w") do |io|
1225
+ variables = []
1226
+ Autobuild.environment.each do |name, value|
1227
+ variables << name
1228
+ shell_line = "#{name}=#{value.join(":")}"
1229
+ if Autoproj.env_inherit?(name)
1230
+ if value.empty?
1231
+ next
1232
+ else
1233
+ shell_line << ":$#{name}"
1234
+ end
1235
+ end
1236
+ io.puts shell_line
1237
+ end
1238
+ variables.each do |var|
1239
+ io.puts "export #{var}"
1240
+ end
1241
+ end
1242
+ end
1243
+
1244
+ # Load a definition file given at +path+. +source+ is the package set from
1245
+ # which the file is taken.
1246
+ #
1247
+ # If any error is detected, the backtrace will be filtered so that it is
1248
+ # easier to understand by the user. Moreover, if +source+ is non-nil, the
1249
+ # package set name will be mentionned.
1250
+ def self.load(source, *path)
1251
+ path = File.join(*path)
1252
+ Kernel.load path
1253
+ rescue Interrupt
1254
+ raise
1255
+ rescue Exception => e
1256
+ Autoproj.filter_load_exception(e, source, path)
1257
+ end
1258
+
1259
+ # Same as #load, but runs only if the file exists.
1260
+ def self.load_if_present(source, *path)
1261
+ path = File.join(*path)
1262
+ if File.file?(path)
1263
+ self.load(source, *path)
1264
+ end
1265
+ end
1266
+
1267
+ # Look into +dir+, searching for shared libraries. For each library, display
1268
+ # a warning message if this library has undefined symbols.
1269
+ def self.validate_solib_dependencies(dir, exclude_paths = [])
1270
+ Find.find(File.expand_path(dir)) do |name|
1271
+ next unless name =~ /\.so$/
1272
+ next if exclude_paths.find { |p| name =~ p }
1273
+
1274
+ output = `ldd -r #{name} 2>&1`
1275
+ if output =~ /undefined symbol/
1276
+ Autoproj.progress(" WARN: #{name} has undefined symbols", :magenta)
1277
+ end
1278
+ end
1279
+ end
1280
+ end
1281
+
1282
+
1283
+
1284
+ # Override Autoproj.root_dir
1285
+ module Autoproj
1286
+ def self.root_dir
1287
+ @root_dir
1288
+ end
1289
+ @root_dir = Dir.pwd
1290
+ end
1099
1291
 
1100
1292
  DEFS = <<EODEFS
1101
1293
  ---
@@ -1145,11 +1337,7 @@ ruby18:
1145
1337
  - libopenssl-ruby1.8
1146
1338
  ruby19:
1147
1339
  debian:
1148
- squeeze,sid:
1149
- - ruby1.9.1
1150
- - ruby1.9.1-dev
1151
- - rubygems1.9.1
1152
- stable:
1340
+ stable,squeeze,sid:
1153
1341
  - ruby1.9.1
1154
1342
  - ruby1.9.1-dev
1155
1343
  - rubygems1.9.1
@@ -1184,7 +1372,8 @@ rdoc: gem
1184
1372
  EODEFS
1185
1373
 
1186
1374
  Autoproj::OSDependencies.define_osdeps_mode_option
1187
- ENV['AUTOPROJ_OSDEPS_MODE'] = Autoproj::OSDependencies.osdeps_mode
1375
+ osdeps_mode = Autoproj::OSDependencies.osdeps_mode
1376
+ ENV['AUTOPROJ_OSDEPS_MODE'] = osdeps_mode
1188
1377
 
1189
1378
  # First thing we do is install a proper ruby environment. We make sure that we
1190
1379
  # aren't installing any gems for now (as we need to choose the right gem
@@ -1192,8 +1381,10 @@ ENV['AUTOPROJ_OSDEPS_MODE'] = Autoproj::OSDependencies.osdeps_mode
1192
1381
  Autobuild.programs['gem'] = nil
1193
1382
  Autoproj::OSDependencies.autodetect_ruby
1194
1383
 
1384
+ osdeps_management = Autoproj::OSDependencies.new(YAML.load(DEFS))
1385
+ osdeps_management.silent = false
1386
+
1195
1387
  begin
1196
- osdeps_management = Autoproj::OSDependencies.new(YAML.load(DEFS))
1197
1388
  STDERR.puts "autoproj: installing a proper Ruby environment (this can take a long time)"
1198
1389
  osdeps_management.install(['ruby'])
1199
1390
  rescue Autoproj::ConfigError => e
@@ -1207,7 +1398,6 @@ PACKAGES = %w{rdoc autobuild libxml2 libxslt zlib build-essential lsb_relea
1207
1398
  ENV['RUBYOPT'] = "-rubygems"
1208
1399
  require 'rubygems'
1209
1400
 
1210
- osdeps_management = Autoproj::OSDependencies.new(YAML.load(DEFS))
1211
1401
  STDERR.puts "autoproj: installing autoproj and its dependencies (this can take a long time)"
1212
1402
  # First install the dependencies of autoproj, as we don't want them to be
1213
1403
  # affected by the prerelease flag
@@ -640,6 +640,7 @@ with the corresponding option (--all, --ruby, --os or --none).
640
640
 
641
641
  if mode
642
642
  @osdeps_mode = mode
643
+ Autoproj.change_option('osdeps_mode', mode_name, true)
643
644
  return mode
644
645
  end
645
646
 
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.6.2.rc3"
2
+ VERSION = "1.6.2.rc4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- hash: 977940580
4
+ hash: 977940581
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
9
  - 2
10
- - rc3
11
- version: 1.6.2.rc3
10
+ - rc4
11
+ version: 1.6.2.rc4
12
12
  platform: ruby
13
13
  authors:
14
14
  - Sylvain Joyeux