autoproj 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,13 @@
1
+ = Version 1.4.2
2
+ * change the order in which package sets are considered for version control
3
+ information in the manifest. The package set list needs now to be defined
4
+ from the most generic to the least generic
5
+ * define a shell script called 'ruby' in prefix/bin to call the right ruby
6
+ interpreter. This makes the "#! /usr/bin/env ruby" she-bang line working
7
+ on interpreters that are not called 'ruby'.
8
+ * the package directories (prefix, srcdir, builddir, ...) can be used by other
9
+ packages for their configuration now.
10
+
1
11
  = Version 1.4.1
2
12
  * add the envsh build mode: only update env.sh
3
13
  * rebuild <package> and force-build <package> only apply by default on the
@@ -469,6 +469,7 @@ report(debug) do
469
469
  raise ConfigError, "RubyGems is already loaded with a different GEM_HOME, make sure you are loading the right env.sh script !"
470
470
  end
471
471
  end
472
+
472
473
  # Set up some important autobuild parameters
473
474
  Autoproj.env_inherit 'PATH', 'PKG_CONFIG_PATH', 'RUBYLIB', 'LD_LIBRARY_PATH'
474
475
  Autoproj.env_set 'GEM_HOME', Autoproj.gem_home
@@ -481,6 +482,20 @@ report(debug) do
481
482
  Autobuild::Reporting << Autobuild::MailReporter.new(mail_config)
482
483
  end
483
484
 
485
+
486
+ ruby = RbConfig::CONFIG['RUBY_INSTALL_NAME']
487
+ if ruby != 'ruby'
488
+ bindir = File.join(Autoproj.build_dir, 'bin')
489
+ FileUtils.mkdir_p bindir
490
+ File.open(File.join(bindir, 'ruby'), 'w') do |io|
491
+ io.puts "#! /bin/sh"
492
+ io.puts "exec #{ruby} \"$@\""
493
+ end
494
+ FileUtils.chmod 0755, File.join(bindir, 'ruby')
495
+
496
+ Autoproj.env_add 'PATH', bindir
497
+ end
498
+
484
499
  # First things first, see if we need to update ourselves
485
500
  osdeps = Autoproj::OSDependencies.load_default
486
501
  if osdeps.install(%w{autobuild autoproj})
@@ -556,8 +571,8 @@ report(debug) do
556
571
  if Autoproj.verbose
557
572
  # List defined packages, and in which autobuild files they are defined
558
573
  STDERR.puts "Available packages:"
559
- manifest.packages.each_value do |package, source, file|
560
- STDERR.puts " #{package.name}: #{file} from #{source.name}"
574
+ manifest.packages.each_value do |pkg|
575
+ STDERR.puts " #{pkg.autobuild.name}: #{pkg.file} from #{pkg.package_set.name}"
561
576
  end
562
577
  end
563
578
 
@@ -656,6 +671,14 @@ report(debug) do
656
671
  seen |= packages
657
672
  end
658
673
 
674
+ # Now call the blocks that the user defined in the autobuild files. We do it
675
+ # now so that the various package directories are properly setup
676
+ manifest.packages.each_value do |pkg|
677
+ if pkg.user_block
678
+ pkg.user_block[pkg.autobuild]
679
+ end
680
+ end
681
+
659
682
  if only_do_status
660
683
  STDERR.puts
661
684
  all_packages = Set.new
@@ -18,9 +18,8 @@ version_control:
18
18
  Autoproj follows the following rules to find the importer definition for a given
19
19
  package:
20
20
 
21
- - it looks *in order* in the package sets listed in the manifest file, and will
22
- take the definition from the *first* package set that has a definition for
23
- the package.
21
+ - it looks *in reverse order* in the package sets listed in the manifest file,
22
+ and will take the definition from the *first* package set that has one.
24
23
  - in the source.yml file, it will match the package's name with the
25
24
  package\_name fields. It will consider every matching block (i.e. every
26
25
  package\_name that matches), overriding earlier options by later ones.
@@ -29,19 +28,19 @@ As an example, let's consider the following manifest:
29
28
 
30
29
  {coderay:: ruby}
31
30
  package_sets:
32
- - rubim.drivers
33
- - rubim.orocos
34
31
  - rubim.base
32
+ - rubim.orocos
33
+ - rubim.drivers
35
34
  {coderay}
36
35
 
37
36
  Now, let's assume that the rubim.orocos package set has a source.yml file with:
38
37
 
39
38
  {coderay:: ruby}
40
39
  version_control:
41
- orocos/:
40
+ - orocos/:
42
41
  type: git
43
42
  url: git://github.com/$PACKAGE.git
44
- orocos/orocos.rb:
43
+ - orocos/orocos.rb:
45
44
  branch: roby
46
45
  {coderay}
47
46
 
@@ -49,7 +48,7 @@ Finally, the rubim.drivers package set has:
49
48
 
50
49
  {coderay:: ruby}
51
50
  version_control:
52
- orocos/logger:
51
+ - orocos/logger:
53
52
  type: git
54
53
  url: git://github.com/$PACKAGE.git
55
54
  branch: perf
@@ -46,8 +46,9 @@ module Autoproj
46
46
  end
47
47
 
48
48
  def self.define(package_type, spec, &block)
49
- package = Autobuild.send(package_type, spec, &block)
50
- Autoproj.manifest.register_package package, *current_file
49
+ package = Autobuild.send(package_type, spec)
50
+ Autoproj.manifest.register_package package, block, *current_file
51
+ package
51
52
  end
52
53
 
53
54
  @loaded_autobuild_files = Set.new
@@ -90,7 +91,7 @@ def ruby_doc(pkg, target = 'doc')
90
91
  end
91
92
 
92
93
  # Common setup for packages
93
- def package_common(package_type, spec) # :nodoc:
94
+ def package_common(package_type, spec, &block) # :nodoc:
94
95
  package_name = Autoproj.package_name_from_options(spec)
95
96
 
96
97
  begin
@@ -105,10 +106,9 @@ def package_common(package_type, spec) # :nodoc:
105
106
  return Autoproj.define(:dummy, spec)
106
107
  end
107
108
 
108
- Autoproj.define(package_type, spec) do |pkg|
109
- pkg.srcdir = pkg.name
110
- yield(pkg) if block_given?
111
- end
109
+ pkg = Autoproj.define(package_type, spec, &block)
110
+ pkg.srcdir = pkg.name
111
+ pkg
112
112
  end
113
113
 
114
114
  def import_package(options, &block)
@@ -420,9 +420,9 @@ module Autoproj
420
420
  return enum_for(:each_package)
421
421
  end
422
422
 
423
- Autoproj.manifest.packages.each do |pkg_name, (pkg, source, file)|
424
- if source.name == name
425
- yield(pkg)
423
+ Autoproj.manifest.packages.each_value do |pkg|
424
+ if pkg.package_set.name == name
425
+ yield(pkg.autobuild)
426
426
  end
427
427
  end
428
428
  end
@@ -455,6 +455,8 @@ module Autoproj
455
455
  end
456
456
  end
457
457
 
458
+ PackageDefinition = Struct.new :autobuild, :user_block, :package_set, :file
459
+
458
460
  class Manifest
459
461
  FakePackage = Struct.new :text_name, :name, :srcdir, :importer
460
462
  class FakePackage
@@ -665,15 +667,15 @@ module Autoproj
665
667
  end
666
668
 
667
669
  # Register a new package
668
- def register_package(package, source, file)
669
- @packages[package.name] = [package, source, file]
670
+ def register_package(package, block, source, file)
671
+ @packages[package.name] = PackageDefinition.new(package, block, source, file)
670
672
  end
671
673
 
672
674
  def definition_source(package_name)
673
- @packages[package_name][1]
675
+ @packages[package_name].package_set
674
676
  end
675
677
  def definition_file(package_name)
676
- @packages[package_name][2]
678
+ @packages[package_name].file
677
679
  end
678
680
 
679
681
  # Lists all defined packages and where they have been defined
@@ -681,7 +683,7 @@ module Autoproj
681
683
  if !block_given?
682
684
  return enum_for(:each_package)
683
685
  end
684
- packages.each_value { |package, _| yield(package) }
686
+ packages.each_value { |pkg| yield(pkg.autobuild) }
685
687
  end
686
688
 
687
689
  # The VCS object for the main configuration itself
@@ -736,10 +738,12 @@ module Autoproj
736
738
 
737
739
  def importer_definition_for(package_name, package_source = nil)
738
740
  if !package_source
739
- _, package_source, _ = packages.values.find { |pkg, pkg_source, _| pkg.name == package_name }
741
+ package_source = packages.values.
742
+ find { |pkg| pkg.autobuild.name == package_name }.
743
+ package_set
740
744
  end
741
745
 
742
- each_source.each do |source|
746
+ each_source.to_a.reverse.each do |source|
743
747
  vcs = source.importer_definition_for(package_name)
744
748
  if vcs
745
749
  return vcs
@@ -767,14 +771,14 @@ module Autoproj
767
771
  # * S0 can have a VCS line for P, which would override the one defined
768
772
  # by S1
769
773
  def load_importers
770
- packages.each_value do |package, package_source, package_source_file|
771
- vcs = importer_definition_for(package.name, package_source)
774
+ packages.each_value do |pkg|
775
+ vcs = importer_definition_for(pkg.autobuild.name, pkg.package_set)
772
776
 
773
777
  if vcs
774
778
  Autoproj.add_build_system_dependency vcs.type
775
- package.importer = vcs.create_autobuild_importer
779
+ pkg.autobuild.importer = vcs.create_autobuild_importer
776
780
  else
777
- raise ConfigError, "source #{package_source.name} defines #{package.name}, but does not provide a version control definition for it"
781
+ raise ConfigError, "source #{pkg.package_set.name} defines #{pkg.autobuild.name}, but does not provide a version control definition for it"
778
782
  end
779
783
  end
780
784
  end
@@ -790,8 +794,9 @@ module Autoproj
790
794
  if !source
791
795
  raise ConfigError, "#{name} is neither a package nor a source"
792
796
  end
793
- packages.values.find_all { |pkg, pkg_src, _| pkg_src.name == source.name }.
794
- map { |pkg, _| pkg.name }
797
+ packages.values.
798
+ map { |pkg| pkg.autobuild.name if pkg.package_set.name == source.name }.
799
+ compact
795
800
  end
796
801
  end
797
802
 
@@ -904,8 +909,9 @@ module Autoproj
904
909
  # Right now, the absence of a manifest makes autoproj only issue a
905
910
  # warning. This will later be changed into an error.
906
911
  def load_package_manifest(pkg_name)
907
- package, source, file = packages.values.
908
- find { |package, source, file| package.name == pkg_name }
912
+ pkg = packages.values.
913
+ find { |pkg| pkg.autobuild.name == pkg_name }
914
+ package, source, file = pkg.autobuild, pkg.package_set, pkg.file
909
915
 
910
916
  if !pkg_name
911
917
  raise ArgumentError, "package #{pkg_name} is not defined"
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-15 00:00:00 +01:00
12
+ date: 2010-03-02 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency