lib/autoproj/autobuild.rb in autoproj-1.7.10 vs lib/autoproj/autobuild.rb in autoproj-1.7.11.rc1
- old
+ new
@@ -96,10 +96,12 @@
alias __depends_on__ depends_on
def depends_on(name)
if Autoproj::CmdLine.ignore_dependencies?
return
+ elsif Autoproj.manifest.ignored?(name)
+ return
end
@os_packages ||= Set.new
@ignored_os_dependencies ||= Set.new
@@ -109,12 +111,26 @@
explicit_selection = Autoproj.manifest.explicitly_selected_package?(name)
osdeps_availability = Autoproj.osdeps.availability_of(name)
available_as_source = Autobuild::Package[name]
+ osdeps_overrides = Autoproj.manifest.osdeps_overrides[name]
+ if osdeps_overrides
+ source_packages = osdeps_overrides[:packages]
+ if source_packages.empty?
+ source_packages << name
+ end
+ force_source_usage = osdeps_overrides[:force]
+ available_as_source = true
+ end
+
# Prefer OS packages to source packages
- if !explicit_selection
+ if force_source_usage && !source_packages.any? { |pkg_name| Autoproj.manifest.excluded?(pkg_name) }
+ source_packages.each do |pkg_name|
+ __depends_on__(pkg_name)
+ end
+ elsif !explicit_selection
if osdeps_availability == Autoproj::OSDependencies::AVAILABLE
@os_packages << name
return
elsif osdeps_availability == Autoproj::OSDependencies::IGNORE
return
@@ -147,14 +163,15 @@
end
raise
end
# Should never reach further than that
end
+ __depends_on__(name) # to get the error message
+ else
+ # Normal dependency
+ __depends_on__(name)
end
-
-
- __depends_on__(name) # to get the error message
end
def depends_on_os_package(name)
depends_on(name)
end
@@ -257,10 +274,14 @@
yield
ensure
@file_stack.pop
end
+ class << self
+ attr_reader :loaded_autobuild_files
+ end
+
def self.import_autobuild_file(source, path)
return if @loaded_autobuild_files.include?(path)
in_package_set(source, File.expand_path(path).gsub(/^#{Regexp.quote(Autoproj.root_dir)}\//, '')) do
begin
@@ -300,12 +321,15 @@
end
package_definition = Autoproj.manifest.package(package_name)
if !package_definition
raise ConfigError.new, "#{package_name} is not a known package"
+ elsif package_definition.autobuild.kind_of?(Autobuild::DummyPackage)
+ # Nothing to do!
+ else
+ package_definition.add_setup_block(block)
end
- package_definition.add_setup_block(block)
end
# Common setup for packages
def package_common(package_type, spec, &block) # :nodoc:
package_name = Autoproj.package_name_from_options(spec)
@@ -317,10 +341,10 @@
return
end
# Check if this package is ignored
- if Autoproj.manifest.ignored?(package_name)
+ if Autoproj.manifest.ignored?(package_name) || Autoproj.manifest.ignored?(Autoproj.current_file[0].name)
return Autoproj.define(:dummy, spec)
end
pkg = Autoproj.define(package_type, spec, &block)
pkg.srcdir = pkg.name