autoproj 1.7.3.b1 → 1.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,28 @@
1
+ = Version 1.7.3
2
+ == For basic usage
3
+ * amake is a command that is a shortcut to "autoproj build". I.e.
4
+ amake .
5
+ will build the package in the current directory and all its dependencies
6
+ * added tag support. The manifest and the autobuild files allow to add textual
7
+ tags to packages, that will be picked up by documentation later on. Moreover,
8
+ some tags can be used to tune the build. For instance, rock uses the 'stable'
9
+ tag to set the CMAKE_BUILD_TYPE variable on cmake packages to either Debug
10
+ (non-stable) or RelWithDebInfo (stable).
11
+
12
+ == For advanced usage
13
+ * support ignoring/excluding OS packages
14
+ * define Package#post_import which allows to run a code block after the package
15
+ has been imported, but before the build. The global
16
+ Autoproj.post_import do |pkg|
17
+ end
18
+ allows to do it for all defined packages.
19
+ * define Package#remove_obsolete_installed_file(*path) which allows to remove
20
+ files from the installation directory. Useful for simple upgrade cases, when
21
+ files move from one package to another
22
+ * in source.yml, a package name is interpreted as a regular expression only if
23
+ it contains non-alphanumeric characters. This avoids some surprising effects
24
+ if the name of package BlaBla is a subset of the package BlaBlaBlo
25
+
1
26
  = Version 1.7.2
2
27
  == Quickfix release
3
28
  * fix layouts that use subdirectories
@@ -38,6 +38,12 @@ if candidates.empty?
38
38
  join("/")
39
39
  rx = Regexp.new(rx)
40
40
 
41
+ rx_strict = directories[0..-2].
42
+ map { |d| "#{Regexp.quote(d)}\\w*" }.
43
+ join("/")
44
+ rx_strict = Regexp.new("#{rx_strict}/#{Regexp.quote(directories.last)}$")
45
+
46
+ candidates_strict = []
41
47
  Autoproj.manifest.each_package do |pkg|
42
48
  name = pkg.name
43
49
  next if !Autoproj.manifest.package_enabled?(name)
@@ -46,8 +52,14 @@ if candidates.empty?
46
52
  if name =~ rx
47
53
  candidates << srcdir
48
54
  end
55
+ if name =~ rx_strict
56
+ candidates_strict << srcdir
57
+ end
49
58
  end
50
59
 
60
+ if candidates.size > 1 && candidates_strict.size == 1
61
+ candidates = candidates_strict
62
+ end
51
63
  end
52
64
 
53
65
  if candidates.empty?
@@ -30,6 +30,48 @@ module Autobuild
30
30
  class Package
31
31
  # The Autoproj::PackageManifest object that describes this package
32
32
  attr_accessor :description
33
+ # The set of tags for this package. This is an union of the tags
34
+ # contained in +description+ and the ones explicitely added with
35
+ # #add_tag
36
+ def tags
37
+ result = (@added_tags || Set.new)
38
+ if description
39
+ result |= description.tags.to_set
40
+ end
41
+ result
42
+ end
43
+ # Tags explicitely added with #add_tag
44
+ attr_reader :added_tags
45
+ # Add a tag to the package. Use this if you don't want the tag to be
46
+ # shared with everyone that uses the package (i.e. cannot go in
47
+ # manifest.xml)
48
+ def add_tag(tag)
49
+ @added_tags ||= Set.new
50
+ @added_tags << tag
51
+ end
52
+
53
+ # True if this package is tagged with the given tag string
54
+ def has_tag?(tag)
55
+ tags.include?(tag.to_s)
56
+ end
57
+
58
+ # Asks autoproj to remove the given file in the package's installation
59
+ # prefix
60
+ def remove_obsolete_installed_file(*path)
61
+ post_import do
62
+ path = File.join(prefix, *path)
63
+ if File.exists?(path)
64
+ Autoproj.progress " removing obsolete file #{path}", :bold
65
+ FileUtils.rm_f path
66
+ end
67
+ end
68
+ end
69
+
70
+ # Ask autoproj to run the given block after this package has been
71
+ # imported
72
+ def post_import(&block)
73
+ Autoproj.post_import(self, &block)
74
+ end
33
75
 
34
76
  def autoproj_name # :nodoc:
35
77
  srcdir.gsub /^#{Regexp.quote(Autoproj.root_dir)}\//, ''
@@ -23,6 +23,27 @@ module Autoproj
23
23
  raise e
24
24
  end
25
25
  end
26
- end
27
26
 
27
+ @post_import_blocks = Hash.new { |h, k| h[k] = Array.new }
28
+ class << self
29
+ attr_reader :post_import_blocks
30
+ end
31
+
32
+ def self.each_post_import_block(pkg, &block)
33
+ @post_import_blocks[nil].each(&block)
34
+ if @post_import_blocks.has_key?(pkg)
35
+ @post_import_blocks[pkg].each(&block)
36
+ end
37
+ end
38
+
39
+ def self.post_import(*packages, &block)
40
+ if packages.empty?
41
+ @post_import_blocks[nil] << block
42
+ else
43
+ packages.each do |pkg|
44
+ @post_import_blocks[pkg] << block
45
+ end
46
+ end
47
+ end
48
+ end
28
49
 
@@ -373,9 +373,15 @@ module Autoproj
373
373
  manifest.resolve_optional_dependencies
374
374
  end
375
375
 
376
- pkg_manifest = manifest.package_manifests[pkg.name];
376
+ pkg_manifest = pkg.description
377
377
  vcs_def = manifest.importer_definition_for(pkg.name)
378
378
  Autoproj.progress "#{pkg.name}#{": #{pkg_manifest.short_documentation}" if pkg_manifest && pkg_manifest.short_documentation}", :bold
379
+ tags = pkg.tags.to_a
380
+ if tags.empty?
381
+ Autoproj.progress " no tags"
382
+ else
383
+ Autoproj.progress " tags: #{pkg.tags.to_a.sort.join(", ")}"
384
+ end
379
385
  Autoproj.progress " defined in #{pkg_set}"
380
386
  if File.directory?(pkg.srcdir)
381
387
  Autoproj.progress " checked out in #{pkg.srcdir}"
@@ -531,6 +537,10 @@ module Autoproj
531
537
 
532
538
  current_packages.each do |pkg|
533
539
  verify_package_availability(pkg.name)
540
+ Autoproj.each_post_import_block(pkg) do |block|
541
+ block.call(pkg)
542
+ end
543
+
534
544
  pkg.prepare
535
545
  Rake::Task["#{pkg.name}-prepare"].instance_variable_set(:@already_invoked, true)
536
546
 
@@ -551,7 +561,12 @@ module Autoproj
551
561
 
552
562
  packages.each do |_, pkg|
553
563
  pkg.isolate_errors do
564
+ manifest.load_package_manifest(pkg.name)
554
565
  pkg.prepare
566
+
567
+ Autoproj.each_post_import_block(pkg) do |block|
568
+ block.call(pkg)
569
+ end
555
570
  end
556
571
  end
557
572
 
@@ -559,7 +574,6 @@ module Autoproj
559
574
  Autobuild.do_update = old_update_flag
560
575
  end
561
576
 
562
-
563
577
  if Autoproj.verbose
564
578
  Autoproj.progress "autoproj: finished importing packages"
565
579
  end
@@ -573,7 +573,11 @@ module Autoproj
573
573
  end
574
574
  end
575
575
 
576
- if Regexp.new("^" + name) =~ package_name
576
+ name_match = name
577
+ if name_match =~ /[^\w\/_-]/
578
+ name_match = Regexp.new("^" + name_match)
579
+ end
580
+ if name_match === package_name
577
581
  vcs_spec = vcs_spec.merge(spec)
578
582
  end
579
583
  end
@@ -690,9 +694,7 @@ module Autoproj
690
694
  #
691
695
  # It has to match the interface of Autobuild::Package that is relevant
692
696
  # for importers
693
- class FakePackage
694
- attr_reader :text_name
695
- attr_reader :name
697
+ class FakePackage < Autobuild::Package
696
698
  attr_reader :srcdir
697
699
  attr_reader :importer
698
700
 
@@ -700,28 +702,17 @@ module Autoproj
700
702
  attr_accessor :updated
701
703
 
702
704
  def initialize(text_name, srcdir, importer = nil)
703
- @text_name = text_name
704
- @name = text_name.gsub /[^\w]/, '_'
705
+ super(text_name)
705
706
  @srcdir = srcdir
706
707
  @importer = importer
708
+ @@packages.delete(text_name)
707
709
  end
708
710
 
709
711
  def import
710
712
  importer.import(self)
711
713
  end
712
714
 
713
- def progress(msg)
714
- Autobuild.progress(msg % [text_name])
715
- end
716
-
717
- # Display a progress message, and later on update it with a progress
718
- # value. %s in the string is replaced by the package name
719
- def progress_with_value(msg)
720
- Autobuild.progress_with_value(msg % [text_name])
721
- end
722
-
723
- def progress_value(value)
724
- Autobuild.progress_value(value)
715
+ def add_stat(*args)
725
716
  end
726
717
  end
727
718
 
@@ -1280,14 +1271,16 @@ module Autoproj
1280
1271
  # If recursive is false, yields only the packages at this level.
1281
1272
  # Otherwise, return all packages.
1282
1273
  def layout_packages(result, validate)
1283
- normalized_layout.each_key do |pkg_or_set|
1284
- begin
1285
- resolve_package_set(pkg_or_set).each do |pkg_name|
1286
- result << pkg_name
1287
- Autobuild::Package[pkg_name].all_dependencies(result)
1274
+ Autoproj.in_file(self.file) do
1275
+ normalized_layout.each_key do |pkg_or_set|
1276
+ begin
1277
+ resolve_package_set(pkg_or_set).each do |pkg_name|
1278
+ result << pkg_name
1279
+ Autobuild::Package[pkg_name].all_dependencies(result)
1280
+ end
1281
+ rescue ConfigError
1282
+ raise if validate
1288
1283
  end
1289
- rescue ConfigError
1290
- raise if validate
1291
1284
  end
1292
1285
  end
1293
1286
  result
@@ -1484,6 +1477,17 @@ module Autoproj
1484
1477
  # Installs the OS dependencies that are required by the given packages
1485
1478
  def install_os_dependencies(packages)
1486
1479
  required_os_packages, package_os_deps = list_os_dependencies(packages)
1480
+ required_os_packages.delete_if do |pkg|
1481
+ if excluded?(pkg)
1482
+ raise ConfigError.new, "the osdeps package #{pkg} is excluded from the build in #{file}. It is required by #{package_os_deps[pkg].join(", ")}"
1483
+ end
1484
+ if ignored?(pkg)
1485
+ if Autoproj.verbose
1486
+ Autoproj.progress "ignoring osdeps package #{pkg}"
1487
+ end
1488
+ true
1489
+ end
1490
+ end
1487
1491
  Autoproj.osdeps.install(required_os_packages, package_os_deps)
1488
1492
  end
1489
1493
 
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.7.3.b1"
2
+ VERSION = "1.7.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- hash: 6629755
5
- prerelease: true
4
+ hash: 13
5
+ prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
9
  - 3
10
- - b1
11
- version: 1.7.3.b1
10
+ version: 1.7.3
12
11
  platform: ruby
13
12
  authors:
14
13
  - Sylvain Joyeux
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-12-14 00:00:00 +01:00
18
+ date: 2011-01-04 00:00:00 +01:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
@@ -240,14 +239,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
239
  required_rubygems_version: !ruby/object:Gem::Requirement
241
240
  none: false
242
241
  requirements:
243
- - - ">"
242
+ - - ">="
244
243
  - !ruby/object:Gem::Version
245
- hash: 25
244
+ hash: 3
246
245
  segments:
247
- - 1
248
- - 3
249
- - 1
250
- version: 1.3.1
246
+ - 0
247
+ version: "0"
251
248
  requirements: []
252
249
 
253
250
  rubyforge_project: autobuild