def get_fixture_manifest(legacy=False): """ Function that retrieves the dependencies from fixture files for offline use. :param legacy: True or False if the requested file is for legacy or current version. :return: A list of dictionaries with all dependencies retrieved from the file. """ file_name = "joomla_dependencies/joomla_legacy_fixture.xml" if legacy else "joomla_dependencies/joomla_fixture.xml" dependencies = retrieve_manifest(legacy, False, file_name) return dependencies
def dependency_solver_wrapper(current_version, latest_version, offline=False): """ This is the wrapper function for the dependency solving algorithm. Given current, version and latest version will produce the essential steps to update. It checks if an update is required, if the server complies with new versions and if the version is supported by our tool. Then it retrieves all possible upgrade paths and calls the solver to provide the steps. If the server is not supported, if the version is not supported or if the system is already running the latest version, relevant messages appear. :param current_version: String containing the version. eg '3.4.1' :param latest_version: String containing the latest version eg '3.4.3' :return: A tuple with first value a boolean if the tool succeeded or not and second element either the steps or the error message. """ if current_version < latest_version: if validate_server(latest_version, SERVER_CONFIG): if SUPPORTED_VERSIONS.match(current_version): dependencies = retrieve_manifest() if not offline else get_fixture_manifest() if current_version < LooseVersion("2.5.0"): dependencies += retrieve_manifest(True) if not offline else get_fixture_manifest(True) return dependency_solver(current_version, dependencies, latest_version) else: return False, "Server Config Not Supported" elif current_version == latest_version: return False, "System Already Up-To-Date" return False, "Joomla Version is not supported"