autoproj 1.7.21.b7 → 1.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -262,6 +262,26 @@ fi
262
262
  end
263
263
  end
264
264
 
265
+ # Package manager interface for systems that use pacman (i.e. arch) as
266
+ # their package manager
267
+ class PacmanManager < ShellScriptManager
268
+ def initialize
269
+ super(['pacman'], true,
270
+ "pacman '%s'",
271
+ "pacman -Sy --noconfirm '%s'")
272
+ end
273
+ end
274
+
275
+ # Package manager interface for systems that use emerge (i.e. gentoo) as
276
+ # their package manager
277
+ class EmergeManager < ShellScriptManager
278
+ def initialize
279
+ super(['emerge'], true,
280
+ "emerge '%s'",
281
+ "emerge --noreplace '%s'")
282
+ end
283
+ end
284
+
265
285
  # Package manager interface for systems that use APT and dpkg for
266
286
  # package management
267
287
  class AptDpkgManager < ShellScriptManager
@@ -491,7 +511,11 @@ fi
491
511
 
492
512
  candidates = [file]
493
513
  candidates.concat(suffixes.map { |s| "#{file}-#{s}" })
494
-
514
+
515
+ error_t = if defined? Psych::SyntaxError then [ArgumentError, Psych::SyntaxError]
516
+ else ArgumentError
517
+ end
518
+
495
519
  result = OSDependencies.new
496
520
  candidates.each do |file|
497
521
  next if !File.file?(file)
@@ -499,7 +523,7 @@ fi
499
523
  begin
500
524
  data = YAML.load(File.read(file)) || Hash.new
501
525
  verify_definitions(data)
502
- rescue ArgumentError => e
526
+ rescue *error_t => e
503
527
  raise ConfigError.new, "error in #{file}: #{e.message}", e.backtrace
504
528
  end
505
529
 
@@ -543,9 +567,14 @@ fi
543
567
  OSDependencies.load(file)
544
568
  end
545
569
 
546
- PACKAGE_HANDLERS = [PackageManagers::AptDpkgManager, PackageManagers::GemManager]
570
+ PACKAGE_HANDLERS = [PackageManagers::AptDpkgManager,
571
+ PackageManagers::GemManager,
572
+ PackageManagers::EmergeManager,
573
+ PackageManagers::PacmanManager]
547
574
  OS_PACKAGE_HANDLERS = {
548
- 'debian' => 'apt-dpkg'
575
+ 'debian' => 'apt-dpkg',
576
+ 'gentoo' => 'emerge',
577
+ 'arch' => 'pacman'
549
578
  }
550
579
 
551
580
  # The information contained in the OSdeps files, as a hash
@@ -261,15 +261,47 @@ module Autoproj
261
261
  @loaded_autobuild_files << path
262
262
  end
263
263
 
264
+ def self.find_topmost_directory_containing(dir, glob_pattern = nil)
265
+ result = nil
266
+ while dir != "/"
267
+ match = false
268
+ if glob_pattern
269
+ if !Dir.glob(File.join(dir, glob_pattern)).empty?
270
+ match = true
271
+ end
272
+ end
273
+
274
+ if !match && block_given? && yield(dir)
275
+ match = true
276
+ end
277
+ if !match && result
278
+ return result
279
+ elsif match
280
+ result = dir
281
+ end
282
+
283
+ dir = File.dirname(dir)
284
+ end
285
+ end
286
+
264
287
  # Tries to find a handler automatically for 'full_path'
265
288
  def self.package_handler_for(full_path)
266
289
  if !Dir.enum_for(:glob, File.join(full_path, "*.orogen")).to_a.empty?
267
290
  "orogen_package"
268
291
  elsif File.file?(File.join(full_path, "CMakeLists.txt"))
269
- "cmake_package"
270
- elsif File.directory?(File.join(full_path, "lib")) &&
271
- Find.enum_for(:find, File.join(full_path, "lib")).any? { |path| path =~ /\.rb$/ }
272
- "ruby_package"
292
+ dir = find_topmost_directory_containing(full_path) do |dir|
293
+ cmakelists = File.join(dir, 'CMakeLists.txt')
294
+ File.file?(cmakelists) &&
295
+ (File.read(cmakelists) =~ /PROJECT/i)
296
+ end
297
+ dir ||= find_topmost_directory_containing(full_path, 'CMakeLists.txt')
298
+
299
+ return "cmake_package", dir
300
+ elsif !Dir.glob('*.rb').empty?
301
+ dir = find_topmost_directory_containing(full_path, "Rakefile") ||
302
+ find_topmost_directory_containing(full_path, "lib/*.rb")
303
+
304
+ return "ruby_package", dir
273
305
  end
274
306
  end
275
307
  end
@@ -215,7 +215,8 @@ module Autoproj
215
215
  full_path = File.expand_path(File.join(Autoproj.root_dir, layout_level, pkg_or_set))
216
216
  next if !File.directory?(full_path)
217
217
 
218
- if handler = Autoproj.package_handler_for(full_path)
218
+ handler, srcdir = Autoproj.package_handler_for(full_path)
219
+ if handler
219
220
  Autoproj.message " auto-adding #{pkg_or_set} #{"in #{layout_level} " if layout_level != "/"}using the #{handler.gsub(/_package/, '')} package handler"
220
221
  Autoproj.in_package_set(manifest.local_package_set, manifest.file) do
221
222
  send(handler, pkg_or_set)
@@ -497,10 +498,11 @@ module Autoproj
497
498
  nonresolved.delete_if do |sel|
498
499
  next if !File.directory?(sel)
499
500
  while sel != '/'
500
- if handler = Autoproj.package_handler_for(sel)
501
- Autoproj.message " auto-adding #{sel} using the #{handler.gsub(/_package/, '')} package handler"
502
- sel = File.expand_path(sel)
503
- relative_to_root = Pathname.new(sel).relative_path_from(Pathname.new(Autoproj.root_dir))
501
+ handler, srcdir = Autoproj.package_handler_for(sel)
502
+ if handler
503
+ Autoproj.message " auto-adding #{srcdir} using the #{handler.gsub(/_package/, '')} package handler"
504
+ srcdir = File.expand_path(srcdir)
505
+ relative_to_root = Pathname.new(srcdir).relative_path_from(Pathname.new(Autoproj.root_dir))
504
506
  pkg = Autoproj.in_package_set(manifest.local_package_set, manifest.file) do
505
507
  send(handler, relative_to_root.to_s)
506
508
  end
@@ -885,6 +887,9 @@ where 'mode' is one of:
885
887
  opts.on('--stats', 'displays statistics about each of the phases in the package building process') do
886
888
  @show_statistics = true
887
889
  end
890
+ opts.on('-p LEVEL', '--parallel=LEVEL', Integer, "override the Autobuild.parallel_build_level level") do |value|
891
+ Autobuild.parallel_build_level = value
892
+ end
888
893
 
889
894
  opts.on("--with-depends", "apply rebuild and force-build to both packages selected on the command line and their dependencies") do
890
895
  force_re_build_with_depends = true
@@ -75,8 +75,8 @@ cmake:
75
75
  arch: cmake
76
76
 
77
77
  autotools:
78
- debian,ubuntu: [automake1.9, autoconf]
79
- gentoo: [sys-devel/automake:1.9, sys-devel/autoconf]
78
+ debian,ubuntu: ["automake1.9", autoconf]
79
+ gentoo: ["sys-devel/automake:1.9", sys-devel/autoconf]
80
80
  arch: automake autoconf
81
81
 
82
82
  lsb_release:
@@ -163,6 +163,26 @@ fi
163
163
  end
164
164
  end
165
165
 
166
+ # Package manager interface for systems that use pacman (i.e. arch) as
167
+ # their package manager
168
+ class PacmanManager < ShellScriptManager
169
+ def initialize
170
+ super(['pacman'], true,
171
+ "pacman '%s'",
172
+ "pacman -Sy --noconfirm '%s'")
173
+ end
174
+ end
175
+
176
+ # Package manager interface for systems that use emerge (i.e. gentoo) as
177
+ # their package manager
178
+ class EmergeManager < ShellScriptManager
179
+ def initialize
180
+ super(['emerge'], true,
181
+ "emerge '%s'",
182
+ "emerge --noreplace '%s'")
183
+ end
184
+ end
185
+
166
186
  # Package manager interface for systems that use APT and dpkg for
167
187
  # package management
168
188
  class AptDpkgManager < ShellScriptManager
@@ -392,7 +412,11 @@ fi
392
412
 
393
413
  candidates = [file]
394
414
  candidates.concat(suffixes.map { |s| "#{file}-#{s}" })
395
-
415
+
416
+ error_t = if defined? Psych::SyntaxError then [ArgumentError, Psych::SyntaxError]
417
+ else ArgumentError
418
+ end
419
+
396
420
  result = OSDependencies.new
397
421
  candidates.each do |file|
398
422
  next if !File.file?(file)
@@ -400,7 +424,7 @@ fi
400
424
  begin
401
425
  data = YAML.load(File.read(file)) || Hash.new
402
426
  verify_definitions(data)
403
- rescue ArgumentError => e
427
+ rescue *error_t => e
404
428
  raise ConfigError.new, "error in #{file}: #{e.message}", e.backtrace
405
429
  end
406
430
 
@@ -444,9 +468,14 @@ fi
444
468
  OSDependencies.load(file)
445
469
  end
446
470
 
447
- PACKAGE_HANDLERS = [PackageManagers::AptDpkgManager, PackageManagers::GemManager]
471
+ PACKAGE_HANDLERS = [PackageManagers::AptDpkgManager,
472
+ PackageManagers::GemManager,
473
+ PackageManagers::EmergeManager,
474
+ PackageManagers::PacmanManager]
448
475
  OS_PACKAGE_HANDLERS = {
449
- 'debian' => 'apt-dpkg'
476
+ 'debian' => 'apt-dpkg',
477
+ 'gentoo' => 'emerge',
478
+ 'arch' => 'pacman'
450
479
  }
451
480
 
452
481
  # The information contained in the OSdeps files, as a hash
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.7.21.b7"
2
+ VERSION = "1.8.0.rc1"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- hash: 129
5
- prerelease: 7
4
+ hash: 15424183
5
+ prerelease: 6
6
6
  segments:
7
7
  - 1
8
- - 7
9
- - 21
10
- - b
11
- - 7
12
- version: 1.7.21.b7
8
+ - 8
9
+ - 0
10
+ - rc
11
+ - 1
12
+ version: 1.8.0.rc1
13
13
  platform: ruby
14
14
  authors:
15
15
  - Sylvain Joyeux
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-04-03 00:00:00 Z
20
+ date: 2012-04-11 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: autobuild