mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
When source dependency injection scripts, set the environment variable PACKAGE_BASE to the root of the package, allowing package dirs to be relocatable
This commit is contained in:
@@ -1533,11 +1533,11 @@ class Tool:
|
||||
# back to packages
|
||||
log.debug( "Dependency %s", requirement.name )
|
||||
if requirement.type == 'package':
|
||||
script_file, version = self.app.toolbox.dependency_manager.find_dep( requirement.name, requirement.version )
|
||||
script_file, base_path, version = self.app.toolbox.dependency_manager.find_dep( requirement.name, requirement.version )
|
||||
if script_file is None:
|
||||
log.warn( "Failed to resolve dependency on '%s', ignoring", requirement.name )
|
||||
else:
|
||||
commands.append( 'source ' + script_file )
|
||||
commands.append( 'PACKAGE_BASE=%s source %s' % ( base_path, script_file ) )
|
||||
return commands
|
||||
|
||||
def build_redirect_url_params( self, param_dict ):
|
||||
|
||||
@@ -36,7 +36,8 @@ class DependencyManager( object ):
|
||||
"""
|
||||
Attempt to find a dependency named `name` at version `version`. If
|
||||
version is None, return the "default" version as determined using a
|
||||
symbolic link (if found).
|
||||
symbolic link (if found). Returns a triple of:
|
||||
env_script, base_path, real_version
|
||||
"""
|
||||
if version is None:
|
||||
return self._find_dep_default( name )
|
||||
@@ -45,9 +46,10 @@ class DependencyManager( object ):
|
||||
|
||||
def _find_dep_versioned( self, name, version ):
|
||||
for base_path in self.base_paths:
|
||||
script = os.path.join( base_path, name, version, 'env.sh' )
|
||||
path = os.path.join( base_path, name, version )
|
||||
script = os.path.join( path, 'env.sh' )
|
||||
if os.path.exists( script ):
|
||||
return script, version
|
||||
return script, path, version
|
||||
else:
|
||||
return None, None
|
||||
|
||||
@@ -60,7 +62,7 @@ class DependencyManager( object ):
|
||||
real_version = os.path.basename( real_path )
|
||||
script = os.path.join( real_path, 'env.sh' )
|
||||
if os.path.exists( script ):
|
||||
return script, real_version
|
||||
return script, real_path, real_version
|
||||
else:
|
||||
return None, None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user