'Parse a repository dependency and return components necessary for proper display
in Galaxy on the Manage repository page.'

def get_components_from_repository_dependency_for_installed_repository(self, repository_dependency):

    prior_installation_required = 'False'
    only_if_compiling_contained_td = 'False'
    if (len(repository_dependency) == 6):
        tool_shed_repository_id = repository_dependency[4]
        installation_status = repository_dependency[5]
        (tool_shed, name, owner, changeset_revision) = repository_dependency[0:4]
        repository_dependency = [tool_shed, name, owner, changeset_revision, prior_installation_required, only_if_compiling_contained_td]
    elif (len(repository_dependency) == 7):
        tool_shed_repository_id = repository_dependency[5]
        installation_status = repository_dependency[6]
        (tool_shed, name, owner, changeset_revision, prior_installation_required) = repository_dependency[0:5]
        repository_dependency = [tool_shed, name, owner, changeset_revision, prior_installation_required, only_if_compiling_contained_td]
    elif (len(repository_dependency) == 8):
        tool_shed_repository_id = repository_dependency[6]
        installation_status = repository_dependency[7]
        repository_dependency = repository_dependency[0:6]
    else:
        tool_shed_repository_id = None
        installation_status = 'unknown'
    if tool_shed_repository_id:
        tool_shed_repository = repository_util.get_tool_shed_repository_by_id(self.app, self.app.security.encode_id(tool_shed_repository_id))
        if tool_shed_repository:
            if tool_shed_repository.missing_repository_dependencies:
                installation_status = ('%s,    missing    repository    dependencies' % installation_status)
            elif tool_shed_repository.missing_tool_dependencies:
                installation_status = ('%s,    missing    tool    dependencies' % installation_status)
    return (tool_shed_repository_id, installation_status, repository_dependency)
