'Compare the last saved metadata for each tool dependency in the repository with the new
metadata in self.metadata_dict to determine if a new repository_metadata table record is
required or if the last saved metadata record can be updated for tool_dependencies instead.'

def new_tool_dependency_metadata_required(self, repository_metadata):

    if repository_metadata:
        metadata = repository_metadata.metadata
        if metadata:
            if ('tool_dependencies' in metadata):
                saved_tool_dependencies = metadata['tool_dependencies']
                new_tool_dependencies = self.metadata_dict.get('tool_dependencies', None)
                if new_tool_dependencies:
                    for saved_tool_dependency in saved_tool_dependencies:
                        if (saved_tool_dependency not in new_tool_dependencies):
                            return True
                    return False
                else:
                    return True
            else:
                return False
        else:
            return False
    elif ('tool_dependencies' in self.metadata_dict):
        return True
    else:
        return False
