1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/bbb229927c68/ Changeset: bbb229927c68 User: greg Date: 2013-04-16 21:55:07 Summary: Fixes to make support for recently introduced prior_installation_required atribute for ordering installation of tool shed repositories backward compatible to the 12/20/12 Galaxy release. Affected #: 5 files diff -r cf7a0098c612499d03aafb2f62084ebbcf99e55f -r bbb229927c688213e67ba62998a64526ca948a19 lib/galaxy/webapps/tool_shed/util/container_util.py --- a/lib/galaxy/webapps/tool_shed/util/container_util.py +++ b/lib/galaxy/webapps/tool_shed/util/container_util.py @@ -1031,14 +1031,18 @@ changeset_revision = items[ 3 ] if len( items ) == 5: prior_installation_required = asbool( str( items[ 4 ] ) ) + return toolshed_base_url, repository_name, repository_owner, changeset_revision, prior_installation_required else: - # Metadata should have been reset on the repository that contains the definition for this repository_dependency. In the meantime we'll - # default the prior_installation_required to False. - prior_installation_required = False - return toolshed_base_url, repository_name, repository_owner, changeset_revision, prior_installation_required + # For backward compatibility to the 12/20/12 Galaxy release we have to return the following, and callers must handle exceptions. + return toolshed_base_url, repository_name, repository_owner, changeset_revision def handle_repository_dependencies_container_entry( trans, repository_dependencies_folder, rd_key, rd_value, folder_id, repository_dependency_id, folder_keys ): - toolshed, repository_name, repository_owner, changeset_revision, prior_installation_required = get_components_from_key( rd_key ) + try: + toolshed, repository_name, repository_owner, changeset_revision, prior_installation_required = get_components_from_key( rd_key ) + except ValueError: + # For backward compatibility to the 12/20/12 Galaxy release, default prior_installation_required to False. + toolshed, repository_name, repository_owner, changeset_revision = get_components_from_key( rd_key ) + prior_installation_required = False folder = get_folder( repository_dependencies_folder, rd_key ) label = generate_repository_dependencies_folder_label_from_key( repository_name, repository_owner, @@ -1114,7 +1118,12 @@ return False def key_is_current_repositorys_key( repository_name, repository_owner, changeset_revision, prior_installation_required, key ): - toolshed_base_url, key_name, key_owner, key_changeset_revision, key_prior_installation_required = get_components_from_key( key ) + try: + toolshed_base_url, key_name, key_owner, key_changeset_revision, key_prior_installation_required = get_components_from_key( key ) + except ValueError: + # For backward compatibility to the 12/20/12 Galaxy release, default key_prior_installation_required to False. + toolshed_base_url, key_name, key_owner, key_changeset_revision = get_components_from_key( key ) + key_prior_installation_required = False return repository_name == key_name and \ repository_owner == key_owner and \ changeset_revision == key_changeset_revision and \ diff -r cf7a0098c612499d03aafb2f62084ebbcf99e55f -r bbb229927c688213e67ba62998a64526ca948a19 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 @@ -478,8 +478,12 @@ old_container_repository_dependencies_folder.id = folder_id folder_id += 1 # Generate the label by retrieving the repository name. - toolshed, name, owner, changeset_revision, prior_installation_required = \ - container_util.get_components_from_key( old_container_repository_dependencies_folder.key ) + try: + toolshed, name, owner, changeset_revision, prior_installation_required = \ + container_util.get_components_from_key( old_container_repository_dependencies_folder.key ) + except ValueError: + # For backward compatibility to the 12/20/12 Galaxy release. + toolshed, name, owner, changeset_revision = container_util.get_components_from_key( old_container_repository_dependencies_folder.key ) old_container_repository_dependencies_folder.label = str( name ) repository_dependencies_folder.folders.append( old_container_repository_dependencies_folder ) # Merge tool_dependencies. diff -r cf7a0098c612499d03aafb2f62084ebbcf99e55f -r bbb229927c688213e67ba62998a64526ca948a19 lib/tool_shed/tool_shed_registry.py --- a/lib/tool_shed/tool_shed_registry.py +++ b/lib/tool_shed/tool_shed_registry.py @@ -42,9 +42,8 @@ Following more what galaxy.demo_sequencer.controllers.common does might be more appropriate at some stage... """ - log.debug( 'Looking for url %s' % url ) for shed_name, shed_url in self.tool_sheds.items(): if shed_url.find( url ) >= 0: - log.debug( 'Found %s -> %s' % ( shed_name, shed_url ) ) return self.tool_sheds_auth[ shed_name ] + log.debug( "Invalid url '%s' received by tool shed registry's password_manager_for_url method." % str( url ) ) return None diff -r cf7a0098c612499d03aafb2f62084ebbcf99e55f -r bbb229927c688213e67ba62998a64526ca948a19 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 @@ -263,8 +263,13 @@ for key, val in repository_dependencies.items(): if key in [ 'root_key', 'description' ]: continue - toolshed, name, owner, changeset_revision, prior_installation_required = container_util.get_components_from_key( key ) - components_list = [ toolshed, name, owner, changeset_revision, prior_installation_required ] + try: + toolshed, name, owner, changeset_revision, prior_installation_required = container_util.get_components_from_key( key ) + components_list = [ toolshed, name, owner, changeset_revision, prior_installation_required ] + except ValueError: + # For backward compatibility to the 12/20/12 Galaxy release, default prior_installation_required to False in the caller. + toolshed, name, owner, changeset_revision = container_util.get_components_from_key( key ) + components_list = [ toolshed, name, owner, changeset_revision ] if components_list not in required_repository_tups: required_repository_tups.append( components_list ) for components_list in val: @@ -279,7 +284,7 @@ encoded_required_repository_tups.append( encoding_util.encoding_sep.join( required_repository_tup ) ) encoded_required_repository_str = encoding_util.encoding_sep2.join( encoded_required_repository_tups ) encoded_required_repository_str = encoding_util.tool_shed_encode( encoded_required_repository_str ) - url = suc.url_join( tool_shed_url, '/repository/get_required_repo_info_dict?encoded_str=%s' % encoded_required_repository_str ) + url = suc.url_join( tool_shed_url, '/repository/get_required_repo_info_dict?encoded_str=%s' % encoded_required_repository_str ) text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) if text: required_repo_info_dict = json.from_json_string( text ) diff -r cf7a0098c612499d03aafb2f62084ebbcf99e55f -r bbb229927c688213e67ba62998a64526ca948a19 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 @@ -33,8 +33,12 @@ if key in [ 'root_key', 'description' ]: continue dependent_repository = None - dependent_toolshed, dependent_name, dependent_owner, dependent_changeset_revision, dependent_prior_installation_required = \ - container_util.get_components_from_key( key ) + try: + dependent_toolshed, dependent_name, dependent_owner, dependent_changeset_revision, dependent_prior_installation_required = \ + container_util.get_components_from_key( key ) + except ValueError: + # For backward compatibility to the 12/20/12 Galaxy release. + dependent_toolshed, dependent_name, dependent_owner, dependent_changeset_revision = container_util.get_components_from_key( key ) for tsr in tool_shed_repositories: # Get the the tool_shed_repository defined by name, owner and changeset_revision. This is the repository that will be # dependent upon each of the tool shed repositories contained in val. @@ -350,13 +354,22 @@ # We have the updated changset revision. updated_key_rd_dicts.append( new_key_rd_dict ) else: - toolshed, repository_name, repository_owner, repository_changeset_revision, prior_installation_required = \ - container_util.get_components_from_key( key ) + try: + toolshed, repository_name, repository_owner, repository_changeset_revision, prior_installation_required = \ + container_util.get_components_from_key( key ) + except ValueError: + # For backward compatibility to the 12/20/12 Galaxy release. + toolshed, repository_name, repository_owner, repository_changeset_revision = container_util.get_components_from_key( key ) message = "The revision %s defined for repository %s owned by %s is invalid, so repository dependencies defined for repository %s will be ignored." % \ ( str( rd_changeset_revision ), str( rd_name ), str( rd_owner ), str( repository_name ) ) log.debug( message ) else: - toolshed, repository_name, repository_owner, repository_changeset_revision, prior_installation_required = container_util.get_components_from_key( key ) + try: + toolshed, repository_name, repository_owner, repository_changeset_revision, prior_installation_required = \ + container_util.get_components_from_key( key ) + except ValueError: + # For backward compatibility to the 12/20/12 Galaxy release. + toolshed, repository_name, repository_owner, repository_changeset_revision = container_util.get_components_from_key( key ) message = "The revision %s defined for repository %s owned by %s is invalid, so repository dependencies defined for repository %s will be ignored." % \ ( str( rd_changeset_revision ), str( rd_name ), str( rd_owner ), str( repository_name ) ) log.debug( message ) 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.