Skip to content

Commit

Permalink
fix: add flag to disable the osdeps override warnings
Browse files Browse the repository at this point in the history
It's a common usage pattern, and `autoproj show` allows to see it.
  • Loading branch information
doudou committed Oct 23, 2024
1 parent 902c3f8 commit e941824
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions lib/autoproj/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,28 @@ def prefix_dir=(path)
set("prefix", path, true)
end

# Whether Autoproj should warn if a package set overrides the osdep of
# another
#
# It is true for historical reasons. Set this to false in your
# workspace's init.rb for the new behavior
#
# @see osdeps_warn_overrides=
def osdeps_warn_overrides?
get "osdeps_warn_overrides", true
end

# Sets whether Autoproj should warn if a package set overrides the osdep
# of another
#
# It is true for historical reasons. Set this to false in your
# workspace's init.rb for the new behavior
#
# @see osdeps_warn_overrides?
def osdeps_warn_overrides=(flag)
set "osdeps_warn_overrides", flag
end

# The directory in which packages will be installed.
#
# If it is a relative path, it is relative to the root dir of the
Expand Down
4 changes: 3 additions & 1 deletion lib/autoproj/os_package_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ def invalidate_resolve_package_cache
# takes precedence
def merge(info, suffixes: [])
@definitions = definitions.merge(info.definitions) do |h, v1, v2|
warn_about_merge_collisions(info, suffixes, h, v1, v2) if v1 != v2
if v1 != v2 && ws.config.osdeps_warn_overrides?
warn_about_merge_collisions(info, suffixes, h, v1, v2)
end
v2
end
invalidate_resolve_package_cache
Expand Down

0 comments on commit e941824

Please sign in to comment.