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/9e36d1ed099f/ changeset: 9e36d1ed099f 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 84b6c4608e357a466948d895d90d1a1d77f3cd71 -r 9e36d1ed099fb31eccbc6bf55f20c1bd3fec1773 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -720,7 +720,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 84b6c4608e357a466948d895d90d1a1d77f3cd71 -r 9e36d1ed099fb31eccbc6bf55f20c1bd3fec1773 lib/galaxy/util/shed_util_common.py --- a/lib/galaxy/util/shed_util_common.py +++ b/lib/galaxy/util/shed_util_common.py @@ -1068,6 +1068,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_data_manager_metadata( app, repository, repo_dir, data_manager_config_filename, metadata_dict, shed_config_dict=None ): """Update the received metadata_dict with information from the parsed data_manager_config_filename.""" if data_manager_config_filename is None: diff -r 84b6c4608e357a466948d895d90d1a1d77f3cd71 -r 9e36d1ed099fb31eccbc6bf55f20c1bd3fec1773 lib/galaxy/webapps/community/controllers/repository.py --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -1472,12 +1472,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