autoproj 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,26 @@
1
+ = Version 1.5.3
2
+ * use osdeps-provided packages instead of autobuild-built ones even if they are
3
+ implicitely selected in the layout (i.e. because of a package set name).
4
+ * allow to force using the autobuild-built package instead of the OSdeps
5
+ provided one by explicitely listing the package name in the layout.
6
+ * fix multiple loading of manifests (harmless, but annoying)
7
+ * added an 'overrides' section in source.yml, and made the version_control
8
+ field local to the given package set. This is because there is too much
9
+ possibility for name clashes when people start sharing package sets, and it
10
+ allows to simply change some of the VCS parameters (most often, the branch)
11
+ without having to redefine the complete configuration.
12
+ * packages defined in the local source do not need to have an entry in
13
+ overrides.yml anymore. Only proper package sets do.
14
+ * fix env.sh update in cases of build failures
15
+ * fix osdeps/autobuild package unification in some cases. In particular,
16
+ autoproj will fall-back to self-built packages if an OS package is not
17
+ provided on *this particular OS/version pair*, even though it exists for
18
+ other OSes or other versions of the same OS.
19
+ * in case the layout selects some packages, partial build commands should not
20
+ forcefully select packages that are not part of the layout at all.
21
+ * add the ability to override the default.osdeps file by setting
22
+ AUTOPROJ_DEFAULT_OSDEPS environment variable
23
+
1
24
  = Version 1.5.2
2
25
  * fix ignored_packages and exclude_packages
3
26
 
@@ -9,6 +9,7 @@ require 'autoproj'
9
9
  require 'autoproj/autobuild'
10
10
  require 'open-uri'
11
11
  require 'autoproj/cmdline'
12
+ require 'pp'
12
13
 
13
14
  require 'highline'
14
15
  include Autoproj
@@ -95,10 +96,10 @@ report(Autobuild.debug) do
95
96
  end
96
97
 
97
98
  selected_packages = Autoproj::CmdLine.resolve_user_selection(selected_packages)
99
+ Autoproj.manifest.explicit_selection = selected_packages
98
100
  Autoproj::CmdLine.initial_package_setup
99
101
 
100
102
  if Autoproj::CmdLine.only_status?
101
- STDERR.puts
102
103
  all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
103
104
  Autoproj::CmdLine.status(all_enabled_packages)
104
105
  exit(0)
@@ -126,34 +127,36 @@ report(Autobuild.debug) do
126
127
  osdeps.install(Autoproj.build_system_dependencies)
127
128
  end
128
129
 
129
- # Now, we actually do the import. Unfortunately, at this stage, we need to
130
- # import the package and its dependencies ourselves so that we are able to
131
- # build the list of packages that have actually been selected on the command
132
- # line.
133
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
134
-
135
- if Autoproj::CmdLine.build? || Autoproj::CmdLine.doc? || Autoproj::CmdLine.update_os_dependencies?
136
- if all_enabled_packages.empty?
137
- STDERR.puts color("autoproj: nothing to do", :bold)
138
- elsif Autoproj::CmdLine.build? || Autoproj::CmdLine.doc?
139
- Autoproj::CmdLine.build_packages(selected_packages, all_enabled_packages)
140
- elsif Autoproj::CmdLine.update_os_dependencies?
141
- manifest.install_os_dependencies(all_enabled_packages)
142
- end
130
+ begin
131
+ # Now, we actually do the import. Unfortunately, at this stage, we need to
132
+ # import the package and its dependencies ourselves so that we are able to
133
+ # build the list of packages that have actually been selected on the command
134
+ # line.
135
+ all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
143
136
 
144
- # Now, do some sanity checks on the result
145
- prefixes = all_enabled_packages.inject(Set.new) do |set, pkg_name|
146
- set << Autobuild::Package[pkg_name].prefix
147
- end
148
- prefixes.each do |prefix|
149
- libdir = File.join(prefix, "lib")
150
- if File.directory?(libdir)
151
- Autoproj.validate_solib_dependencies(libdir)
137
+ if Autoproj::CmdLine.build? || Autoproj::CmdLine.doc? || Autoproj::CmdLine.update_os_dependencies?
138
+ if all_enabled_packages.empty?
139
+ STDERR.puts color("autoproj: nothing to do", :bold)
140
+ elsif Autoproj::CmdLine.build? || Autoproj::CmdLine.doc?
141
+ Autoproj::CmdLine.build_packages(selected_packages, all_enabled_packages)
142
+ elsif Autoproj::CmdLine.update_os_dependencies?
143
+ manifest.install_os_dependencies(all_enabled_packages)
144
+ end
145
+
146
+ # Now, do some sanity checks on the result
147
+ prefixes = all_enabled_packages.inject(Set.new) do |set, pkg_name|
148
+ set << Autobuild::Package[pkg_name].prefix
149
+ end
150
+ prefixes.each do |prefix|
151
+ libdir = File.join(prefix, "lib")
152
+ if File.directory?(libdir)
153
+ Autoproj.validate_solib_dependencies(libdir)
154
+ end
152
155
  end
153
156
  end
157
+ ensure
158
+ Autoproj.export_env_sh
159
+ STDERR.puts color("autoproj: updated #{Autoproj.root_dir}/env.sh", :green)
154
160
  end
155
-
156
- Autoproj.export_env_sh
157
- STDERR.puts color("autoproj: updated #{Autoproj.root_dir}/env.sh", :green)
158
161
  end
159
162
 
@@ -18,11 +18,15 @@ 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 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.
23
- - in the source.yml file, it will match the package's name with the
24
- package\_name fields. It will consider every matching block (i.e. every
25
- package\_name that matches), overriding earlier options by later ones.
21
+ - it loads the information contained in the version_control section of the
22
+ package set that defines the considered package
23
+ - it will apply any modification that is contained in the overrides section by
24
+ the package sets listed *after* the aforementionned package set
25
+
26
+ For both the version_control and overrides section, autoproj will match the
27
+ package's name with the package\_name fields. It will consider every matching
28
+ block (i.e. every package\_name that matches), overriding earlier setup by later
29
+ ones.
26
30
 
27
31
  As an example, let's consider the following manifest:
28
32
 
@@ -47,10 +51,8 @@ version_control:
47
51
  Finally, the rubim.drivers package set has:
48
52
 
49
53
  {coderay:: ruby}
50
- version_control:
54
+ overrides:
51
55
  - orocos/logger:
52
- type: git
53
- url: git://github.com/$PACKAGE.git
54
56
  branch: perf
55
57
  {coderay}
56
58
 
@@ -61,8 +63,8 @@ Then, the following will happen:
61
63
  * in addition, the 'branch' flag of orocos/orocos.rb will be overriden from
62
64
  'master' (the default) to 'roby'
63
65
  * in the case of orocos/logger, since there is a matching definition in
64
- rubim.drivers, the definition in rubim.orocos *is not used at all*. Only the
65
- definition found in rubim.drivers' source.yml file matters.
66
+ the overrides section of rubim.drivers, the 'perf' branch will be checked out
67
+ instead of the 'roby' branch, keeping the same importer type and URL
66
68
 
67
69
  The remaining of this page will detail the various options that exist to import
68
70
  a source package.
@@ -11,7 +11,7 @@ module Autobuild
11
11
 
12
12
  alias __depends_on__ depends_on
13
13
  def depends_on(name)
14
- if Autoproj.osdeps.has?(name)
14
+ if Autoproj.osdeps.has?(name) && !Autoproj.manifest.explicitly_selected_package?(name)
15
15
  @os_packages ||= Set.new
16
16
  @os_packages << name
17
17
  else
@@ -328,12 +328,7 @@ class Autobuild::Git
328
328
  def snapshot(package, target_dir)
329
329
  Dir.chdir(package.srcdir) do
330
330
  head_commit = `git rev-parse #{branch}`.chomp
331
- {
332
- 'type' => 'git',
333
- 'url' => repository,
334
- 'commit' => head_commit,
335
- 'patches' => patches
336
- }
331
+ { 'commit' => head_commit }
337
332
  end
338
333
  end
339
334
  end
@@ -344,16 +339,7 @@ class Autobuild::ArchiveImporter
344
339
  FileUtils.mkdir_p archive_dir
345
340
  FileUtils.cp @cachefile, archive_dir
346
341
 
347
- {
348
- 'type' => 'archive',
349
- 'url' => File.join('$AUTOPROJ_SOURCE_DIR', File.basename(@cachefile)),
350
- 'mode' => @mode,
351
- 'update_cached_file' => false,
352
- 'patches' => patches,
353
- 'no_subdirectory' => @options[:no_subdirectory],
354
- 'archive_dir' => archive_dir
355
-
356
- }
342
+ { 'url' => File.join('$AUTOPROJ_SOURCE_DIR', File.basename(@cachefile)) }
357
343
  end
358
344
  end
359
345
 
@@ -187,10 +187,10 @@ module Autoproj
187
187
  source_yml = source.raw_description_file
188
188
  STDERR.puts " #{source_yml['name']}"
189
189
  if source.local?
190
- STDERR.puts " local source in #{source.local_dir}"
190
+ puts " local source in #{source.local_dir}"
191
191
  else
192
- STDERR.puts " from: #{source.vcs}"
193
- STDERR.puts " local: #{source.local_dir}"
192
+ puts " from: #{source.vcs}"
193
+ puts " local: #{source.local_dir}"
194
194
  end
195
195
 
196
196
  lines = []
@@ -212,15 +212,17 @@ module Autoproj
212
212
  w_col1 = col1.size if !w_col1 || col1.size > w_col1
213
213
  w_col2 = col2.size if !w_col2 || col2.size > w_col2
214
214
  end
215
- STDERR.puts " packages:"
215
+ puts " packages:"
216
216
  format = " | %-#{w_col1}s | %-#{w_col2}s |"
217
217
  lines.each do |col1, col2|
218
- STDERR.puts(format % [col1, col2])
218
+ puts(format % [col1, col2])
219
219
  end
220
220
  end
221
221
  end
222
222
  end
223
223
 
224
+ # Returns the set of packages that are actually selected based on what
225
+ # the user gave on the command line
224
226
  def self.resolve_user_selection(selected_packages)
225
227
  manifest = Autoproj.manifest
226
228
 
@@ -280,7 +282,7 @@ module Autoproj
280
282
 
281
283
  current_packages.
282
284
  delete_if { |pkg| all_enabled_packages.include?(pkg.name) }
283
- all_enabled_packages |= current_packages
285
+ all_enabled_packages |= current_packages.map(&:name).to_set
284
286
 
285
287
  # We import first so that all packages can export the
286
288
  # additional targets they provide.
@@ -319,7 +321,7 @@ module Autoproj
319
321
  STDERR.puts "autoproj: finished importing packages"
320
322
  end
321
323
 
322
- return all_enabled_packages.map(&:name)
324
+ return all_enabled_packages
323
325
  end
324
326
 
325
327
  def self.build_packages(selected_packages, all_enabled_packages)
@@ -950,10 +952,10 @@ EOTEXT
950
952
  else Hash.new
951
953
  end
952
954
 
953
- if overrides['version_control']
954
- overrides['version_control'].concat(version_control)
955
+ if overrides['overrides']
956
+ overrides['overrides'].concat(version_control)
955
957
  else
956
- overrides['version_control'] = version_control
958
+ overrides['overrides'] = version_control
957
959
  end
958
960
 
959
961
  File.open(overrides_path, 'w') do |io|
@@ -10,6 +10,8 @@ ruby18:
10
10
  - libopenssl-ruby1.8
11
11
  gentoo:
12
12
  - dev-lang/ruby:1.8
13
+ gem:
14
+ - rake
13
15
 
14
16
  ruby19:
15
17
  debian:
@@ -32,6 +34,8 @@ ruby19:
32
34
  - dev-lang/ruby:1.9
33
35
  arch:
34
36
  - ruby
37
+ gem:
38
+ - rake
35
39
 
36
40
  rdoc: gem
37
41
 
@@ -198,7 +198,7 @@ module Autoproj
198
198
  def local?; vcs.local? end
199
199
  # True if this source defines nothing
200
200
  def empty?
201
- !source_definition['version_control'] &&
201
+ !source_definition['version_control'] && !source_definition['overrides']
202
202
  !each_package.find { true } &&
203
203
  !File.exists?(File.join(raw_local_dir, "overrides.rb")) &&
204
204
  !File.exists?(File.join(raw_local_dir, "init.rb"))
@@ -357,20 +357,25 @@ module Autoproj
357
357
  data
358
358
  end
359
359
 
360
+ # Returns the default importer for this package set
361
+ def default_importer
362
+ importer_definition_for('default')
363
+ end
364
+
360
365
  # Returns an importer definition for the given package, if one is
361
366
  # available. Otherwise returns nil.
362
367
  #
363
368
  # The returned value is a VCSDefinition object.
364
- def importer_definition_for(package_name)
369
+ def version_control_field(package_name, section_name, validate = true)
365
370
  urls = source_definition['urls'] || Hash.new
366
371
  urls['HOME'] = ENV['HOME']
367
372
 
368
- all_vcs = source_definition['version_control']
373
+ all_vcs = source_definition[section_name]
369
374
  if all_vcs
370
375
  if all_vcs.kind_of?(Hash)
371
- raise ConfigError, "wrong format for the version_control field, you forgot the '-' in front of the package names"
376
+ raise ConfigError, "wrong format for the #{section_name} section, you forgot the '-' in front of the package names"
372
377
  elsif !all_vcs.kind_of?(Array)
373
- raise ConfigError, "wrong format for the version_control field"
378
+ raise ConfigError, "wrong format for the #{section_name} section"
374
379
  end
375
380
  end
376
381
 
@@ -435,14 +440,25 @@ module Autoproj
435
440
  vcs_spec.dup.each do |name, value|
436
441
  vcs_spec[name] = expand(value, expansions)
437
442
  end
438
- vcs_spec
439
443
 
440
- Autoproj.normalize_vcs_definition(vcs_spec)
444
+ # If required, verify that the configuration is a valid VCS
445
+ # configuration
446
+ if validate
447
+ Autoproj.normalize_vcs_definition(vcs_spec)
448
+ end
449
+ vcs_spec
441
450
  end
442
451
  rescue ConfigError => e
443
452
  raise ConfigError, "#{e.message} in #{source_file}", e.backtrace
444
453
  end
445
454
 
455
+ def importer_definition_for(package_name)
456
+ vcs_spec = version_control_field(package_name, 'version_control_field')
457
+ if vcs_spec
458
+ Autoproj.normalize_vcs_definition(vcs_spec)
459
+ end
460
+ end
461
+
446
462
  def each_package
447
463
  if !block_given?
448
464
  return enum_for(:each_package)
@@ -471,6 +487,12 @@ module Autoproj
471
487
  File.join(Autoproj.config_dir, "overrides.yml")
472
488
  end
473
489
 
490
+ # Returns the default importer for this package set
491
+ def default_importer
492
+ importer_definition_for('default') ||
493
+ Autoproj.normalize_vcs_definition(:type => 'none')
494
+ end
495
+
474
496
  def raw_description_file
475
497
  path = source_file
476
498
  if File.file?(path)
@@ -512,6 +534,15 @@ module Autoproj
512
534
  end
513
535
  end
514
536
 
537
+ # The set of packages that are selected by the user, either through the
538
+ # manifest file or through the command line, as a set of package names
539
+ attr_accessor :explicit_selection
540
+
541
+ # Returns true if +pkg_name+ has been explicitely selected
542
+ def explicitly_selected_package?(pkg_name)
543
+ explicit_selection && explicit_selection.include?(pkg_name)
544
+ end
545
+
515
546
  def self.load(file)
516
547
  begin
517
548
  data = YAML.load(File.read(file))
@@ -666,6 +697,13 @@ module Autoproj
666
697
  end
667
698
 
668
699
  if @sources
700
+ if load_description
701
+ @sources.each do |src|
702
+ if !src.source_definition
703
+ src.load_description_file
704
+ end
705
+ end
706
+ end
669
707
  return @sources.each(&block)
670
708
  end
671
709
 
@@ -687,9 +725,7 @@ module Autoproj
687
725
  end
688
726
 
689
727
  all_sources.each(&block)
690
- if load_description
691
- @sources = all_sources
692
- end
728
+ @sources = all_sources
693
729
  end
694
730
 
695
731
  # Register a new package
@@ -802,15 +838,26 @@ module Autoproj
802
838
  package_set
803
839
  end
804
840
 
805
- each_source.to_a.reverse.each do |source|
806
- vcs = source.importer_definition_for(package_name)
807
- if vcs
808
- return vcs
809
- elsif package_source.name == source.name
810
- return
841
+ sources = each_source.to_a
842
+
843
+ # Remove sources listed before the package source
844
+ while !sources.empty? && sources[0].name != package_source.name
845
+ sources.shift
846
+ end
847
+ package_source = sources.shift
848
+
849
+ # Get the version control information from the package source. There
850
+ # must be one
851
+ vcs_spec = package_source.version_control_field(package_name, 'version_control')
852
+ return if !vcs_spec
853
+
854
+ sources.each do |src|
855
+ overrides_spec = src.version_control_field(package_name, 'overrides', false)
856
+ if overrides_spec
857
+ vcs_spec.merge!(overrides_spec)
811
858
  end
812
859
  end
813
- nil
860
+ Autoproj.normalize_vcs_definition(vcs_spec)
814
861
  end
815
862
 
816
863
  # Sets up the package importers based on the information listed in
@@ -832,7 +879,7 @@ module Autoproj
832
879
  def load_importers
833
880
  packages.each_value do |pkg|
834
881
  vcs = importer_definition_for(pkg.autobuild.name, pkg.package_set) ||
835
- importer_definition_for("default", pkg.package_set)
882
+ pkg.package_set.default_importer
836
883
 
837
884
  if vcs
838
885
  Autoproj.add_build_system_dependency vcs.type
@@ -855,8 +902,9 @@ module Autoproj
855
902
  raise ConfigError, "#{name} is neither a package nor a source"
856
903
  end
857
904
  packages.values.
858
- map { |pkg| pkg.autobuild.name if pkg.package_set.name == source.name }.
859
- compact
905
+ find_all { |pkg| pkg.package_set.name == source.name }.
906
+ map { |pkg| pkg.autobuild.name }.
907
+ find_all { |pkg_name| !Autoproj.osdeps || !Autoproj.osdeps.has?(pkg_name) }
860
908
  end
861
909
  end
862
910
 
@@ -921,29 +969,25 @@ module Autoproj
921
969
  end
922
970
  end
923
971
 
924
- def in_sublayout(name, packages)
925
- srcdir = File.join(Autoproj.root_dir, name)
926
- prefix = File.join(Autoproj.build_dir, name)
927
- logdir = File.join(prefix, "log")
928
- Autobuild.logdir = logdir
929
- packages.each do |pkg_name|
930
- pkg = Autobuild::Package[pkg_name]
931
- pkg.srcdir = File.join(srcdir, pkg_name)
932
- pkg.prefix = prefix
933
- pkg.logdir = logdir
934
- end
935
-
936
- yield
972
+ # Returns the set of package names that are available for installation.
973
+ # It is the set of packages listed in the layout minus the exluded and
974
+ # ignred ones
975
+ def all_package_names
976
+ default_packages
937
977
  end
938
978
 
979
+ # Returns the set of packages that should be built if the user does not
980
+ # specify any on the command line
939
981
  def default_packages
940
982
  names = if layout = data['layout']
941
983
  layout_packages(layout, true)
942
984
  else
943
985
  # No layout, all packages are selected
944
986
  packages.values.
945
- map { |pkg| pkg.autobuild.name }
987
+ map { |pkg| pkg.autobuild.name }.
988
+ find_all { |pkg_name| !Autoproj.osdeps || !Autoproj.osdeps.has?(pkg_name) }
946
989
  end
990
+
947
991
  names.delete_if { |pkg_name| excluded?(pkg_name) || ignored?(pkg_name) }
948
992
  names.to_set
949
993
  end
@@ -1024,25 +1068,25 @@ module Autoproj
1024
1068
  def expand_package_selection(selected_packages)
1025
1069
  base_dir = Autoproj.root_dir
1026
1070
 
1027
- expanded_packages = []
1028
-
1029
- # Get all the package names
1030
- package_names = Autobuild::Package.each(true).
1031
- map do |name, pkg|
1032
- pkg.name
1033
- end
1071
+ # The expanded selection
1072
+ expanded_packages = Set.new
1073
+ # All the packages that are available on this installation
1074
+ all_package_names = self.all_package_names
1034
1075
 
1035
1076
  # First, remove packages that are directly referenced by name or by
1036
1077
  # package set names
1037
1078
  selected_packages.delete_if do |sel|
1038
1079
  sel = Regexp.new(Regexp.quote(sel))
1039
1080
 
1040
- packages = package_names.find_all { |pkg_name| pkg_name =~ sel }
1041
- expanded_packages.concat(packages)
1081
+ packages = all_package_names.
1082
+ find_all { |pkg_name| pkg_name =~ sel }.
1083
+ to_set
1084
+ expanded_packages |= packages
1042
1085
 
1043
1086
  sources = each_source.find_all { |source| source.name =~ sel }
1044
1087
  sources.each do |source|
1045
- expanded_packages.concat(resolve_package_set(source.name))
1088
+ packages = resolve_package_set(source.name).to_set
1089
+ expanded_packages |= (packages & all_package_names)
1046
1090
  end
1047
1091
 
1048
1092
  !packages.empty? && !sources.empty?
@@ -1056,12 +1100,13 @@ module Autoproj
1056
1100
  each_package_set(nil) do |layout_name, packages, _|
1057
1101
  selected_packages.delete_if do |sel|
1058
1102
  if layout_name[0..-1] =~ Regexp.new("#{sel}\/?$")
1059
- expanded_packages.concat(packages.to_a)
1103
+ expanded_packages |= packages.to_set
1060
1104
  else
1061
1105
  match = Regexp.new("^#{Regexp.quote(sel)}")
1062
- Autobuild::Package.each(true) do |name, pkg|
1106
+ all_package_names.each do |pkg_name|
1107
+ pkg = Autobuild::Package[pkg_name]
1063
1108
  if pkg.srcdir =~ match
1064
- expanded_packages << name
1109
+ expanded_packages << pkg_name
1065
1110
  end
1066
1111
  end
1067
1112
  end
@@ -31,7 +31,16 @@ module Autoproj
31
31
 
32
32
  AUTOPROJ_OSDEPS = File.join(File.expand_path(File.dirname(__FILE__)), 'default.osdeps')
33
33
  def self.load_default
34
- @default_osdeps ||= OSDependencies.load(AUTOPROJ_OSDEPS)
34
+ if @default_osdeps
35
+ @default_osdeps
36
+ else
37
+ file = ENV['AUTOPROJ_DEFAULT_OSDEPS'] || AUTOPROJ_OSDEPS
38
+ if !File.file?(file)
39
+ STDERR.puts "WARN: #{file} (from AUTOPROJ_DEFAULT_OSDEPS) is not a file, falling back to #{AUTOPROJ_OSDEPS}"
40
+ file = AUTOPROJ_OSDEPS
41
+ end
42
+ @default_osdeps = OSDependencies.load(file)
43
+ end
35
44
  end
36
45
 
37
46
  attr_reader :definitions
@@ -128,14 +137,18 @@ module Autoproj
128
137
  'arch' => 'pacman -Sy --noconfirm %s'
129
138
  }
130
139
 
131
- def generate_os_script(dependencies)
140
+ # Resolves the given OS dependencies into the actual packages that need
141
+ # to be installed on this particular OS.
142
+ #
143
+ # Raises ConfigError if some packages can't be found
144
+ def resolve_os_dependencies(dependencies)
132
145
  os_name, os_version = operating_system
133
146
  if !OS_PACKAGE_INSTALL.has_key?(os_name)
134
147
  raise ConfigError, "I don't know how to install packages on #{os_name}"
135
148
  end
136
149
 
137
- shell_snippets = ""
138
150
  os_packages = []
151
+ shell_snippets = []
139
152
  dependencies.each do |name|
140
153
  dep_def = definitions[name]
141
154
  if !dep_def
@@ -154,6 +167,7 @@ module Autoproj
154
167
  end
155
168
 
156
169
  data = os_entry.last
170
+
157
171
  # This package does not need to be installed on this operating system (example: build tools on Gentoo)
158
172
  next if !data || data == "ignore"
159
173
 
@@ -177,20 +191,29 @@ module Autoproj
177
191
  elsif data.to_str =~ /\w+/
178
192
  os_packages << data.to_str
179
193
  else
180
- shell_snippets << "\n" << data << "\n"
194
+ shell_snippets << data.to_str
181
195
  end
182
196
  end
183
197
 
198
+ return os_packages, shell_snippets
199
+ end
200
+
201
+
202
+ def generate_os_script(dependencies)
203
+ os_name, os_version = operating_system
204
+ os_packages, shell_snippets = resolve_os_dependencies(dependencies)
205
+
184
206
  "#! /bin/bash\n" +
185
207
  GAIN_ROOT_ACCESS + "\n" +
186
208
  (OS_PACKAGE_INSTALL[os_name] % [os_packages.join(" ")]) +
187
- "\n" + shell_snippets
209
+ "\n" + shell_snippets.join("\n")
188
210
  end
189
211
 
190
212
  # Returns true if there is an operating-system package with that name,
191
213
  # and false otherwise
192
214
  def has?(name)
193
- partition_packages([name].to_set)
215
+ osdeps, gemdeps = partition_packages([name].to_set)
216
+ resolve_os_dependencies(osdeps)
194
217
  true
195
218
  rescue ConfigError
196
219
  false
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.5.2"
2
+ VERSION = "1.5.3"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 2
9
- version: 1.5.2
8
+ - 3
9
+ version: 1.5.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sylvain Joyeux
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-28 00:00:00 +02:00
17
+ date: 2010-06-08 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -97,8 +97,8 @@ dependencies:
97
97
  segments:
98
98
  - 2
99
99
  - 0
100
- - 3
101
- version: 2.0.3
100
+ - 4
101
+ version: 2.0.4
102
102
  type: :development
103
103
  version_requirements: *id006
104
104
  - !ruby/object:Gem::Dependency
@@ -139,8 +139,8 @@ dependencies:
139
139
  segments:
140
140
  - 2
141
141
  - 6
142
- - 0
143
- version: 2.6.0
142
+ - 1
143
+ version: 2.6.1
144
144
  type: :development
145
145
  version_requirements: *id009
146
146
  description: |-