lib/autobuild/tools.rb
# Resolves the absolute path to a given tool
Resolves the absolute path to a given tool
Resolves the absolute path to a given tool
def tool_in_path(name)
            path, path_name, path_env = programs_in_path[name]
            current = tool(name)
            if path_env != ENV['PATH'] || path_name != current
                programs_in_path.delete(name)
                if current[0, 1] == "/"
                    path = current
                else
                    path = find_in_path(current)
                end
                if !path
                    raise ArgumentError, "tool #{name}, set to #{current}, can not be found in PATH=#{path_env}"
                end
                if !File.file?(path)
                    raise ArgumentError, "tool #{name} is set to #{current}, but this resolves to #{path} which is not a file"
                elsif !File.executable?(path)
                    raise ArgumentError, "tool #{name} is set to #{current}, but this resolves to #{path} which is not executable"
                end
                programs_in_path[name] = [path, current, ENV['PATH']]
            end
            return path
        end
def tool_in_path ( name ) path , path_name , path_env = programs_in_path [ name ] current = tool ( name ) if path_env != ENV [ 'PATH' ] || path_name != current programs_in_path . delete ( name ) if current [ 0 , 1 ] == "/" path = current else path = find_in_path ( current ) end if ! path raise ArgumentError , "tool #{name}, set to #{current}, can not be found in PATH=#{path_env}" end if ! File . file? ( path ) raise ArgumentError , "tool #{name} is set to #{current}, but this resolves to #{path} which is not a file" elsif ! File . executable? ( path ) raise ArgumentError , "tool #{name} is set to #{current}, but this resolves to #{path} which is not executable" end programs_in_path [ name ] = [ path , current , ENV [ 'PATH' ] ] end return path end
Resolves the absolute path to a given tool
Resolves the absolute path to a given tool
# Delete the current entry given that it is invalid # This is already a full path # Verify that the new value is a file and is executable
name
<not_specific>