Skip to content

Commit

Permalink
updating API to return empty string if nothing to do
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Conley committed Sep 15, 2011
1 parent e04ee5a commit a9e2187
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = 'haiku'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
14 changes: 13 additions & 1 deletion src/rosdep/installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,27 @@ def install(self, uninstalled, interactive=True, simulate=False, continue_on_err

def install_resolved(self, rosdep_key, installer_key, resolved, simulate=False, interactive=True, verbose=False):
"""
Lower-level API for installing a rosdep dependency. The
*rosdep_key* have already been resolved to *installer_key* and
*resolved* via :exc:`RosdepLookup` or other means.
:param rosdep_key: Key of rosdep being installed (for debugging only), ``str``
:param installer_key: Key for installer to apply to *resolved*, ``str``
:param resolved: Opaque resolution list from :class:`RosdepLookup`.
:param interactive: If ``True``, allow interactive prompts (default ``True``)
:param simulate: If ``True``, don't execute installation commands, just print to screen.
:param verbose: If ``True``, print verbose output to screen (default ``False``)
:raises: :exc:`InstallFailed` if *resolved* fail to install.
"""
installer_context = self.installer_context
installer = installer_context.get_installer(installer_key)
command = installer.get_install_command(resolved, interactive=interactive)
if not command:
if verbose:
print("[%s] no packages to install"%(rosdep_key))
return

if simulate or verbose:
print("[%s] Installation command/script:\n"%(rosdep_key)+80*'='+str(command)+80*'=')
if not simulate:
Expand Down
2 changes: 1 addition & 1 deletion src/rosdep/platforms/redhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self):
def get_install_command(self, resolved, interactive=True):
packages = self.get_packages_to_install(resolved)
if not packages:
return "#No Packages to install"
return ''
elif not interactive:
return "#Packages\nsudo yum -y install " + ' '.join(packages)
else:
Expand Down

0 comments on commit a9e2187

Please sign in to comment.