Skip to content

Commit

Permalink
common: suppressing warnings from catkin-pkg in normal operations
Browse files Browse the repository at this point in the history
  • Loading branch information
jbohren committed Mar 25, 2015
1 parent ddcb7ff commit 9cf5064
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions catkin_tools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,14 @@ def wide_log(msg, **kwargs):
wide_log_fn(msg, **kwargs)


def find_enclosing_package(search_start_path=None):
def find_enclosing_package(search_start_path=None, warnings=None):
"""Get the package containing the current directory."""

search_start_path = search_start_path or os.getcwd()
child_path = ''

while True:
pkgs = find_packages(search_start_path)
pkgs = find_packages(search_start_path, warnings=warnings)

# Check if the previous directory is a catkin package
if child_path in pkgs:
Expand Down
4 changes: 2 additions & 2 deletions catkin_tools/verbs/catkin_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def determine_packages_to_be_built(packages, context):
:rtype: tuple
"""
start = time.time()
workspace_packages = find_packages(context.source_space_abs, exclude_subspaces=True)
workspace_packages = find_packages(context.source_space_abs, exclude_subspaces=True, warnings=[])
# If there are no packages raise
if not workspace_packages:
sys.exit("No packages were found in the source space '{0}'".format(context.source_space_abs))
Expand Down Expand Up @@ -194,7 +194,7 @@ def determine_packages_to_be_built(packages, context):
def _create_unmerged_devel_setup(context):
# Find all of the leaf packages in the workspace
# where leaf means that nothing in the workspace depends on it
workspace_packages = find_packages(context.source_space_abs, exclude_subspaces=True)
workspace_packages = find_packages(context.source_space_abs, exclude_subspaces=True, warnings=[])
ordered_packages = topological_order_packages(workspace_packages)
workspace_packages = dict([(p.name, p) for pth, p in workspace_packages.items()])
dependencies = set([])
Expand Down
2 changes: 1 addition & 1 deletion catkin_tools/verbs/catkin_build/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def main(opts):
if opts.build_this or opts.start_with_this:
# Determine the enclosing package
try:
this_package = find_enclosing_package()
this_package = find_enclosing_package(warnings=[])
except (InvalidPackage, RuntimeError):
this_package = None

Expand Down
3 changes: 2 additions & 1 deletion catkin_tools/verbs/catkin_clean/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def main(opts):
if os.path.exists(ctx.build_space_abs):
# TODO: Check for merged build and report error
# Get all enabled packages in source space
found_source_packages = [pkg.name for (path, pkg) in find_packages(ctx.source_space_abs).items()]
found_source_packages = [
pkg.name for (path, pkg) in find_packages(ctx.source_space_abs, warnings=[]).items()]

# Iterate over all packages with build dirs
print("[clean] Removing orphaned build directories from %s" % ctx.build_space_abs)
Expand Down
2 changes: 1 addition & 1 deletion catkin_tools/verbs/catkin_list/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main(opts):
opts.depends_on = set(opts.depends_on) if opts.depends_on else set()
try:
for folder in folders:
for pkg_pth, pkg in find_packages(folder).items():
for pkg_pth, pkg in find_packages(folder, warnings=[]).items():
build_depend_names = [d.name for d in pkg.build_depends]
is_build_dep = opts.depends_on.intersection(
build_depend_names)
Expand Down

0 comments on commit 9cf5064

Please sign in to comment.