diff --git a/src/rosdep2/installers.py b/src/rosdep2/installers.py index 27cdb207c..5d3049767 100644 --- a/src/rosdep2/installers.py +++ b/src/rosdep2/installers.py @@ -398,6 +398,18 @@ def get_depends(self, rosdep_args): return rosdep_args.get('depends', []) return [] # Default return empty list + +def normalize_uninstalled_to_list(uninstalled): + uninstalled_dependencies = [] + for pkg_or_list in [v for k, v in uninstalled]: + if isinstance(pkg_or_list, list): + for pkg in pkg_or_list: + uninstalled_dependencies.append(str(pkg)) + else: + uninstalled_dependencies.append(str(pkg)) + return uninstalled_dependencies + + class RosdepInstaller(object): def __init__(self, installer_context, lookup): @@ -484,8 +496,12 @@ def install(self, uninstalled, interactive=True, simulate=False, installer.install(uninstalled) """ if verbose: - print("install options: reinstall[%s] simulate[%s] interactive[%s]"%(reinstall, simulate, interactive)) - print("install: uninstalled keys are %s"%(', '.join([', '.join(pkg) for pkg in [v for k,v in uninstalled]]))) + print( + "install options: reinstall[%s] simulate[%s] interactive[%s]" % + (reinstall, simulate, interactive) + ) + uninstalled_list = normalize_uninstalled_to_list(uninstalled) + print("install: uninstalled keys are %s" % ', '.join(uninstalled_list)) # Squash uninstalled again, in case some dependencies were already installed squashed_uninstalled = [] diff --git a/src/rosdep2/main.py b/src/rosdep2/main.py index 90b55a803..b3e4a3da1 100644 --- a/src/rosdep2/main.py +++ b/src/rosdep2/main.py @@ -60,6 +60,7 @@ from . import create_default_installer_context, get_default_installer from . import __version__ from .core import RosdepInternalError, InstallFailed, UnsupportedOs, InvalidData, CachePermissionError +from .installers import normalize_uninstalled_to_list from .installers import RosdepInstaller from .lookup import RosdepLookup, ResolutionError from .rospkg_loader import DEFAULT_VIEW_KEY @@ -660,7 +661,8 @@ def command_install(lookup, packages, options): uninstalled, errors = installer.get_uninstalled(packages, implicit=options.recursive, verbose=options.verbose) if options.verbose: - print("uninstalled dependencies are: [%s]"%(', '.join([', '.join(pkg) for pkg in [v for k,v in uninstalled]]))) + uninstalled_dependencies = normalize_uninstalled_to_list(uninstalled) + print("uninstalled dependencies are: [%s]" % ', '.join(uninstalled_dependencies)) if errors: err_msg = ("ERROR: the following packages/stacks could not have their "