1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f2731f3baec8/ Changeset: f2731f3baec8 User: greg Date: 2013-12-13 16:35:49 Summary: Use tuples to define objects in Galaxy's installed_repository_manager. Affected #: 7 files diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 lib/galaxy/model/tool_shed_install/__init__.py --- a/lib/galaxy/model/tool_shed_install/__init__.py +++ b/lib/galaxy/model/tool_shed_install/__init__.py @@ -66,58 +66,47 @@ # contents (i.e., tool dependencies) require it. if self.status == self.installation_status.UNINSTALLED: return False + this_repository_tup = ( str( self.tool_shed ), + str( self.name ), + str( self.owner ), + str( self.installed_changeset_revision ) ) irm = app.installed_repository_manager # See if this repository's current dependencies are restricted to a single circular relationship. This # means that this repository has a single repository dependency which itself depends upon this repository. - # The repository dependency may have other dependent repositories, but that is not relevant here. - single_repository_dependency = None - for repository in irm.installed_repository_dependencies_of_installed_repositories: - if repository.id == self.id: - installed_repository_dependencies = irm.installed_repository_dependencies_of_installed_repositories[ repository ] - # If this repository defines a circular relationship to another repository, then the list of installed - # repository dependencies will include itself. - if len( installed_repository_dependencies ) == 2: - installed_repository_dependency_ids = [ rd.id for rd in installed_repository_dependencies ] - if self.id in installed_repository_dependency_ids: - # We have a single circular dependency definition, so get the other repository. - for installed_repository_dependency in installed_repository_dependencies: - if installed_repository_dependency != self.id: - single_repository_dependency = installed_repository_dependency - break - if single_repository_dependency is not None: - for repository in irm.installed_repository_dependencies_of_installed_repositories: - if repository.id == single_repository_dependency.id: - installed_repository_dependencies = irm.installed_repository_dependencies_of_installed_repositories[ repository ] - installed_repository_dependency_ids = [ rd.id for rd in installed_repository_dependencies ] - if self.id in installed_repository_dependency_ids: - # This repository is a dependency of the single repository upon which it depends, so we have - # a single circular relationship and this repository can be uninstalled. - return True + # The repository dependency may have other repository dependencies, but that is not relevant here. + single_repository_dependency_tup = None + installed_repository_dependency_tups = \ + irm.installed_repository_dependencies_of_installed_repositories.get( this_repository_tup, [] ) + # If this repository defines a circular relationship to another repository, then the list of tuples + # defining installed repository dependencies will include itself. + if len( installed_repository_dependency_tups ) == 2: + if this_repository_tup in installed_repository_dependency_tups: + # We have a single circular dependency definition, so get the other repository. + for installed_repository_dependency_tup in installed_repository_dependency_tups: + if installed_repository_dependency_tup != this_repository_tup: + single_repository_dependency_tup = installed_repository_dependency_tup + break + if single_repository_dependency_tup is not None: + installed_repository_dependency_tups = \ + irm.installed_repository_dependencies_of_installed_repositories.get( this_repository_tup, [] ) + if this_repository_tup in installed_repository_dependency_tups: + # This repository is a dependency of the single repository upon which it depends, so we have + # a single circular relationship and this repository can be uninstalled. + return True # Find other installed repositories that require this repository. - for repository in irm.installed_dependent_repositories_of_installed_repositories: - if repository.id == self.id: - installed_dependent_repositories = \ - irm.installed_dependent_repositories_of_installed_repositories[ repository ] - if installed_dependent_repositories: - # This repository cannot be uninstalled because other installed repositories require it. - return False + installed_dependent_repositories = \ + irm.installed_dependent_repositories_of_installed_repositories.get( this_repository_tup, [] ) + if installed_dependent_repositories: + # This repository cannot be uninstalled because other installed repositories require it. + return False # Find installed tool dependencies that require this repository's installed tool dependencies. - installed_tool_dependencies = [] - for repository in irm.installed_tool_dependencies_of_installed_repositories: - if repository.id == self.id: - installed_tool_dependencies = \ - irm.installed_tool_dependencies_of_installed_repositories[ repository ] - break - for td in installed_tool_dependencies: - if td.id in irm.ids_of_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies_keys: - for installed_td in irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies: - if installed_td.id == td.id: - installed_dependent_tds = \ - irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ installed_td ] - if installed_dependent_tds: - # This repository cannot be uninstalled because it contains installed tool dependencies that - # are required at run time by other installed tool dependencies. - return False + installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories.get( this_repository_tup, [] ) + for td_tup in installed_tool_dependencies: + installed_dependent_td_tups = irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.get( td_tup, [] ) + if installed_dependent_td_tups: + # This repository cannot be uninstalled because it contains installed tool dependencies that + # are required at run time by other installed tool dependencies. + return False return True @property diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 lib/tool_shed/galaxy_install/installed_repository_manager.py --- a/lib/tool_shed/galaxy_install/installed_repository_manager.py +++ b/lib/tool_shed/galaxy_install/installed_repository_manager.py @@ -17,13 +17,13 @@ def __init__( self, app ): """ - Among other things, eep in in-memory set of installed repositories and tool dependencies along with the relationships - between each of them. This will allow for quick discovery of those repositories or components that can be uninstalled. - The feature allowing a Galaxy administrator to uninstall a repository should not be available to repositories or tool - dependency packages that are required by other repositories or their contents (packages). The uninstall feature should - be available only at the repository hierarchy level where every dependency will be uninstalled. The exception for this - is if an item (repository or tool dependency package) is not in an INSTALLED state - in these cases, the specific item - can be uninstalled in order to attempt re-installation. + Among other things, keep in in-memory sets of tuples defining installed repositories and tool dependencies along with + the relationships between each of them. This will allow for quick discovery of those repositories or components that + can be uninstalled. The feature allowing a Galaxy administrator to uninstall a repository should not be available to + repositories or tool dependency packages that are required by other repositories or their contents (packages). The + uninstall feature should be available only at the repository hierarchy level where every dependency will be uninstalled. + The exception for this is if an item (repository or tool dependency package) is not in an INSTALLED state - in these + cases, the specific item can be uninstalled in order to attempt re-installation. """ self.app = app self.install_model = self.app.install_model @@ -32,32 +32,35 @@ if self.app.config.migrated_tools_config not in self.tool_configs: self.tool_configs.append( self.app.config.migrated_tools_config ) self.installed_repository_dicts = [] - # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values - # are a list of tool_shed_repository objects (whose status can be anything) required by the key. The value defines the - # entire repository dependency tree. + # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed') + # and whose values are a list of tuples defining tool_shed_repository objects (whose status can be anything) required by + # the key. The value defines the entire repository dependency tree. self.repository_dependencies_of_installed_repositories = {} - # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values - # are a list of tool_shed_repository objects (whose status is 'Installed') required by the key. The value defines the - # entire repository dependency tree. + # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed') + # and whose values are a list of tuples defining tool_shed_repository objects (whose status is 'Installed') required by + # the key. The value defines the entire repository dependency tree. self.installed_repository_dependencies_of_installed_repositories = {} - # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values - # are a list of tool_shed_repository objects (whose status is 'Installed') that require the key. + # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed') + # and whose values are a list of tuples defining tool_shed_repository objects (whose status is 'Installed') that require + # the key. self.installed_dependent_repositories_of_installed_repositories = {} - # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values - # are a list of its immediate tool_dependency objects (whose status can be anything). The value defines only the immediate - # tool dependencies of the repository and does not include any dependencies of the tool dependencies. + # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed') + # and whose values are a list of tuples defining its immediate tool_dependency objects (whose status can be anything). + # The value defines only the immediate tool dependencies of the repository and does not include any dependencies of the + # tool dependencies. self.tool_dependencies_of_installed_repositories = {} - # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values - # are a list of its immediate tool_dependency objects (whose status is 'Installed'). The value defines only the immediate - # tool dependencies of the repository and does not include any dependencies of the tool dependencies. + # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed') + # and whose values are a list of tuples defining its immediate tool_dependency objects (whose status is 'Installed'). + # The value defines only the immediate tool dependencies of the repository and does not include any dependencies of the + # tool dependencies. self.installed_tool_dependencies_of_installed_repositories = {} - # Keep an in-memory dictionary whose keys are tool_dependency objects (whose status is 'Installed') and whose values are - # a list of tool_dependency objects (whose status can be anything) required by the installed tool dependency at runtime. - # The value defines the entire tool dependency tree. + # Keep an in-memory dictionary whose keys are tuples defining tool_dependency objects (whose status is 'Installed') and + # whose values are a list of tuples defining tool_dependency objects (whose status can be anything) required by the + # installed tool dependency at runtime. The value defines the entire tool dependency tree. self.runtime_tool_dependencies_of_installed_tool_dependencies = {} - # Keep an in-memory dictionary whose keys are tool_dependency objects (whose status is 'Installed') and whose values are - # a list of tool_dependency objects (whose status is 'Installed') that require the key at runtime. The value defines the - # entire tool dependency tree. + # Keep an in-memory dictionary whose keys are tuples defining tool_dependency objects (whose status is 'Installed') and + # whose values are a list of tuples defining tool_dependency objects (whose status is 'Installed') that require the key + # at runtime. The value defines the entire tool dependency tree. self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies = {} # Load defined dependency relationships for installed tool shed repositories and their contents. self.load_dependency_relationships() @@ -68,101 +71,100 @@ is the population of self.installed_dependent_repositories_of_installed_repositories. Since this method discovers all repositories required by the received repository, it can use the list to add entries to the reverse dictionary. """ + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + tool_shed, name, owner, installed_changeset_revision = repository_tup # Get the list of repository dependencies for this repository. status = self.install_model.ToolShedRepository.installation_status.INSTALLED - repository_dependency_tree = \ - repository_dependency_util.get_repository_dependency_tree_for_repository( self.app, - repository, - status=status ) + repository_dependency_tups = \ + repository_dependency_util.get_repository_dependency_tups_for_repository( self.app, repository, status=status ) # Add an entry to self.installed_repository_dependencies_of_installed_repositories. - if repository.id not in self.ids_of_installed_repository_dependencies_of_installed_repositories_keys: - debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) + if repository_tup not in self.installed_repository_dependencies_of_installed_repositories: + debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner ) debug_msg += "to installed_repository_dependencies_of_installed_repositories." log.debug( debug_msg ) - self.installed_repository_dependencies_of_installed_repositories[ repository ] = \ - repository_dependency_tree - # Use the repository_dependency_tree to add entries to the reverse dictionary + self.installed_repository_dependencies_of_installed_repositories[ repository_tup ] = repository_dependency_tups + # Use the repository_dependency_tups to add entries to the reverse dictionary # self.installed_dependent_repositories_of_installed_repositories. - for required_repository in repository_dependency_tree: - debug_msg = "Appending revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) + for required_repository_tup in repository_dependency_tups: + debug_msg = "Appending revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner ) debug_msg += "to all dependent repositories in installed_dependent_repositories_of_installed_repositories." log.debug( debug_msg ) - if required_repository.id in self.ids_of_installed_dependent_repositories_of_installed_repositories_keys: - for rd in self.installed_dependent_repositories_of_installed_repositories: - if rd.id == required_repository.id: - self.installed_dependent_repositories_of_installed_repositories[ rd ].append( repository ) - break + if required_repository_tup in self.installed_dependent_repositories_of_installed_repositories: + self.installed_dependent_repositories_of_installed_repositories[ required_repository_tup ].append( repository_tup ) else: - self.installed_dependent_repositories_of_installed_repositories[ required_repository ] = [ repository ] + self.installed_dependent_repositories_of_installed_repositories[ required_repository_tup ] = [ repository_tup ] def add_entry_to_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ): """Add an entry to self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.""" - if tool_dependency.id not in self.ids_of_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies_keys: - debug_msg = "Adding an entry for version %s of %s %s " % \ - ( str( tool_dependency.version ), str( tool_dependency.type ), str( tool_dependency.name ) ) + tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ) + if tool_dependency_tup not in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies: + tool_shed_repository_id, name, version, type = tool_dependency_tup + debug_msg = "Adding an entry for version %s of %s %s " % ( version, type, name ) debug_msg += "to installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies." log.debug( debug_msg ) status = self.install_model.ToolDependency.installation_status.INSTALLED - installed_runtime_dependent_tool_dependencies = \ - tool_dependency_util.get_runtime_dependent_tool_dependencies( self.app, tool_dependency, status=status ) - self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ tool_dependency ] = \ - installed_runtime_dependent_tool_dependencies + installed_runtime_dependent_tool_dependency_tups = \ + tool_dependency_util.get_runtime_dependent_tool_dependency_tuples( self.app, tool_dependency, status=status ) + self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ] = \ + installed_runtime_dependent_tool_dependency_tups def add_entry_to_installed_tool_dependencies_of_installed_repositories( self, repository ): """Add an entry to self.installed_tool_dependencies_of_installed_repositories.""" - if repository.id not in self.ids_of_installed_tool_dependencies_of_installed_repositories_keys: - debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + if repository_tup not in self.installed_tool_dependencies_of_installed_repositories: + tool_shed, name, owner, installed_changeset_revision = repository_tup + debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner ) debug_msg += "to installed_tool_dependencies_of_installed_repositories." log.debug( debug_msg ) - installed_tool_dependencies = [] - for td in repository.tool_dependencies: - if td.status == self.app.install_model.ToolDependency.installation_status.INSTALLED: - installed_tool_dependencies.append( td ) - self.installed_tool_dependencies_of_installed_repositories[ repository ] = installed_tool_dependencies + installed_tool_dependency_tups = [] + for tool_dependency in repository.tool_dependencies: + if tool_dependency.status == self.app.install_model.ToolDependency.installation_status.INSTALLED: + tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ) + installed_tool_dependency_tups.append( tool_dependency_tup ) + self.installed_tool_dependencies_of_installed_repositories[ repository_tup ] = installed_tool_dependency_tups def add_entry_to_repository_dependencies_of_installed_repositories( self, repository ): """Add an entry to self.repository_dependencies_of_installed_repositories.""" - if repository.id not in self.ids_of_repository_dependencies_of_installed_repositories_keys: - debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + if repository_tup not in self.repository_dependencies_of_installed_repositories: + tool_shed, name, owner, installed_changeset_revision = repository_tup + debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner ) debug_msg += "to repository_dependencies_of_installed_repositories." log.debug( debug_msg ) - repository_dependency_tree = \ - repository_dependency_util.get_repository_dependency_tree_for_repository( self.app, - repository, - status=None ) - self.repository_dependencies_of_installed_repositories[ repository ] = repository_dependency_tree + repository_dependency_tups = \ + repository_dependency_util.get_repository_dependency_tups_for_repository( self.app, repository, status=None ) + self.repository_dependencies_of_installed_repositories[ repository_tup ] = repository_dependency_tups def add_entry_to_runtime_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ): """Add an entry to self.runtime_tool_dependencies_of_installed_tool_dependencies.""" - if tool_dependency.id not in self.ids_of_runtime_tool_dependencies_of_installed_tool_dependencies_keys: - debug_msg = "Adding an entry for version %s of %s %s " % \ - ( str( tool_dependency.version ), str( tool_dependency.type ), str( tool_dependency.name ) ) + tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ) + if tool_dependency_tup not in self.runtime_tool_dependencies_of_installed_tool_dependencies: + tool_shed_repository_id, name, version, type = tool_dependency_tup + debug_msg = "Adding an entry for version %s of %s %s " % ( version, type, name ) debug_msg += "to runtime_tool_dependencies_of_installed_tool_dependencies." log.debug( debug_msg ) - runtime_dependent_tool_dependencies = \ - tool_dependency_util.get_runtime_dependent_tool_dependencies( self.app, tool_dependency, status=None ) - self.runtime_tool_dependencies_of_installed_tool_dependencies[ tool_dependency ] = \ - runtime_dependent_tool_dependencies + runtime_dependent_tool_dependency_tups = \ + tool_dependency_util.get_runtime_dependent_tool_dependency_tuples( self.app, tool_dependency, status=None ) + self.runtime_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ] = \ + runtime_dependent_tool_dependency_tups def add_entry_to_tool_dependencies_of_installed_repositories( self, repository ): """Add an entry to self.tool_dependencies_of_installed_repositories.""" - if repository.id not in self.ids_of_tool_dependencies_of_installed_repositories_keys: - debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + if repository_tup not in self.tool_dependencies_of_installed_repositories: + tool_shed, name, owner, installed_changeset_revision = repository_tup + debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner ) debug_msg += "to tool_dependencies_of_installed_repositories." log.debug( debug_msg ) - self.tool_dependencies_of_installed_repositories[ repository ] = repository.tool_dependencies + tool_dependency_tups = [] + for tool_dependency in repository.tool_dependencies: + tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ) + tool_dependency_tups.append( tool_dependency_tup ) + self.tool_dependencies_of_installed_repositories[ repository_tup ] = tool_dependency_tups - def get_containing_repository_for_tool_dependency( self, tool_dependency ): - for installed_repository, tool_dependencies in self.tool_dependencies_of_installed_repositories.items(): - td_ids = [ td.id for td in tool_dependencies ] - if tool_dependency.id in td_ids: - return installed_repository - return None + def get_containing_repository_for_tool_dependency( self, tool_dependency_tup ): + tool_shed_repository_id, name, version, type = tool_dependency_tup + return self.app.install_model.context.query( self.app.install_model.ToolShedRepository ).get( tool_shed_repository_id ) def get_repository_install_dir( self, tool_shed_repository ): for tool_config in self.tool_configs: @@ -176,9 +178,9 @@ relative_path = os.path.join( tool_path, ts, 'repos', - tool_shed_repository.owner, - tool_shed_repository.name, - tool_shed_repository.installed_changeset_revision ) + str( tool_shed_repository.owner ), + str( tool_shed_repository.name ), + str( tool_shed_repository.installed_changeset_revision ) ) if os.path.exists( relative_path ): return relative_path return None @@ -202,19 +204,18 @@ def handle_repository_uninstall( self, repository ): """Remove the dependency relationships for a repository that was just uninstalled.""" for tool_dependency in repository.tool_dependencies: + tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ) # Remove this tool_dependency from all values in # self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies = {} - for td, installed_runtime_dependent_tool_dependencies in \ + for td_tup, installed_runtime_dependent_tool_dependency_tups in \ self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.items(): - irdtd_ids = [ irdtd.id for irdtd in installed_runtime_dependent_tool_dependencies ] - if td.id in irdtd_ids: - index = irdtd_ids[ td.id ] + if tool_dependency_tup in installed_runtime_dependent_tool_dependency_tups: # Remove the tool_dependency from the list. - del installed_runtime_dependent_tool_dependencies[ index ] + installed_runtime_dependent_tool_dependency_tups.remove( tool_dependency_tup ) # Add the possibly altered list to the altered dictionary. - altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td ] = \ - installed_runtime_dependent_tool_dependencies + altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td_tup ] = \ + installed_runtime_dependent_tool_dependency_tups self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies = \ altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies # Remove the entry for this tool_dependency from self.runtime_tool_dependencies_of_installed_tool_dependencies. @@ -239,38 +240,12 @@ # Populate self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies. self.add_entry_to_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( tool_dependency ) # Populate self.installed_tool_dependencies_of_installed_repositories. - for r in self.installed_tool_dependencies_of_installed_repositories: - if r.id == repository.id: - self.installed_tool_dependencies_of_installed_repositories[ r ].append( tool_dependency ) - break - - @property - def ids_of_installed_dependent_repositories_of_installed_repositories_keys( self ): - return [ r.id for r in self.installed_dependent_repositories_of_installed_repositories.keys() ] - - @property - def ids_of_installed_repository_dependencies_of_installed_repositories_keys( self ): - return [ r.id for r in self.installed_repository_dependencies_of_installed_repositories.keys() ] - - @property - def ids_of_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies_keys( self ): - return [ td.id for td in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.keys() ] - - @property - def ids_of_installed_tool_dependencies_of_installed_repositories_keys( self ): - return [ r.id for r in self.installed_tool_dependencies_of_installed_repositories.keys() ] - - @property - def ids_of_repository_dependencies_of_installed_repositories_keys( self ): - return [ r.id for r in self.repository_dependencies_of_installed_repositories.keys() ] - - @property - def ids_of_runtime_tool_dependencies_of_installed_tool_dependencies_keys( self ): - return [ td.id for td in self.runtime_tool_dependencies_of_installed_tool_dependencies.keys() ] - - @property - def ids_of_tool_dependencies_of_installed_repositories_keys( self ): - return [ r.id for r in self.tool_dependencies_of_installed_repositories.keys() ] + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ) + if repository_tup in self.installed_tool_dependencies_of_installed_repositories: + self.installed_tool_dependencies_of_installed_repositories[ repository_tup ].append( tool_dependency_tup ) + else: + self.installed_tool_dependencies_of_installed_repositories[ repository_tup ] = [ tool_dependency_tup ] def load_dependency_relationships( self ): """Load relationships for all installed repositories and tool dependencies into in-memnory dictionaries.""" @@ -318,82 +293,76 @@ Remove an entry from self.installed_repository_dependencies_of_installed_repositories. A side-effect of this method is removal of appropriate value items from self.installed_dependent_repositories_of_installed_repositories. """ - # Remove this repository from value lists in self.installed_dependent_repositories_of_installed_repositories. - for r, v in self.installed_dependent_repositories_of_installed_repositories.items(): - rd_ids = [ rd.id for rd in v ] - if repository.id in rd_ids: + # Remove tuples defining this repository from value lists in self.installed_dependent_repositories_of_installed_repositories. + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + tool_shed, name, owner, installed_changeset_revision = repository_tup + altered_installed_dependent_repositories_of_installed_repositories = {} + for r_tup, v_tups in self.installed_dependent_repositories_of_installed_repositories.items(): + if repository_tup in v_tups: debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) + ( installed_changeset_revision, name, owner ) + r_tool_shed, r_name, r_owner, r_installed_changeset_revision = r_tup debug_msg += "from the dependent list for revision %s of repository %s owned by %s " % \ - ( str( r.changeset_revision ), str( r.name ), str( r.owner ) ) + ( r_installed_changeset_revision, r_name, r_owner ) debug_msg += "in installed_repository_dependencies_of_installed_repositories." - log.debug( debug_msg ) - new_v = [] - for rd in v: - if rd.id != repository.id: - new_v.append( rd ) - self.installed_dependent_repositories_of_installed_repositories[ r ] = new_v + log.debug( debug_msg ) + v_tups.remove( repository_tup ) + altered_installed_dependent_repositories_of_installed_repositories[ r_tup ] = v_tups + self.installed_dependent_repositories_of_installed_repositories = \ + altered_installed_dependent_repositories_of_installed_repositories # Remove this repository's entry from self.installed_repository_dependencies_of_installed_repositories. - for r in self.installed_repository_dependencies_of_installed_repositories: - if r.id == repository.id: - debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) - debug_msg += "from installed_repository_dependencies_of_installed_repositories." - log.debug( debug_msg ) - del self.installed_repository_dependencies_of_installed_repositories[ r ] - break + if repository_tup in self.installed_repository_dependencies_of_installed_repositories: + debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner ) + debug_msg += "from installed_repository_dependencies_of_installed_repositories." + log.debug( debug_msg ) + del self.installed_repository_dependencies_of_installed_repositories[ repository_tup ] def remove_entry_from_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ): """Remove an entry from self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.""" - for td in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies: - if td.id == tool_dependency.id: - debug_msg = "Removing entry for version %s of %s %s " % \ - ( str( tool_dependency.version ), str( tool_dependency.type ), str( tool_dependency.name ) ) - debug_msg += "from installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies." - log.debug( debug_msg ) - del self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td ] - break + tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ) + if tool_dependency_tup in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies: + tool_shed_repository_id, name, version, type = tool_dependency_tup + debug_msg = "Removing entry for version %s of %s %s " % ( version, type, name ) + debug_msg += "from installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies." + log.debug( debug_msg ) + del self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ] def remove_entry_from_installed_tool_dependencies_of_installed_repositories( self, repository ): """Remove an entry from self.installed_tool_dependencies_of_installed_repositories.""" - for r in self.installed_tool_dependencies_of_installed_repositories: - if r.id == repository.id: - debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) - debug_msg += "from installed_tool_dependencies_of_installed_repositories." - log.debug( debug_msg ) - del self.installed_tool_dependencies_of_installed_repositories[ r ] - break + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + if repository_tup in self.installed_tool_dependencies_of_installed_repositories: + tool_shed, name, owner, installed_changeset_revision = repository_tup + debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner ) + debug_msg += "from installed_tool_dependencies_of_installed_repositories." + log.debug( debug_msg ) + del self.installed_tool_dependencies_of_installed_repositories[ repository_tup ] def remove_entry_from_repository_dependencies_of_installed_repositories( self, repository ): """Remove an entry from self.repository_dependencies_of_installed_repositories.""" - for r in self.repository_dependencies_of_installed_repositories: - if r.id == repository.id: - debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) - debug_msg += "from repository_dependencies_of_installed_repositories." - log.debug( debug_msg ) - del self.repository_dependencies_of_installed_repositories[ r ] - break + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + if repository_tup in self.repository_dependencies_of_installed_repositories: + tool_shed, name, owner, installed_changeset_revision = repository_tup + debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner ) + debug_msg += "from repository_dependencies_of_installed_repositories." + log.debug( debug_msg ) + del self.repository_dependencies_of_installed_repositories[ repository_tup ] def remove_entry_from_runtime_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ): """Remove an entry from self.runtime_tool_dependencies_of_installed_tool_dependencies.""" - for td in self.runtime_tool_dependencies_of_installed_tool_dependencies: - if td.id == tool_dependency.id: - debug_msg = "Removing entry for version %s of %s %s " % \ - ( str( tool_dependency.version ), str( tool_dependency.type ), str( tool_dependency.name ) ) - debug_msg += "from runtime_tool_dependencies_of_installed_tool_dependencies." - log.debug( debug_msg ) - del self.runtime_tool_dependencies_of_installed_tool_dependencies[ td ] - break + tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ) + if tool_dependency_tup in self.runtime_tool_dependencies_of_installed_tool_dependencies: + tool_shed_repository_id, name, version, type = tool_dependency_tup + debug_msg = "Removing entry for version %s of %s %s from runtime_tool_dependencies_of_installed_tool_dependencies." % \ + ( version, type, name ) + log.debug( debug_msg ) + del self.runtime_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ] def remove_entry_from_tool_dependencies_of_installed_repositories( self, repository ): """Remove an entry from self.tool_dependencies_of_installed_repositories.""" - for r in self.tool_dependencies_of_installed_repositories: - if r.id == repository.id: - debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \ - ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) ) - debug_msg += "from tool_dependencies_of_installed_repositories." - log.debug( debug_msg ) - del self.tool_dependencies_of_installed_repositories[ r ] - break + repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository ) + if repository_tup in self.tool_dependencies_of_installed_repositories: + tool_shed, name, owner, installed_changeset_revision = repository_tup + debug_msg = "Removing entry for revision %s of repository %s owned by %s from tool_dependencies_of_installed_repositories." % \ + ( installed_changeset_revision, name, owner ) + log.debug( debug_msg ) + del self.tool_dependencies_of_installed_repositories[ repository_tup ] diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 lib/tool_shed/util/common_install_util.py --- a/lib/tool_shed/util/common_install_util.py +++ b/lib/tool_shed/util/common_install_util.py @@ -71,8 +71,8 @@ def get_dependencies_for_repository( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ): """ - Return dictionaries containing the sets of installed and missing tool dependencies and repository dependencies associated with the repository defined - by the received repo_info_dict. + Return dictionaries containing the sets of installed and missing tool dependencies and repository dependencies associated + with the repository defined by the received repo_info_dict. """ repository = None installed_rd = {} @@ -102,7 +102,8 @@ # Discover all repository dependencies and retrieve information for installing them. all_repo_info_dict = get_required_repo_info_dicts( trans, tool_shed_url, util.listify( repo_info_dict ) ) has_repository_dependencies = all_repo_info_dict.get( 'has_repository_dependencies', False ) - has_repository_dependencies_only_if_compiling_contained_td = all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False ) + has_repository_dependencies_only_if_compiling_contained_td = \ + all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False ) includes_tools_for_display_in_tool_panel = all_repo_info_dict.get( 'includes_tools_for_display_in_tool_panel', False ) includes_tool_dependencies = all_repo_info_dict.get( 'includes_tool_dependencies', False ) includes_tools = all_repo_info_dict.get( 'includes_tools', False ) @@ -138,7 +139,8 @@ # We have a single repository with (possibly) no defined repository dependencies. all_repo_info_dict = get_required_repo_info_dicts( trans, tool_shed_url, util.listify( repo_info_dict ) ) has_repository_dependencies = all_repo_info_dict.get( 'has_repository_dependencies', False ) - has_repository_dependencies_only_if_compiling_contained_td = all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False ) + has_repository_dependencies_only_if_compiling_contained_td = \ + all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False ) includes_tools_for_display_in_tool_panel = all_repo_info_dict.get( 'includes_tools_for_display_in_tool_panel', False ) includes_tool_dependencies = all_repo_info_dict.get( 'includes_tool_dependencies', False ) includes_tools = all_repo_info_dict.get( 'includes_tools', False ) @@ -202,8 +204,8 @@ # Get the description from the metadata in case it has a value. repository_dependencies = metadata.get( 'repository_dependencies', {} ) description = repository_dependencies.get( 'description', None ) - # We need to add a root_key entry to one or both of installed_repository_dependencies dictionary and the missing_repository_dependencies - # dictionaries for proper display parsing. + # We need to add a root_key entry to one or both of installed_repository_dependencies dictionary and the + # missing_repository_dependencies dictionaries for proper display parsing. root_key = container_util.generate_repository_dependencies_key_for_repository( repository.tool_shed, repository.name, repository.owner, diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 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 @@ -375,22 +375,32 @@ all_repository_dependencies = prune_invalid_repository_dependencies( all_repository_dependencies ) return all_repository_dependencies -def get_repository_dependency_tree_for_repository( app, repository, dependency_tree=None, status=None ): +def get_repository_dependency_tups_for_repository( app, repository, dependency_tups=None, status=None ): """ - Return a list of of tool_shed_repository ids (whose status can be anything) required by the received repository. The - returned list defines the entire repository dependency tree. + Return a list of of tuples defining tool_shed_repository objects (whose status can be anything) required by the + received repository. The returned list defines the entire repository dependency tree. """ - if dependency_tree is None: - dependency_tree = [] - tree_object_ids = [ r.id for r in dependency_tree ] + if dependency_tups is None: + dependency_tups = [] + repository_tup = get_repository_tuple_for_installed_repository_manager( repository ) for rrda in repository.required_repositories: repository_dependency = rrda.repository_dependency required_repository = repository_dependency.repository if status is None or required_repository.status == status: - if required_repository.id not in tree_object_ids: - dependency_tree.append( required_repository ) - return get_repository_dependency_tree_for_repository( app, required_repository, dependency_tree=dependency_tree ) - return dependency_tree + required_repository_tup = get_repository_tuple_for_installed_repository_manager( required_repository ) + if required_repository_tup == repository_tup: + # We have a circular repository dependency relationship, skip this entry. + continue + if required_repository_tup not in dependency_tups: + dependency_tups.append( required_repository_tup ) + return get_repository_dependency_tups_for_repository( app, required_repository, dependency_tups=dependency_tups ) + return dependency_tups + +def get_repository_tuple_for_installed_repository_manager( repository ): + return ( str( repository.tool_shed ), + str( repository.name ), + str( repository.owner ), + str( repository.installed_changeset_revision ) ) def get_updated_changeset_revisions_for_repository_dependencies( trans, key_rd_dicts ): updated_key_rd_dicts = [] @@ -402,9 +412,10 @@ if suc.tool_shed_is_this_tool_shed( rd_toolshed ): repository = suc.get_repository_by_name_and_owner( trans.app, rd_name, rd_owner ) if repository: - repository_metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans, - trans.security.encode_id( repository.id ), - rd_changeset_revision ) + repository_metadata = \ + metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans, + trans.security.encode_id( repository.id ), + rd_changeset_revision ) if repository_metadata: # The repository changeset_revision is installable, so no updates are available. new_key_rd_dict = {} diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 lib/tool_shed/util/tool_dependency_util.py --- a/lib/tool_shed/util/tool_dependency_util.py +++ b/lib/tool_shed/util/tool_dependency_util.py @@ -200,30 +200,6 @@ tool_dependency_definition_type_class.label return message -def get_runtime_dependent_tool_dependencies( app, tool_dependency, status=None ): - """ - Return the list of tool dependency objects that require the received tool dependency at run time. The returned - list will be filtered by the received status if it is not None. This method is called only from Galaxy. - """ - runtime_dependent_tool_dependencies = [] - required_env_shell_file_path = tool_dependency.get_env_shell_file_path( app ) - if required_env_shell_file_path: - required_env_shell_file_path = os.path.abspath( required_env_shell_file_path ) - if required_env_shell_file_path is not None: - for td in app.install_model.context.query( app.install_model.ToolDependency ): - if status is None or td.status == status: - env_shell_file_path = td.get_env_shell_file_path( app ) - if env_shell_file_path is not None: - try: - contents = open( env_shell_file_path, 'r' ).read() - except Exception, e: - contents = None - log.debug( 'Error reading file %s, so cannot determine if package %s requires package %s at run time: %s' % \ - ( str( env_shell_file_path ), str( td.name ), str( tool_dependency.name ), str( e ) ) ) - if contents is not None and contents.find( required_env_shell_file_path ) >= 0: - runtime_dependent_tool_dependencies.append( td ) - return runtime_dependent_tool_dependencies - def get_download_url_for_platform( url_templates, platform_info_dict ): ''' Compare the dict returned by get_platform_info() with the values specified in the url_template element. Return @@ -322,6 +298,31 @@ env_sh_file_path = os.path.join( env_sh_file_dir, 'env.sh' ) return env_sh_file_path +def get_runtime_dependent_tool_dependency_tuples( app, tool_dependency, status=None ): + """ + Return the list of tool dependency objects that require the received tool dependency at run time. The returned + list will be filtered by the received status if it is not None. This method is called only from Galaxy. + """ + runtime_dependent_tool_dependency_tups = [] + required_env_shell_file_path = tool_dependency.get_env_shell_file_path( app ) + if required_env_shell_file_path: + required_env_shell_file_path = os.path.abspath( required_env_shell_file_path ) + if required_env_shell_file_path is not None: + for td in app.install_model.context.query( app.install_model.ToolDependency ): + if status is None or td.status == status: + env_shell_file_path = td.get_env_shell_file_path( app ) + if env_shell_file_path is not None: + try: + contents = open( env_shell_file_path, 'r' ).read() + except Exception, e: + contents = None + log.debug( 'Error reading file %s, so cannot determine if package %s requires package %s at run time: %s' % \ + ( str( env_shell_file_path ), str( td.name ), str( tool_dependency.name ), str( e ) ) ) + if contents is not None and contents.find( required_env_shell_file_path ) >= 0: + td_tuple = get_tool_dependency_tuple_for_installed_repository_manager( td ) + runtime_dependent_tool_dependency_tups.append( td_tuple ) + return runtime_dependent_tool_dependency_tups + def get_tool_dependency( trans, id ): """Get a tool_dependency from the database via id""" return trans.install_model.context.query( trans.install_model.ToolDependency ).get( trans.security.decode_id( id ) ) @@ -386,6 +387,13 @@ repository_name, repository_changeset_revision ) ) +def get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ): + if tool_dependency.type is None: + type = None + else: + type = str( tool_dependency.type ) + return ( tool_dependency.tool_shed_repository_id, str( tool_dependency.name ), str( tool_dependency.version ), type ) + def handle_tool_dependency_installation_error( app, tool_dependency, error_message, remove_installation_path=False ): # Since there was an installation error, remove the installation directory because the install_package method uses # this: "if os.path.exists( install_dir ):". Setting remove_installation_path to True should rarely occur. It is diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako --- a/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako +++ b/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako @@ -54,32 +54,27 @@ %endif %if not can_uninstall_repository: <% + from tool_shed.util.repository_dependency_util import get_repository_tuple_for_installed_repository_manager + from tool_shed.util.tool_dependency_util import get_tool_dependency_tuple_for_installed_repository_manager + irm = trans.app.installed_repository_manager + repository_tup = get_repository_tuple_for_installed_repository_manager( repository ) # Get installed repositories that this repository requires. installed_dependent_repositories = [] installed_runtime_dependent_tool_dependencies = [] - for r in irm.installed_dependent_repositories_of_installed_repositories: - if r.id == repository.id: - installed_dependent_repositories = irm.installed_dependent_repositories_of_installed_repositories[ r ] - break + installed_dependent_repositories = irm.installed_dependent_repositories_of_installed_repositories.get( repository_tup, [] ) # Get this repository's installed tool dependencies. - installed_tool_dependencies = [] - for r in irm.installed_tool_dependencies_of_installed_repositories: - if r.id == repository.id: - installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories[ r ] - break + installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories.get( repository_tup, [] ) # Get installed runtime dependent tool dependencies of this repository's installed tool dependencies. installed_runtime_dependent_tool_dependencies = [] - for itd in installed_tool_dependencies: - for td in irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies: - if td.id == itd.id: - installed_dependent_tds = \ - irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td ] - if installed_dependent_tds: - installed_runtime_dependent_tool_dependencies.extend( installed_dependent_tds ) + for itd_tup in installed_tool_dependencies: + installed_dependent_td_tups = \ + irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.get( itd_tup, [] ) + if installed_dependent_td_tups: + installed_runtime_dependent_tool_dependencies.extend( installed_dependent_td_tups ) %> %if installed_dependent_repositories or installed_runtime_dependent_tool_dependencies: <table width="100%" border="0" cellpadding="0" cellspacing="0"> @@ -92,29 +87,28 @@ %if installed_dependent_repositories: <label>Dependent repositories:</label><ul> - %for installed_dependent_repository in installed_dependent_repositories: + %for installed_dependent_repository_tup in installed_dependent_repositories: <% - changeset_revision = installed_dependent_repository.changeset_revision - name = installed_dependent_repository.name - owner = installed_dependent_repository.owner + tool_shed, name, owner, installed_changeset_revision, status = installed_dependent_repository_tup %> - <li>Revision <b>${ changeset_revision | h}</b> of repository <b>${name | h}</b> owned by <b>${owner | h}</b></li> + <li>Revision <b>${ installed_changeset_revision | h}</b> of repository <b>${name | h}</b> owned by <b>${owner | h}</b></li> %endfor </ul> %endif %if installed_runtime_dependent_tool_dependencies: <label>Runtime dependent tool dependencies of this repository's tool dependencies:</label><ul> - %for td in installed_runtime_dependent_tool_dependencies: + %for td_tup in installed_runtime_dependent_tool_dependencies: <% - containing_repository = irm.get_containing_repository_for_tool_dependency( td ) + tool_shed_repository_id, name, version, type, status = td_tup + containing_repository = irm.get_containing_repository_for_tool_dependency( td_tup ) repository_name = containing_repository.name changeset_revision = containing_repository.changeset_revision owner = containing_repository.owner %><li> - Version <b>${td.version}</b> of ${td.type} <b>${td.name}</b> contained in revision - <b>${changeset_revision | h}</b> of repository <b>${repository_name | h}</b> owned by <b>${owner}</b> + Version <b>${version | h}</b> of ${type | h} <b>${name | h}</b> contained in revision + <b>${changeset_revision | h}</b> of repository <b>${repository_name | h}</b> owned by <b>${owner | h}</b></li> %endfor </ul> diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 templates/admin/tool_shed_repository/repository_actions_menu.mako --- a/templates/admin/tool_shed_repository/repository_actions_menu.mako +++ b/templates/admin/tool_shed_repository/repository_actions_menu.mako @@ -30,7 +30,6 @@ <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a><a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a> - <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}">Repair repository</a> %if repository.can_reset_metadata: <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a> %endif @@ -42,6 +41,7 @@ %endif <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a> %endif + <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}">Repair repository</a></div></ul></%def> 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.