commit/galaxy-central: greg: Fix for updating metadata for a tool shed repository that defines complex repository dependencies.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/d09a3531b3d3/ Changeset: d09a3531b3d3 User: greg Date: 2013-05-11 19:16:09 Summary: Fix for updating metadata for a tool shed repository that defines complex repository dependencies. Affected #: 3 files diff -r 7dc222a7163a5049cc407ad1a049dd091ac27b03 -r d09a3531b3d35a3921fdaa52beed7481f0391ca8 lib/tool_shed/galaxy_install/repository_util.py --- a/lib/tool_shed/galaxy_install/repository_util.py +++ b/lib/tool_shed/galaxy_install/repository_util.py @@ -487,9 +487,9 @@ tool_shed_repository, trans.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS ) tool_shed_url = suc.get_url_from_tool_shed( trans.app, tool_shed_repository.tool_shed ) - url = suc.url_join( tool_shed_url, - '/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s' % - ( tool_shed_repository.name, tool_shed_repository.owner, tool_shed_repository.changeset_revision ) ) + url = suc.url_join( tool_shed_url, + '/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s' % + ( tool_shed_repository.name, tool_shed_repository.owner, tool_shed_repository.changeset_revision ) ) text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) if text: tool_version_dicts = json.from_json_string( text ) diff -r 7dc222a7163a5049cc407ad1a049dd091ac27b03 -r d09a3531b3d35a3921fdaa52beed7481f0391ca8 lib/tool_shed/util/metadata_util.py --- a/lib/tool_shed/util/metadata_util.py +++ b/lib/tool_shed/util/metadata_util.py @@ -1857,23 +1857,14 @@ else: tool_shed, name, owner, changeset_revision, prior_installation_required, error_message = repository_dependency_tup prior_installation_required = util.asbool( str( prior_installation_required ) ) - rd_key = container_util.generate_repository_dependencies_key_for_repository( toolshed_base_url=tool_shed, - repository_name=name, - repository_owner=owner, - changeset_revision=changeset_revision, - prior_installation_required=prior_installation_required ) if repository_dependencies_dict: - if rd_key in repository_dependencies_dict: - repository_dependencies = repository_dependencies_dict[ rd_key ] - for repository_dependency_tup in repository_dependency_tups: - if repository_dependency_tup not in repository_dependencies: - repository_dependencies.append( repository_dependency_tup ) - repository_dependencies_dict[ rd_key ] = repository_dependencies - else: - repository_dependencies_dict[ rd_key ] = repository_dependency_tups + repository_dependencies = repository_dependencies_dict.get( 'repository_dependencies', [] ) + for repository_dependency_tup in repository_dependency_tups: + if repository_dependency_tup not in repository_dependencies: + repository_dependencies.append( repository_dependency_tup ) + repository_dependencies_dict[ 'repository_dependencies' ] = repository_dependencies else: - repository_dependencies_dict = dict( root_key=rd_key, - description=description, + repository_dependencies_dict = dict( description=description, repository_dependencies=repository_dependency_tups ) if repository_dependencies_dict: if is_valid: diff -r 7dc222a7163a5049cc407ad1a049dd091ac27b03 -r d09a3531b3d35a3921fdaa52beed7481f0391ca8 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 @@ -198,7 +198,7 @@ def create_or_update_tool_shed_repository( app, name, description, installed_changeset_revision, ctx_rev, repository_clone_url, metadata_dict, status, current_changeset_revision=None, owner='', dist_to_shed=False ): """ - Update a tool shed repository record i the Galaxy database with the new information received. If a record defined by the received tool shed, repository name + Update a tool shed repository record in the Galaxy database with the new information received. If a record defined by the received tool shed, repository name and owner does not exists, create a new record with the received information. """ # The received value for dist_to_shed will be True if the InstallManager is installing a repository that contains tools or datatypes that used @@ -1052,6 +1052,10 @@ prior_installation_required = util.asbool( str( prior_installation_required ) ) return tool_shed, name, owner, changeset_revision, prior_installation_required +def pretty_print( dict=None ): + if dict: + return json.to_json_string( dict, sort_keys=True, indent=4 * ' ' ) + def remove_dir( dir ): """Attempt to remove a directory from disk.""" if os.path.exists( dir ): 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