autoproj 1.8.5 → 1.9.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -342,11 +342,6 @@ def package_common(package_type, spec, &block) # :nodoc:
342
342
  return Autobuild::Package[package_name]
343
343
  end
344
344
 
345
- # Check if this package is ignored
346
- if Autoproj.manifest.ignored?(package_name) || Autoproj.manifest.ignored?(Autoproj.current_file[0].name)
347
- return Autoproj.define(:dummy, spec)
348
- end
349
-
350
345
  pkg = Autoproj.define(package_type, spec, &block)
351
346
  pkg.srcdir = pkg.name
352
347
  pkg
@@ -484,7 +479,7 @@ def ruby_package(options)
484
479
 
485
480
  # Set up code
486
481
  pkg.post_install do
487
- pkg.progress_start "setting up Ruby package %s" do
482
+ pkg.progress_start "setting up Ruby package %s", :done_message => 'set up Ruby package %s' do
488
483
  Autobuild.update_environment pkg.srcdir
489
484
  # Add lib/ unconditionally, as we know that it is a ruby package.
490
485
  # Autobuild will add it only if there is a .rb file in the directory
@@ -507,7 +502,7 @@ def ruby_package(options)
507
502
  # rake_doc_task to nil
508
503
  if !pkg.has_doc? && pkg.rake_doc_task
509
504
  pkg.doc_task do
510
- pkg.progress_start "generating documentation for %s" do
505
+ pkg.progress_start "generating documentation for %s", :done_message => 'generated documentation for %s' do
511
506
  Autobuild::Subprocess.run pkg, 'doc', 'rake', pkg.rake_doc_task, :working_directory => pkg.srcdir
512
507
  end
513
508
  end
@@ -13,6 +13,11 @@ module Autoproj
13
13
  end
14
14
  @verbose = false
15
15
  @console = HighLine.new
16
+ ENV_FILENAME =
17
+ if Autobuild.windows? then "env.bat"
18
+ else "env.sh"
19
+ end
20
+
16
21
 
17
22
  def self.silent(&block)
18
23
  Autobuild.silent(&block)
@@ -49,6 +54,15 @@ module Autoproj
49
54
  Autoproj.loaded_autobuild_files.clear
50
55
  Autoproj.load_config
51
56
 
57
+ ruby_executable = Autoproj.find_in_path(RbConfig::CONFIG['RUBY_INSTALL_NAME'])
58
+ if Autoproj.has_config_key?('ruby_executable')
59
+ expected = Autoproj.user_config('ruby_executable')
60
+ if expected != ruby_executable
61
+ raise ConfigError.new, "this autoproj installation was bootstrapped using #{expected}, but you are currently running under #{ruby_executable}. This is usually caused by calling a wrong gem program (for instance, gem1.8 instead of gem1.9.1)"
62
+ end
63
+ end
64
+ Autoproj.change_option('ruby_executable', ruby_executable, true)
65
+
52
66
  if Autoproj.has_config_key?('autobuild')
53
67
  params = Autoproj.user_config('autobuild')
54
68
  if params.kind_of?(Hash)
@@ -69,13 +83,14 @@ module Autoproj
69
83
  # If we are under rubygems, check that the GEM_HOME is right ...
70
84
  if $LOADED_FEATURES.any? { |l| l =~ /rubygems/ }
71
85
  if ENV['GEM_HOME'] != Autoproj.gem_home
72
- raise ConfigError.new, "RubyGems is already loaded with a different GEM_HOME, make sure you are loading the right env.sh script !"
86
+ raise ConfigError.new, "RubyGems is already loaded with a different GEM_HOME, make sure you are loading the right #{ENV_FILENAME} script !"
73
87
  end
74
88
  end
75
89
 
76
90
  # Set up some important autobuild parameters
77
- Autoproj.env_inherit 'PATH', 'PKG_CONFIG_PATH', 'RUBYLIB', 'LD_LIBRARY_PATH'
91
+ Autoproj.env_inherit 'PATH', 'PKG_CONFIG_PATH', 'RUBYLIB', 'LD_LIBRARY_PATH', 'GEM_PATH', 'CMAKE_PREFIX_PATH', 'PYTHONPATH'
78
92
  Autoproj.env_set 'GEM_HOME', Autoproj.gem_home
93
+ Autoproj.env_add 'GEM_PATH', Autoproj.gem_home
79
94
  Autoproj.env_add 'PATH', File.join(Autoproj.gem_home, 'bin')
80
95
  Autoproj.env_set 'RUBYOPT', "-rubygems"
81
96
  Autobuild.prefix = Autoproj.build_dir
@@ -335,6 +350,11 @@ module Autoproj
335
350
  # Resolve optional dependencies
336
351
  manifest.resolve_optional_dependencies
337
352
 
353
+ # And, finally, disable all ignored packages on the autobuild side
354
+ manifest.each_ignored_package do |pkg_name|
355
+ Autobuild::Package[pkg_name].disable
356
+ end
357
+
338
358
  # Make sure that we have the environment of all selected packages
339
359
  manifest.all_selected_packages.each do |pkg_name|
340
360
  Autobuild::Package[pkg_name].update_environment
@@ -494,7 +514,7 @@ module Autoproj
494
514
 
495
515
  # Returns the set of packages that are actually selected based on what
496
516
  # the user gave on the command line
497
- def self.resolve_user_selection(selected_packages)
517
+ def self.resolve_user_selection(selected_packages, options = Hash.new)
498
518
  manifest = Autoproj.manifest
499
519
 
500
520
  if selected_packages.empty?
@@ -503,7 +523,7 @@ module Autoproj
503
523
  selected_packages = selected_packages.to_set
504
524
 
505
525
  selected_packages, nonresolved = manifest.
506
- expand_package_selection(selected_packages)
526
+ expand_package_selection(selected_packages, options)
507
527
 
508
528
  # Try to auto-add stuff if nonresolved
509
529
  nonresolved.delete_if do |sel|
@@ -526,15 +546,21 @@ module Autoproj
526
546
  end
527
547
  end
528
548
 
529
- if !nonresolved.empty?
530
- Autoproj.message("autoproj: wrong package selection on command line, cannot find a match for #{nonresolved.to_a.join(", ")}", :red)
531
- exit 1
532
- elsif Autoproj.verbose
533
- Autoproj.message "will install #{selected_packages.packages.keys.to_a.sort.join(", ")}"
549
+ if Autoproj.verbose
550
+ Autoproj.message "will install #{selected_packages.packages.to_a.sort.join(", ")}"
534
551
  end
535
552
  selected_packages
536
553
  end
537
554
 
555
+ def self.validate_user_selection(user_selection, resolved_selection)
556
+ not_matched = user_selection.find_all do |pkg_name|
557
+ !resolved_selection.has_match_for?(pkg_name)
558
+ end
559
+ if !not_matched.empty?
560
+ Autoproj.message("autoproj: wrong package selection on command line, cannot find a match for #{not_matched.to_a.sort.join(", ")}", :red)
561
+ end
562
+ end
563
+
538
564
  def self.mark_exclusion_along_revdeps(pkg_name, revdeps, chain = [], reason = nil)
539
565
  root = !reason
540
566
  chain.unshift pkg_name
@@ -629,6 +655,8 @@ module Autoproj
629
655
  if Autoproj.manifest.excluded?(pkg.name)
630
656
  mark_exclusion_along_revdeps(pkg.name, reverse_dependencies)
631
657
  true
658
+ elsif Autoproj.manifest.ignored?(pkg.name)
659
+ true
632
660
  end
633
661
  end
634
662
  package_queue.concat(new_packages.sort_by(&:name))
@@ -649,7 +677,7 @@ module Autoproj
649
677
  pkg = Autobuild::Package[pkg_name]
650
678
  pkg.resolve_optional_dependencies
651
679
 
652
- pkg.prepare
680
+ pkg.prepare if !pkg.disabled?
653
681
  Rake::Task["#{pkg.name}-prepare"].instance_variable_set(:@already_invoked, true)
654
682
 
655
683
  package_queue.concat(pkg.dependencies)
@@ -815,7 +843,7 @@ where 'mode' is one of:
815
843
  doc: generate and install documentation for packages that have some
816
844
 
817
845
  -- Status & Update
818
- envsh: update the env.sh script
846
+ envsh: update the #{ENV_FILENAME} script
819
847
  osdeps: install the OS-provided packages
820
848
  status: displays the state of the packages w.r.t. their source VCS
821
849
  list-config: list all available packages
@@ -1147,6 +1175,7 @@ where 'mode' is one of:
1147
1175
  last_was_in_sync = false
1148
1176
  result = StatusResult.new
1149
1177
 
1178
+ sync_packages = ""
1150
1179
  packages.each do |pkg|
1151
1180
  lines = []
1152
1181
 
@@ -1172,12 +1201,17 @@ where 'mode' is one of:
1172
1201
  case status.status
1173
1202
  when Autobuild::Importer::Status::UP_TO_DATE
1174
1203
  if !status.uncommitted_code
1175
- if last_was_in_sync
1176
- STDERR.print ", #{pkg_name}"
1177
- else
1178
- STDERR.print pkg_name
1204
+ if sync_packages.size > 80
1205
+ Autoproj.message "#{sync_packages},"
1206
+ sync_packages = ""
1179
1207
  end
1180
- last_was_in_sync = true
1208
+ msg = if sync_packages.empty?
1209
+ pkg_name
1210
+ else
1211
+ ", #{pkg_name}"
1212
+ end
1213
+ STDERR.print msg
1214
+ sync_packages = "#{sync_packages}#{msg}"
1181
1215
  next
1182
1216
  else
1183
1217
  lines << Autoproj.color(" local and remote are in sync", :green)
@@ -1209,22 +1243,25 @@ where 'mode' is one of:
1209
1243
  end
1210
1244
  end
1211
1245
 
1212
- if last_was_in_sync
1213
- Autoproj.message(": local and remote are in sync", :green)
1246
+ if !sync_packages.empty?
1247
+ Autoproj.message("#{sync_packages}: #{color("local and remote are in sync", :green)}")
1248
+ sync_packages = ""
1214
1249
  end
1215
1250
 
1216
- last_was_in_sync = false
1217
- STDERR.print "#{pkg_name}:"
1251
+ STDERR.print
1218
1252
 
1219
1253
  if lines.size == 1
1220
- Autoproj.message lines.first
1254
+ Autoproj.message "#{pkg_name}: #{lines.first}"
1221
1255
  else
1222
- Autoproj.message
1223
- Autoproj.message lines.join("\n")
1256
+ Autoproj.message "#{pkg_name}:"
1257
+ lines.each do |l|
1258
+ Autoproj.message l
1259
+ end
1224
1260
  end
1225
1261
  end
1226
- if last_was_in_sync
1227
- Autoproj.message(": local and remote are in sync", :green)
1262
+ if !sync_packages.empty?
1263
+ Autoproj.message("#{sync_packages}: #{color("local and remote are in sync", :green)}")
1264
+ sync_packages = ""
1228
1265
  end
1229
1266
  return result
1230
1267
  end
@@ -1373,7 +1410,7 @@ where 'mode' is one of:
1373
1410
  end
1374
1411
 
1375
1412
  require 'set'
1376
- curdir_entries = Dir.entries('.').to_set - [".", "..", "autoproj_bootstrap", ".gems", 'env.sh'].to_set
1413
+ curdir_entries = Dir.entries('.').to_set - [".", "..", "autoproj_bootstrap", ".gems", @env].to_set
1377
1414
  if !curdir_entries.empty? && ENV['AUTOPROJ_BOOTSTRAP_IGNORE_NONEMPTY_DIR'] != '1'
1378
1415
  while true
1379
1416
  print "The current directory is not empty, continue bootstrapping anyway ? [yes] "
@@ -1447,14 +1484,13 @@ where 'mode' is one of:
1447
1484
 
1448
1485
  Autoproj.save_config
1449
1486
 
1450
- # Finally, generate an env.sh script
1451
- File.open('env.sh', 'w') do |io|
1452
- io.write <<-EOSHELL
1453
- export RUBYOPT=-rubygems
1454
- export GEM_HOME=#{Autoproj.gem_home}
1455
- export PATH=$GEM_HOME/bin:$PATH
1456
- EOSHELL
1457
- end
1487
+ Autobuild.env_set 'RUBYOPT', '-rubygems'
1488
+ Autobuild.env_set 'GEM_HOME', Autoproj.gem_home
1489
+ Autobuild.env_add_path 'PATH', File.join(Autoproj.gem_home, 'bin')
1490
+ Autobuild.env_inherit 'PATH'
1491
+ Autobuild.env_add_path 'GEM_PATH', Autoproj.gem_home
1492
+ Autobuild.env_inherit 'GEM_PATH'
1493
+ Autoproj.export_env_sh
1458
1494
  end
1459
1495
 
1460
1496
  def self.missing_dependencies(pkg)
@@ -16,7 +16,11 @@ ruby18:
16
16
  "15,16":
17
17
  - ruby
18
18
  - rubygems
19
- default: nonexistent
19
+ darwin:
20
+ - ruby
21
+ - rb-rake
22
+ default: nonexistent
23
+
20
24
  ruby19:
21
25
  debian:
22
26
  - ruby1.9.1
@@ -42,13 +46,17 @@ ruby19:
42
46
  "17":
43
47
  - ruby
44
48
  - rubygems
45
- default: nonexistent
49
+ darwin:
50
+ - ruby19
51
+ - rake
52
+ default: nonexistent
46
53
 
47
54
  build-essential:
48
55
  debian,ubuntu: build-essential
49
56
  gentoo: ignore
50
57
  arch: ignore
51
58
  fedora: ignore
59
+ darwin: ignore
52
60
 
53
61
  autobuild: gem
54
62
  autoproj: gem
@@ -62,16 +70,22 @@ git:
62
70
  gentoo: dev-vcs/git
63
71
  arch: git
64
72
  fedora: git
73
+ darwin: git-core
74
+
65
75
  svn:
66
76
  debian,ubuntu: subversion
67
77
  gentoo: dev-util/subversion
68
78
  arch: subversion
69
79
  fedora: subversion
80
+ darwin: subversion
81
+
70
82
  cmake:
71
83
  debian,ubuntu: cmake
72
84
  gentoo: dev-util/cmake
73
85
  arch: cmake
74
86
  fedora: cmake
87
+ darwin: cmake
88
+
75
89
  autotools:
76
90
  debian,ubuntu:
77
91
  - "automake1.9"
@@ -83,12 +97,16 @@ autotools:
83
97
  fedora:
84
98
  - automake
85
99
  - autoconf
100
+ darwin:
101
+ - automake
102
+ - autoconf
86
103
 
87
104
  lsb_release:
88
105
  debian,ubuntu: lsb-release
89
106
  gentoo: sys-apps/lsb-release
90
107
  arch: ignore
91
108
  fedora: redhat-lsb
109
+ darwin: ignore
92
110
 
93
111
  archive:
94
112
  debian,ubuntu:
@@ -103,9 +121,14 @@ archive:
103
121
  fedora:
104
122
  - tar
105
123
  - unzip
124
+ darwin:
125
+ - gnutar
126
+ - unzip
127
+
106
128
  cvs:
107
129
  debian,ubuntu: cvs
108
130
  fedora: cvs
131
+ darwin: cvs
109
132
 
110
133
  # vim: expandtab
111
134
 
@@ -3,6 +3,8 @@ require 'utilrb/kernel/options'
3
3
  require 'set'
4
4
  require 'rexml/document'
5
5
 
6
+ require 'win32/dir' if RbConfig::CONFIG["host_os"] =~%r!(msdos|mswin|djgpp|mingw|[Ww]indows)!
7
+
6
8
  module Autoproj
7
9
  @build_system_dependencies = Set.new
8
10
 
@@ -44,22 +46,6 @@ module Autoproj
44
46
  value
45
47
  end
46
48
 
47
- @env_inherit = Set.new
48
- # Returns true if the given environment variable must not be reset by the
49
- # env.sh script, but that new values should simply be prepended to it.
50
- #
51
- # See Autoproj.env_inherit
52
- def self.env_inherit?(name)
53
- @env_inherit.include?(name)
54
- end
55
- # Declare that the given environment variable must not be reset by the
56
- # env.sh script, but that new values should simply be prepended to it.
57
- #
58
- # See Autoproj.env_inherit?
59
- def self.env_inherit(*names)
60
- @env_inherit |= names
61
- end
62
-
63
49
  # Sets an environment variable
64
50
  #
65
51
  # This sets (or resets) the environment variable +name+ to the given value.
@@ -1037,6 +1023,8 @@ module Autoproj
1037
1023
 
1038
1024
  @file = file
1039
1025
  @data = data
1026
+ data['ignore_packages'] ||= Set.new
1027
+ data['exclude_packages'] ||= Set.new
1040
1028
 
1041
1029
  if data['constants']
1042
1030
  @constant_definitions = Autoproj.resolve_constant_definitions(data['constants'])
@@ -1098,8 +1086,7 @@ module Autoproj
1098
1086
  # Call this method to ignore a specific package. It must not be used in
1099
1087
  # init.rb, as the manifest is not yet loaded then
1100
1088
  def ignore_package(package_name)
1101
- list = (data['ignore_packages'] ||= Array.new)
1102
- list << package_name
1089
+ data['ignore_packages'] << package_name
1103
1090
  end
1104
1091
 
1105
1092
  # True if the given package should not be built, with the packages that
@@ -1107,40 +1094,45 @@ module Autoproj
1107
1094
  #
1108
1095
  # This is useful if the packages are already installed on this system.
1109
1096
  def ignored?(package_name)
1110
- if data['ignore_packages']
1111
- data['ignore_packages'].any? do |l|
1112
- if package_name == l
1113
- true
1114
- elsif (pkg_set = metapackages[l]) && pkg_set.include?(package_name)
1115
- true
1116
- else
1117
- false
1097
+ data['ignore_packages'].any? do |l|
1098
+ if package_name == l
1099
+ true
1100
+ elsif (pkg_set = metapackages[l]) && pkg_set.include?(package_name)
1101
+ true
1102
+ else
1103
+ false
1104
+ end
1105
+ end
1106
+ end
1107
+
1108
+ # Enumerates the package names of all ignored packages
1109
+ def each_ignored_package
1110
+ data['ignore_packages'].each do |l|
1111
+ if pkg_set = metapackages[l]
1112
+ pkg_set.each_package do |pkg|
1113
+ yield(pkg.name)
1118
1114
  end
1115
+ else
1116
+ yield(l)
1119
1117
  end
1120
- else
1121
- false
1122
1118
  end
1123
1119
  end
1124
1120
 
1125
1121
  # Removes all registered exclusions
1126
1122
  def clear_exclusions
1127
1123
  automatic_exclusions.clear
1128
- if excl = data['exclude_packages']
1129
- excl.clear
1130
- end
1124
+ data['exclude_packages'].clear
1131
1125
  end
1132
1126
 
1133
1127
  # Removes all registered ignored packages
1134
1128
  def clear_ignored
1135
- if ignored = data['ignore_packages']
1136
- ignored.clear
1137
- end
1129
+ data['ignore_packages'].clear
1138
1130
  end
1139
1131
 
1140
1132
  # The set of package names that are listed in the excluded_packages
1141
1133
  # section of the manifest
1142
1134
  def manifest_exclusions
1143
- data['exclude_packages'] || Set.new
1135
+ data['exclude_packages']
1144
1136
  end
1145
1137
 
1146
1138
  # A package_name => reason map of the exclusions added with #add_exclusion.
@@ -1468,11 +1460,11 @@ module Autoproj
1468
1460
  dest = File.readlink(symlink_dest)
1469
1461
  if dest != pkg_set.raw_local_dir
1470
1462
  FileUtils.rm_f symlink_dest
1471
- FileUtils.ln_sf pkg_set.raw_local_dir, symlink_dest
1463
+ Autoproj.create_symlink(pkg_set.raw_local_dir, symlink_dest)
1472
1464
  end
1473
1465
  else
1474
1466
  FileUtils.rm_f symlink_dest
1475
- FileUtils.ln_sf pkg_set.raw_local_dir, symlink_dest
1467
+ Autoproj.create_symlink(pkg_set.raw_local_dir, symlink_dest)
1476
1468
  end
1477
1469
 
1478
1470
  symlink_dest
@@ -1643,7 +1635,7 @@ module Autoproj
1643
1635
  # where +type+ can either be :package or :osdeps (as symbols)
1644
1636
  #
1645
1637
  # The returned array can be empty if +name+ is an ignored package
1646
- def resolve_package_name(name)
1638
+ def resolve_package_name(name, options = Hash.new)
1647
1639
  if pkg_set = find_metapackage(name)
1648
1640
  if !pkg_set
1649
1641
  raise ConfigError.new, "#{name} is neither a package nor a package set name. Packages in autoproj must be declared in an autobuild file."
@@ -1655,7 +1647,7 @@ module Autoproj
1655
1647
 
1656
1648
  result = []
1657
1649
  pkg_names.each do |pkg|
1658
- result.concat(resolve_single_package_name(pkg))
1650
+ result.concat(resolve_single_package_name(pkg, options))
1659
1651
  end
1660
1652
  result
1661
1653
  end
@@ -1686,10 +1678,8 @@ module Autoproj
1686
1678
  #
1687
1679
  # This is a helper method for #resolve_package_name. Do not use
1688
1680
  # directly
1689
- def resolve_single_package_name(name) # :nodoc:
1690
- if ignored?(name)
1691
- return []
1692
- end
1681
+ def resolve_single_package_name(name, options = Hash.new) # :nodoc:
1682
+ options = Kernel.validate_options options, :filter => true
1693
1683
 
1694
1684
  explicit_selection = explicitly_selected_package?(name)
1695
1685
  osdeps_availability = Autoproj.osdeps.availability_of(name)
@@ -1733,9 +1723,15 @@ module Autoproj
1733
1723
  end
1734
1724
  end
1735
1725
 
1736
- # No source, no osdeps. Call osdeps again, but this time to get
1726
+ # No source, no osdeps.
1727
+ # If the package is ignored by the manifest, just return empty.
1728
+ # Otherwise, generate a proper error message
1729
+ # Call osdeps again, but this time to get
1737
1730
  # a proper error message.
1738
1731
  if !available_as_source
1732
+ if ignored?(name)
1733
+ return []
1734
+ end
1739
1735
  begin
1740
1736
  Autoproj.osdeps.resolve_os_dependencies([name].to_set)
1741
1737
  rescue Autoproj::ConfigError => e
@@ -2146,6 +2142,10 @@ module Autoproj
2146
2142
  end
2147
2143
  end
2148
2144
 
2145
+ def has_match_for?(sel)
2146
+ matches.has_key?(sel)
2147
+ end
2148
+
2149
2149
  # Remove packages that are explicitely excluded and/or ignored
2150
2150
  #
2151
2151
  # Raise an error if an explicit selection expands only to an
@@ -2176,20 +2176,22 @@ module Autoproj
2176
2176
  end
2177
2177
 
2178
2178
  excluded = excluded.to_set
2179
+ ignored = ignored.to_set
2179
2180
  expansion.delete_if do |pkg_name|
2180
- excluded.include?(pkg_name)
2181
+ ignored.include?(pkg_name) || excluded.include?(pkg_name)
2181
2182
  end
2182
2183
  end
2183
2184
 
2184
2185
  selection.keys.sort.each do |pkg_name|
2185
2186
  if manifest.excluded?(pkg_name)
2186
- Autoproj.warn "#{pkg_name} was selected for #{selection[pkg_name].to_a.sort.join(", ")}, but it is excluded from the build: #{Autoproj.manifest.exclusion_reason(pkg_name)}"
2187
2187
  selection.delete(pkg_name)
2188
2188
  elsif manifest.ignored?(pkg_name)
2189
- Autoproj.warn "#{pkg_name} was selected for #{selection[pkg_name].to_a.sort.join(", ")}, but it is ignored in this build"
2190
2189
  selection.delete(pkg_name)
2191
2190
  end
2192
2191
  end
2192
+ matches.delete_if do |key, sel|
2193
+ sel.empty?
2194
+ end
2193
2195
  end
2194
2196
  end
2195
2197
 
@@ -2199,7 +2201,8 @@ module Autoproj
2199
2201
  # * as a package name
2200
2202
  #
2201
2203
  # This method converts the first two directories into the third one
2202
- def expand_package_selection(selection)
2204
+ def expand_package_selection(selection, options = Hash.new)
2205
+ options = Kernel.validate_options options, :filter => true
2203
2206
  base_dir = Autoproj.root_dir
2204
2207
 
2205
2208
  result = PackageSelection.new
@@ -2227,6 +2230,8 @@ module Autoproj
2227
2230
  end
2228
2231
  end
2229
2232
 
2233
+ pending_selections = Hash.new
2234
+
2230
2235
  # Finally, check for package source directories
2231
2236
  all_packages = self.all_package_names
2232
2237
  selection.each do |sel|
@@ -2235,9 +2240,13 @@ module Autoproj
2235
2240
  pkg = Autobuild::Package[pkg_name]
2236
2241
  if pkg_name =~ match_pkg_name || "#{sel}/" =~ Regexp.new("^#{Regexp.quote(pkg.srcdir)}/") || pkg.srcdir =~ Regexp.new("^#{Regexp.quote(sel)}")
2237
2242
  # Check-out packages that are not in the manifest only
2238
- # if they are explicitely selected
2243
+ # if they are explicitely selected. However, we do store
2244
+ # them as "possible resolutions" for the user selection,
2245
+ # and add them if -- at the end of the method -- nothing
2246
+ # has been found for this particular selection
2239
2247
  if !all_layout_packages.include?(pkg.name)
2240
2248
  if pkg_name != sel && pkg.srcdir != sel
2249
+ pending_selections[sel] = pkg_name
2241
2250
  next
2242
2251
  end
2243
2252
  end
@@ -2247,8 +2256,18 @@ module Autoproj
2247
2256
  end
2248
2257
  end
2249
2258
 
2250
- result.filter_excluded_and_ignored_packages(self)
2251
- return result, (selection - result.matches.keys)
2259
+ if options[:filter]
2260
+ result.filter_excluded_and_ignored_packages(self)
2261
+ end
2262
+ nonresolved = selection - result.matches.keys
2263
+ nonresolved.delete_if do |sel|
2264
+ if pkg_name = pending_selections[sel]
2265
+ result.select(sel, pkg_name)
2266
+ true
2267
+ end
2268
+ end
2269
+
2270
+ return result, nonresolved
2252
2271
  end
2253
2272
 
2254
2273
  attr_reader :moved_packages