commit/galaxy-central: greg: Do not display the same repository multiple times on the Monitor installing tool shed repositories page when installing / reinstalling repositories into Galaxy.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/cf08022b6892/ Changeset: cf08022b6892 User: greg Date: 2013-08-05 20:05:38 Summary: Do not display the same repository multiple times on the Monitor installing tool shed repositories page when installing / reinstalling repositories into Galaxy. Affected #: 3 files diff -r 901808e8e65eed49de6cb42f2cd1ebac0d5eabb8 -r cf08022b68927bebe340c976e6d5eb7a657de7d6 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -1054,18 +1054,19 @@ no_changes_checked=no_changes_checked, tool_panel_section=tool_panel_section, new_tool_panel_section=new_tool_panel_section ) - # The repository's status must be updated from 'Uninstall' to 'New' when initiating reinstall so the repository_installation_updater will function. - tool_shed_repository = suc.create_or_update_tool_shed_repository( trans.app, - tool_shed_repository.name, - tool_shed_repository.description, - tool_shed_repository.installed_changeset_revision, - tool_shed_repository.ctx_rev, - repository_clone_url, - metadata, - trans.model.ToolShedRepository.installation_status.NEW, - tool_shed_repository.installed_changeset_revision, - tool_shed_repository.owner, - tool_shed_repository.dist_to_shed ) + if tool_shed_repository.status == trans.model.ToolShedRepository.installation_status.UNINSTALLED: + # The repository's status must be updated from 'Uninstalled' to 'New' when initiating reinstall so the repository_installation_updater will function. + tool_shed_repository = suc.create_or_update_tool_shed_repository( trans.app, + tool_shed_repository.name, + tool_shed_repository.description, + tool_shed_repository.installed_changeset_revision, + tool_shed_repository.ctx_rev, + repository_clone_url, + metadata, + trans.model.ToolShedRepository.installation_status.NEW, + tool_shed_repository.installed_changeset_revision, + tool_shed_repository.owner, + tool_shed_repository.dist_to_shed ) ctx_rev = suc.get_ctx_rev( trans.app, tool_shed_url, tool_shed_repository.name, @@ -1096,7 +1097,8 @@ repository_metadata=None, tool_dependencies=tool_dependencies, repository_dependencies=repository_dependencies ) - repo_info_dicts.append( repo_info_dict ) + if repo_info_dict not in repo_info_dicts: + repo_info_dicts.append( repo_info_dict ) # Make sure all tool_shed_repository records exist. created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts = \ repository_dependency_util.create_repository_dependency_objects( trans=trans, @@ -1107,7 +1109,7 @@ install_repository_dependencies=install_repository_dependencies, no_changes_checked=no_changes_checked, tool_panel_section=tool_panel_section, - new_tool_panel_section=new_tool_panel_section ) + new_tool_panel_section=new_tool_panel_section ) # Default the selected tool panel location for loading tools included in each newly installed required tool shed repository to the location # selected for the repository selected for reinstallation. for index, tps_key in enumerate( tool_panel_section_keys ): diff -r 901808e8e65eed49de6cb42f2cd1ebac0d5eabb8 -r cf08022b68927bebe340c976e6d5eb7a657de7d6 lib/tool_shed/util/repository_dependency_util.py --- a/lib/tool_shed/util/repository_dependency_util.py +++ b/lib/tool_shed/util/repository_dependency_util.py @@ -231,14 +231,16 @@ current_changeset_revision=changeset_revision, owner=repository_owner, dist_to_shed=False ) - # Add the processed tool shed repository to the list of all processed repositories maintained within this method. - all_created_or_updated_tool_shed_repositories.append( tool_shed_repository ) + if tool_shed_repository not in all_created_or_updated_tool_shed_repositories: + # Add the processed tool shed repository to the list of all processed repositories maintained within this method. + all_created_or_updated_tool_shed_repositories.append( tool_shed_repository ) # Only append the tool shed repository to the list of created_or_updated_tool_shed_repositories if it is supposed to be installed. if install_repository_dependencies or is_in_repo_info_dicts( repo_info_dict, repo_info_dicts ): - # Keep the one-to-one mapping between items in 3 lists. - created_or_updated_tool_shed_repositories.append( tool_shed_repository ) - tool_panel_section_keys.append( tool_panel_section_key ) - filtered_repo_info_dicts.append( repo_info_dict ) + if tool_shed_repository not in created_or_updated_tool_shed_repositories: + # Keep the one-to-one mapping between items in 3 lists. + created_or_updated_tool_shed_repositories.append( tool_shed_repository ) + tool_panel_section_keys.append( tool_panel_section_key ) + filtered_repo_info_dicts.append( repo_info_dict ) # Build repository dependency relationships even if the user chose to not install repository dependencies. build_repository_dependency_relationships( trans, all_repo_info_dicts, all_created_or_updated_tool_shed_repositories ) return created_or_updated_tool_shed_repositories, tool_panel_section_keys, all_repo_info_dicts, filtered_repo_info_dicts diff -r 901808e8e65eed49de6cb42f2cd1ebac0d5eabb8 -r cf08022b68927bebe340c976e6d5eb7a657de7d6 lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -242,7 +242,7 @@ """ # The received value for dist_to_shed will be True if the InstallManager is installing a repository that contains tools or datatypes that used # to be in the Galaxy distribution, but have been moved to the main Galaxy tool shed. - log.debug( "Adding new row (or updating an existing row) for repository '%s' in the tool_shed_repository table." % name ) + log.debug( "Adding new row (or updating an existing row) for repository '%s' in the tool_shed_repository table, status set to '%s'." % ( str( name ), str( status ) ) ) if current_changeset_revision is None: # The current_changeset_revision is not passed if a repository is being installed for the first time. If a previously installed repository # was later uninstalled, this value should be received as the value of that change set to which the repository had been updated just prior 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)
-
commits-noreply@bitbucket.org