commit/galaxy-central: greg: Fix for installing a repository from the tool shed that includes a repository dependency defintion where the required repository is owned by a user other than the dependent repository.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/8da37d3985ab/ changeset: 8da37d3985ab branch: stable user: greg date: 2013-02-18 21:28:06 summary: Fix for installing a repository from the tool shed that includes a repository dependency defintion where the required repository is owned by a user other than the dependent repository. affected #: 3 files diff -r 337e5b6bd7dc5696087c436e54192149c1bc8bc3 -r 8da37d3985ab9c489760e64d4e3eb707dfbeb4b8 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -714,7 +714,11 @@ for rd_tup in rd_tups: tool_shed, name, owner, changeset_revision = rd_tup # Updates to installed repository revisions may have occurred, so make sure to locate the appropriate repository revision if one exists. - repository, current_changeset_revision = repository_was_previously_installed( trans, tool_shed, name, repo_info_tuple ) + # We need to create a temporary repo_info_tuple that includes the correct repository owner which we get from the current rd_tup. The current + # tuple looks like: ( description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, installed_td ) + tmp_clone_url = suc.generate_clone_url_from_repo_info_tup( rd_tup ) + tmp_repo_info_tuple = ( None, tmp_clone_url, changeset_revision, None, owner, None, None ) + repository, current_changeset_revision = repository_was_previously_installed( trans, tool_shed, name, tmp_repo_info_tuple ) if repository: new_rd_tup = [ tool_shed, name, owner, changeset_revision, repository.id, repository.status ] if repository.status == trans.model.ToolShedRepository.installation_status.INSTALLED: diff -r 337e5b6bd7dc5696087c436e54192149c1bc8bc3 -r 8da37d3985ab9c489760e64d4e3eb707dfbeb4b8 lib/galaxy/util/shed_util_common.py --- a/lib/galaxy/util/shed_util_common.py +++ b/lib/galaxy/util/shed_util_common.py @@ -953,6 +953,12 @@ return '%s://%s%s/repos/%s/%s' % ( protocol, username, base, repository.user.username, repository.name ) else: return '%s/repos/%s/%s' % ( base_url, repository.user.username, repository.name ) +def generate_clone_url_from_repo_info_tup( repo_info_tup ): + """Generate teh URL for cloning a repositoyr given a tuple of toolshed, name, owner, changeset_revision.""" + # Example tuple: ['http://localhost:9009', 'blast_datatypes', 'test', '461a4216e8ab'] + toolshed, name, owner, changeset_revision = repo_info_tup + # Don't include the changeset_revision in clone urls. + return url_join( toolshed, 'repos', owner, name ) def generate_datatypes_metadata( datatypes_config, metadata_dict ): """Update the received metadata_dict with information from the parsed datatypes_config.""" tree = ElementTree.parse( datatypes_config ) diff -r 337e5b6bd7dc5696087c436e54192149c1bc8bc3 -r 8da37d3985ab9c489760e64d4e3eb707dfbeb4b8 lib/galaxy/webapps/community/controllers/repository.py --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -1461,12 +1461,15 @@ repository_clone_url = suc.generate_clone_url_for_repository_in_tool_shed( trans, repository ) repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision ) metadata = repository_metadata.metadata - if not includes_tools and 'tools' in metadata: - includes_tools = True - if not has_repository_dependencies and 'repository_dependencies' in metadata: - has_repository_dependencies = True - if not includes_tool_dependencies and 'tool_dependencies' in metadata: - includes_tool_dependencies = True + if not includes_tools: + if 'tools' in metadata: + includes_tools = True + if not has_repository_dependencies: + if 'repository_dependencies' in metadata: + has_repository_dependencies = True + if not includes_tool_dependencies: + if 'tool_dependencies' in metadata: + includes_tool_dependencies = True repo_dir = repository.repo_path( trans.app ) repo = hg.repository( suc.get_configured_ui(), repo_dir ) ctx = suc.get_changectx_for_changeset( repo, changeset_revision ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket