commit/galaxy-central: 3 new changesets
3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/0bd594fc429d/ Changeset: 0bd594fc429d Branch: stable User: greg Date: 2014-03-06 17:39:48 Summary: Fixes to handle case where a tool dependency recipe defines an <actions_group> tag set for installing pre-compiled binaries which fail to install, so the fall back recipe for installing and compileing from souce is used. Prior to this change set, the recipe from source would not work, but the install process would finish in such a way that the recipe seemed to work. Affected #: 5 files diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 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 @@ -1111,10 +1111,12 @@ no_changes_checked = CheckboxField.is_checked( no_changes ) install_repository_dependencies = CheckboxField.is_checked( kwd.get( 'install_repository_dependencies', '' ) ) install_tool_dependencies = CheckboxField.is_checked( kwd.get( 'install_tool_dependencies', '' ) ) - shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, tool_shed_repository ) + shed_tool_conf, tool_path, relative_install_dir = \ + suc.get_tool_panel_config_tool_path_install_dir( trans.app, tool_shed_repository ) repository_clone_url = suc.generate_clone_url_for_installed_repository( trans.app, tool_shed_repository ) - clone_dir = os.path.join( tool_path, suc.generate_tool_shed_repository_install_dir( repository_clone_url, - tool_shed_repository.installed_changeset_revision ) ) + clone_dir = os.path.join( tool_path, + suc.generate_tool_shed_repository_install_dir( repository_clone_url, + tool_shed_repository.installed_changeset_revision ) ) relative_install_dir = os.path.join( clone_dir, tool_shed_repository.name ) tool_shed_url = suc.get_url_from_tool_shed( trans.app, tool_shed_repository.tool_shed ) tool_section = None @@ -1123,7 +1125,8 @@ tool_panel_section_key = None tool_panel_section_keys = [] metadata = tool_shed_repository.metadata - # Keep track of tool dependencies defined for the current repository or those defined for any of it's repository dependencies. + # Keep track of tool dependencies defined for the current repository or those defined for any of + # it's repository dependencies. includes_tool_dependencies = tool_shed_repository.includes_tool_dependencies if tool_shed_repository.includes_tools_for_display_in_tool_panel: # Handle the selected tool panel location for loading tools included in the tool shed repository. @@ -1137,7 +1140,8 @@ # Just in case the tool_section.id differs from tool_panel_section_id, which it shouldn't... tool_panel_section_id = str( tool_section.id ) if tool_shed_repository.status == trans.install_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. + # 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, @@ -1163,7 +1167,8 @@ # Entering this else block occurs only if the tool_shed_repository does not include any valid tools. if install_repository_dependencies: repository_dependencies = \ - repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository ) + repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, + tool_shed_repository ) else: repository_dependencies = None if metadata: @@ -1220,7 +1225,8 @@ clause_list = [] for tsr_id in tsr_ids: clause_list.append( trans.install_model.ToolShedRepository.table.c.id == tsr_id ) - query = trans.install_model.context.current.query( trans.install_model.ToolShedRepository ).filter( or_( *clause_list ) ) + query = trans.install_model.context.current.query( trans.install_model.ToolShedRepository ) \ + .filter( or_( *clause_list ) ) return trans.fill_template( 'admin/tool_shed_repository/initiate_repository_installation.mako', encoded_kwd=encoded_kwd, query=query, @@ -1378,7 +1384,9 @@ raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) readme_files_dict = json.from_json_string( raw_text ) tool_dependencies = metadata.get( 'tool_dependencies', None ) - repository_dependencies = repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository ) + repository_dependencies = \ + repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, + tool_shed_repository ) repo_info_dict = repository_util.create_repo_info_dict( trans=trans, repository_clone_url=repository_clone_url, changeset_revision=tool_shed_repository.installed_changeset_revision, diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 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 @@ -30,36 +30,43 @@ log = logging.getLogger( __name__ ) -def create_repo_info_dict( trans, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_name=None, repository=None, - repository_metadata=None, tool_dependencies=None, repository_dependencies=None ): +def create_repo_info_dict( trans, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_name=None, + repository=None, repository_metadata=None, tool_dependencies=None, repository_dependencies=None ): """ - Return a dictionary that includes all of the information needed to install a repository into a local Galaxy instance. The dictionary will also - contain the recursive list of repository dependencies defined for the repository, as well as the defined tool dependencies. + Return a dictionary that includes all of the information needed to install a repository into a local + Galaxy instance. The dictionary will also contain the recursive list of repository dependencies defined + for the repository, as well as the defined tool dependencies. This method is called from Galaxy under three scenarios: - 1. During the tool shed repository installation process via the tool shed's get_repository_information() method. In this case both the received - repository and repository_metadata will be objects., but tool_dependencies and repository_dependencies will be None - 2. When a tool shed repository that was uninstalled from a Galaxy instance is being reinstalled with no updates available. In this case, both - repository and repository_metadata will be None, but tool_dependencies and repository_dependencies will be objects previously retrieved from the - tool shed if the repository includes definitions for them. - 3. When a tool shed repository that was uninstalled from a Galaxy instance is being reinstalled with updates available. In this case, this - method is reached via the tool shed's get_updated_repository_information() method, and both repository and repository_metadata will be objects - but tool_dependencies and repository_dependencies will be None. + 1. During the tool shed repository installation process via the tool shed's get_repository_information() + method. In this case both the received repository and repository_metadata will be objects., but + tool_dependencies and repository_dependencies will be None. + 2. When a tool shed repository that was uninstalled from a Galaxy instance is being reinstalled with no + updates available. In this case, both repository and repository_metadata will be None, but tool_dependencies + and repository_dependencies will be objects previously retrieved from the tool shed if the repository includes + definitions for them. + 3. When a tool shed repository that was uninstalled from a Galaxy instance is being reinstalled with updates + available. In this case, this method is reached via the tool shed's get_updated_repository_information() + method, and both repository and repository_metadata will be objects but tool_dependencies and + repository_dependencies will be None. """ repo_info_dict = {} repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner ) if trans.webapp.name == 'tool_shed': # We're in the tool shed. - repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, trans.security.encode_id( repository.id ), changeset_revision ) + repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, + trans.security.encode_id( repository.id ), + changeset_revision ) if repository_metadata: metadata = repository_metadata.metadata if metadata: + toolshed_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' ) # Get a dictionary of all repositories upon which the contents of the received repository depends. repository_dependencies = \ repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans, repository=repository, repository_metadata=repository_metadata, - toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ), + toolshed_base_url=toolshed_url, key_rd_dicts_to_be_processed=None, all_repository_dependencies=None, handled_key_rd_dicts=None, diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py @@ -132,7 +132,6 @@ # Explicitly set the file to the received mode if valid. with settings( hide( 'everything' ), warn_only=True ): local( 'chmod +x %s' % file_path ) - return_code = 0 # Convert the received text to a list, in order to support adding one or more lines to the file. if isinstance( text, basestring ): text = [ text ] @@ -152,7 +151,6 @@ if return_code: # Return upon the first error encountered. return return_code - return return_code def filter_actions_after_binary_installation( actions ): '''Filter out actions that should not be processed if a binary download succeeded.''' @@ -189,13 +187,15 @@ def handle_environment_variables( app, tool_dependency, install_dir, env_var_dict, set_prior_environment_commands ): """ - This method works with with a combination of three tool dependency definition tag sets, which are defined in the tool_dependencies.xml file in the - order discussed here. The example for this discussion is the tool_dependencies.xml file contained in the osra repository, which is available at: + This method works with with a combination of three tool dependency definition tag sets, which are defined + in the tool_dependencies.xml file in the order discussed here. The example for this discussion is the + tool_dependencies.xml file contained in the osra repository, which is available at: http://testtoolshed.g2.bx.psu.edu/view/bgruening/osra - The first tag set defines a complex repository dependency like this. This tag set ensures that changeset revision XXX of the repository named - package_graphicsmagick_1_3 owned by YYY in the tool shed ZZZ has been previously installed. + The first tag set defines a complex repository dependency like this. This tag set ensures that changeset + revision XXX of the repository named package_graphicsmagick_1_3 owned by YYY in the tool shed ZZZ has been + previously installed. <tool_dependency><package name="graphicsmagick" version="1.3.18"> @@ -203,19 +203,21 @@ </package> ... - * By the way, there is an env.sh file associated with version 1.3.18 of the graphicsmagick package which looks something like this (we'll reference - this file later in this discussion. + * By the way, there is an env.sh file associated with version 1.3.18 of the graphicsmagick package which looks + something like this (we'll reference this file later in this discussion. ---- GRAPHICSMAGICK_ROOT_DIR=/<my configured tool dependency path>/graphicsmagick/1.3.18/YYY/package_graphicsmagick_1_3/XXX/gmagick; export GRAPHICSMAGICK_ROOT_DIR ---- - The second tag set defines a specific package dependency that has been previously installed (guaranteed by the tag set discussed above) and compiled, - where the compiled dependency is needed by the tool dependency currently being installed (osra version 2.0.0 in this case) and complied in order for - it's installation and compilation to succeed. This tag set is contained within the <package name="osra" version="2.0.0"> tag set, which implies that - version 2.0.0 of the osra package requires version 1.3.18 of the graphicsmagick package in order to successfully compile. When this tag set is handled, - one of the effects is that the env.sh file associated with graphicsmagick version 1.3.18 is "sourced", which undoubtedly sets or alters certain environment - variables (e.g. PATH, PYTHONPATH, etc). + The second tag set defines a specific package dependency that has been previously installed (guaranteed by the + tag set discussed above) and compiled, where the compiled dependency is needed by the tool dependency currently + being installed (osra version 2.0.0 in this case) and complied in order for it's installation and compilation to + succeed. This tag set is contained within the <package name="osra" version="2.0.0"> tag set, which implies that + version 2.0.0 of the osra package requires version 1.3.18 of the graphicsmagick package in order to successfully + compile. When this tag set is handled, one of the effects is that the env.sh file associated with graphicsmagick + version 1.3.18 is "sourced", which undoubtedly sets or alters certain environment variables (e.g. PATH, PYTHONPATH, + etc). <!-- populate the environment variables from the dependent repositories --><action type="set_environment_for_install"> @@ -224,11 +226,12 @@ </repository></action> - The third tag set enables discovery of the same required package dependency discussed above for correctly compiling the osra version 2.0.0 package, but - in this case the package can be discovered at tool execution time. Using the $ENV[] option as shown in this example, the value of the environment - variable named GRAPHICSMAGICK_ROOT_DIR (which was set in the environment using the second tag set described above) will be used to automatically alter - the env.sh file associated with the osra version 2.0.0 tool dependency when it is installed into Galaxy. * Refer to where we discussed the env.sh file - for version 1.3.18 of the graphicsmagick package above. + The third tag set enables discovery of the same required package dependency discussed above for correctly compiling + the osra version 2.0.0 package, but in this case the package can be discovered at tool execution time. Using the + $ENV[] option as shown in this example, the value of the environment variable named GRAPHICSMAGICK_ROOT_DIR (which + was set in the environment using the second tag set described above) will be used to automatically alter the env.sh + file associated with the osra version 2.0.0 tool dependency when it is installed into Galaxy. * Refer to where we + discussed the env.sh file for version 1.3.18 of the graphicsmagick package above. <action type="set_environment"><environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[GRAPHICSMAGICK_ROOT_DIR]/lib/</environment_variable> @@ -238,8 +241,9 @@ <environment_variable action="set_to" name="OSRA_DATA_FILES">$INSTALL_DIR/share</environment_variable></action> - The above tag will produce an env.sh file for version 2.0.0 of the osra package when it it installed into Galaxy that looks something like this. Notice - that the path to the gmagick binary is included here since it expands the defined $ENV[GRAPHICSMAGICK_ROOT_DIR] value in the above tag set. + The above tag will produce an env.sh file for version 2.0.0 of the osra package when it it installed into Galaxy + that looks something like this. Notice that the path to the gmagick binary is included here since it expands the + defined $ENV[GRAPHICSMAGICK_ROOT_DIR] value in the above tag set. ---- LD_LIBRARY_PATH=/<my configured tool dependency path>/graphicsmagick/1.3.18/YYY/package_graphicsmagick_1_3/XXX/gmagick/lib/:$LD_LIBRARY_PATH; @@ -416,6 +420,7 @@ for tarball_name in tarball_names: cmd = '''PATH=$PATH:$R_HOME/bin; export PATH; R_LIBS=$INSTALL_DIR; export R_LIBS; Rscript -e "install.packages(c('%s'),lib='$INSTALL_DIR', repos=NULL, dependencies=FALSE)"''' % ( str( tarball_name ) ) + ( str( tarball_name ) ) cmd = install_environment.build_command( td_common_util.evaluate_template( cmd, install_dir ) ) return_code = handle_command( app, tool_dependency, install_dir, cmd ) if return_code: @@ -528,7 +533,8 @@ elif os.path.exists( os.path.join( tmp_work_dir, 'Build.PL' ) ): cmd += '''perl Build.PL --install_base $INSTALL_DIR && perl Build && perl Build install''' else: - log.debug( 'No Makefile.PL or Build.PL file found in %s. Skipping installation of %s.' % ( url, perl_package_name ) ) + log.debug( 'No Makefile.PL or Build.PL file found in %s. Skipping installation of %s.' % \ + ( url, perl_package_name ) ) return tool_dependency with lcd( tmp_work_dir ): cmd = install_environment.build_command( td_common_util.evaluate_template( cmd, install_dir ) ) diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py @@ -300,7 +300,10 @@ return tool_dependency def install_package( app, elem, tool_shed_repository, tool_dependencies=None, from_install_manager=False ): - # The value of tool_dependencies is a partial or full list of ToolDependency records associated with the tool_shed_repository. + """ + Install a tool dependency package defined by the XML element elem. The value of tool_dependencies is + a partial or full list of ToolDependency records associated with the tool_shed_repository. + """ sa_session = app.install_model.context tool_dependency = None # The value of package_name should match the value of the "package" type in the tool config's <requirements> tag set, but it's not required. @@ -363,8 +366,8 @@ type='package', status=app.install_model.ToolDependency.installation_status.INSTALLING, set_status=True ) - # Get the information about the current platform in case the tool dependency definition includes tag sets for installing - # compiled binaries. + # Get the information about the current platform in case the tool dependency definition includes tag sets + # for installing compiled binaries. platform_info_dict = tool_dependency_util.get_platform_info_dict() if package_install_version == '1.0': # Handle tool dependency installation using a fabric method included in the Galaxy framework. @@ -372,24 +375,29 @@ platform_info_dict=platform_info_dict, include_after_install_actions=True ) if actions_elem_tuples: - # At this point we have a list of <actions> elems that are either defined within an <actions_group> tag set with <actions> - # sub-elements that contains os and architecture attributes filtered by the platform into which the appropriate compiled - # binary will be installed, or not defined within an <actions_group> tag set and not filtered. + # At this point we have a list of <actions> elems that are either defined within an <actions_group> + # tag set with <actions> sub-elements that contains os and architecture attributes filtered by the + # platform into which the appropriate compiled binary will be installed, or not defined within an + # <actions_group> tag set and not filtered. Here is an example actions_elem_tuple. + # [(True, [<Element 'actions' at 0x109293d10>)] binary_installed = False - for in_actions_group, actions_elems in actions_elem_tuples: + for actions_elem_tuple in actions_elem_tuples: + in_actions_group, actions_elems = actions_elem_tuple if in_actions_group: - # Platform matching is only performed inside <actions_group> tag sets, os and architecture attributes are otherwise - # ignored. + # Platform matching is only performed inside <actions_group> tag sets, os and architecture + # attributes are otherwise ignored. + can_install_from_source = False for actions_elem in actions_elems: system = actions_elem.get( 'os' ) architecture = actions_elem.get( 'architecture' ) - # If this <actions> element has the os and architecture attributes defined, then we only want to process until a - # successful installation is achieved. + # If this <actions> element has the os and architecture attributes defined, then we only + # want to process until a successful installation is achieved. if system and architecture: - # If an <actions> tag has been defined that matches our current platform, and the recipe specified within - # that <actions> tag has been successfully processed, skip any remaining platform-specific <actions> tags. - # We cannot break out of the look here because there may be <action> tags at the end of the <actions_group> - # tag set that must be processed. + # If an <actions> tag has been defined that matches our current platform, and the + # recipe specified within that <actions> tag has been successfully processed, skip + # any remaining platform-specific <actions> tags. We cannot break out of the loop + # here because there may be <action> tags at the end of the <actions_group> tag set + # that must be processed. if binary_installed: continue # No platform-specific <actions> recipe has yet resulted in a successful installation. @@ -400,41 +408,50 @@ actions_elem=actions_elem, action_elem=None ) if tool_dependency.status == app.install_model.ToolDependency.installation_status.INSTALLED: - # If an <actions> tag was found that matches the current platform, and the install_via_fabric method - # did not result in an error state, set binary_installed to True in order to skip any remaining - # platform-specific <actions> tags. + # If an <actions> tag was found that matches the current platform, and the + # install_via_fabric method did not result in an error state, set binary_installed + # to True in order to skip any remaining platform-specific <actions> tags. binary_installed = True else: - # Process the next matching <actions> tag, or any defined <actions> tags that do not contain platform - # dependent recipes. + # Process the next matching <actions> tag, or any defined <actions> tags that do not + # contain platform dependent recipes. log.debug( 'Error downloading binary for tool dependency %s version %s: %s' % \ ( str( package_name ), str( package_version ), str( tool_dependency.error_message ) ) ) else: - # If no <actions> tags have been defined that match our current platform, or none of the matching - # <actions> tags resulted in a successful tool dependency status, proceed with one and only one - # <actions> tag that is not defined to be platform-specific. - if not binary_installed: - log.debug( 'Proceeding with install and compile recipe for tool dependency %s.' % str( tool_dependency.name ) ) - # Make sure to reset for installation if attempt at binary installation resulted in an error. - can_install = True - if tool_dependency.status != app.install_model.ToolDependency.installation_status.NEVER_INSTALLED: - removed, error_message = tool_dependency_util.remove_tool_dependency( app, tool_dependency ) - if not removed: - log.debug( 'Error removing old files from installation directory %s: %s' % \ - ( str( tool_dependency.installation_directory( app ), str( error_message ) ) ) ) - can_install = False - if can_install: + if actions_elem.tag == 'actions': + # We've reached an <actions> tag that defines the recipe for installing and compiling from + # source. If binary installation failed, we proceed with the recipe. + if not binary_installed: + installation_directory = tool_dependency.installation_directory( app ) + if os.path.exists( installation_directory ): + # Delete contents of installation directory if attempt at binary installation failed. + installation_directory_contents = os.listdir( installation_directory ) + if installation_directory_contents: + removed, error_message = tool_dependency_util.remove_tool_dependency( app, tool_dependency ) + if removed: + can_install_from_source = True + else: + log.debug( 'Error removing old files from installation directory %s: %s' % \ + ( str( tool_dependency.installation_directory( app ), str( error_message ) ) ) ) + else: + can_install_from_source = True + else: + can_install_from_source = True + if can_install_from_source: + # We now know that binary installation was not successful, so proceed with the <actions> + # tag set that defines the recipe to install and compile from source. + log.debug( 'Proceeding with install and compile recipe for tool dependency %s.' % \ + str( tool_dependency.name ) ) tool_dependency = install_via_fabric( app, tool_dependency, install_dir, package_name=package_name, actions_elem=actions_elem, action_elem=None ) - # Perform any final actions that have been defined within the actions_group tag set, but outside of - # an <actions> tag, such as a set_environment entry, or a download_file or download_by_url command to - # retrieve extra data for this tool dependency. Only do this if the tool dependency is not in an error - # state, otherwise skip this action. if actions_elem.tag == 'action' and tool_dependency.status != app.install_model.ToolDependency.installation_status.ERROR: + # If the tool dependency is not in an error state, perform any final actions that have been + # defined within the actions_group tag set, but outside of an <actions> tag, which defines + # the recipe for installing and compiling from source. tool_dependency = install_via_fabric( app, tool_dependency, install_dir, @@ -442,9 +459,9 @@ actions_elem=None, action_elem=actions_elem ) else: - # <actions> tags outside of an <actions_group> tag shall not check os or architecture, and if the attributes are - # defined, they will be ignored. All <actions> tags outside of an <actions_group> tag set shall always be processed. - # This is the default and original behavior of the install_package method. + # Checks for "os" and "architecture" attributes are not made for any <actions> tag sets outside of + # an <actions_group> tag set. If the attributes are defined, they will be ignored. All <actions> tags + # outside of an <actions_group> tag set will always be processed. tool_dependency = install_via_fabric( app, tool_dependency, install_dir, diff -r 18fa1f7340b3a5c99dda2e195b20373841d807e9 -r 0bd594fc429dbad899a86495a3ab8683d6184159 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 @@ -227,18 +227,21 @@ return file_path return None -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 ): +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 in the Galaxy database with the new information received. If a record defined by the received tool shed, - repository name and owner does not exist, create a new record with the received information. + 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 exist, 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 - # to be in the Galaxy distribution, but have been moved to the main Galaxy tool shed. + # 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. 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 - # to it being uninstalled. + # 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 to it being + # uninstalled. current_changeset_revision = installed_changeset_revision context = app.install_model.context tool_shed = get_tool_shed_from_clone_url( repository_clone_url ) @@ -255,9 +258,14 @@ deleted = False uninstalled = False tool_shed_repository = \ - get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, tool_shed, name, owner, installed_changeset_revision ) + get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, + tool_shed, + name, + owner, + installed_changeset_revision ) if tool_shed_repository: - log.debug( "Updating an existing row for repository '%s' in the tool_shed_repository table, status set to '%s'." % ( str( name ), str( status ) ) ) + log.debug( "Updating an existing row for repository '%s' in the tool_shed_repository table, status set to '%s'." % \ + ( str( name ), str( status ) ) ) tool_shed_repository.description = description tool_shed_repository.changeset_revision = current_changeset_revision tool_shed_repository.ctx_rev = ctx_rev @@ -267,7 +275,8 @@ tool_shed_repository.uninstalled = uninstalled tool_shed_repository.status = status else: - log.debug( "Adding new row for repository '%s' in the tool_shed_repository table, status set to '%s'." % ( str( name ), str( status ) ) ) + log.debug( "Adding new row for repository '%s' in the tool_shed_repository table, status set to '%s'." % \ + ( str( name ), str( status ) ) ) tool_shed_repository = \ app.install_model.ToolShedRepository( tool_shed=tool_shed, name=name, @@ -1028,8 +1037,8 @@ owner=owner, changeset_revision=changeset_revision ) if not repository: - # The received changeset_revision is no longer installable, so get the next changeset_revision in the repository's changelog in the - # tool shed that is associated with repository_metadata. + # The received changeset_revision is no longer installable, so get the next changeset_revision + # in the repository's changelog in the tool shed that is associated with repository_metadata. tool_shed_url = get_url_from_tool_shed( app, tool_shed ) url = url_join( tool_shed_url, 'repository/next_installable_changeset_revision?name=%s&owner=%s&changeset_revision=%s' % \ @@ -1305,7 +1314,10 @@ .first() def get_tool_shed_repository_by_shed_name_owner_changeset_revision( app, tool_shed, name, owner, changeset_revision ): - """Return a tool shed repository database record defined by the combination of a tool_shed, repository name, repository owner and current changeet_revision.""" + """ + Return a tool shed repository database record defined by the combination of a tool_shed, repository name, + repository owner and current changeet_revision. + """ # This method is used only in Galaxy, not the tool shed. repository_query = __repository_query( app ) if tool_shed.find( '//' ) > 0: @@ -1319,7 +1331,10 @@ .first() def get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, tool_shed, name, owner, installed_changeset_revision ): - """Return a tool shed repository database record defined by the combination of a tool_shed, repository name, repository owner and installed_changeet_revision.""" + """ + Return a tool shed repository database record defined by the combination of a tool_shed, + repository name, repository owner and installed_changeet_revision. + """ # This method is used only in Galaxy, not the tool shed. repository_query = __repository_query( app ) if tool_shed.find( '//' ) > 0: https://bitbucket.org/galaxy/galaxy-central/commits/45b4499e1b0f/ Changeset: 45b4499e1b0f User: davebgx Date: 2014-03-07 15:25:51 Summary: Merge stable. Affected #: 2 files diff -r af5577a24c155fa04aa607ff2fec283634df2fb0 -r 45b4499e1b0f90f0bfa7b6bdc93f408cfb3b7d38 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py @@ -938,7 +938,10 @@ return tool_dependency def log_results( command, fabric_AttributeString, file_path ): - """Write attributes of fabric.operations._AttributeString to a specified log file.""" + """ + Write attributes of fabric.operations._AttributeString (which is the output of executing command using fabric's local() method) + to a specified log file. + """ if os.path.exists( file_path ): logfile = open( file_path, 'ab' ) else: https://bitbucket.org/galaxy/galaxy-central/commits/0eb68f4ec8ca/ Changeset: 0eb68f4ec8ca User: davebgx Date: 2014-03-07 15:28:30 Summary: Fix incorrectly merged comment. Affected #: 1 file diff -r 45b4499e1b0f90f0bfa7b6bdc93f408cfb3b7d38 -r 0eb68f4ec8ca0806991c7a1bdccf96350f3f0ef9 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py @@ -938,10 +938,7 @@ return tool_dependency def log_results( command, fabric_AttributeString, file_path ): - """ - Write attributes of fabric.operations._AttributeString (which is the output of executing command using fabric's local() method) - to a specified log file. - """ + """Write attributes of fabric.operations._AttributeString to a specified log file.""" if os.path.exists( file_path ): logfile = open( file_path, 'ab' ) else: 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