Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 2.67 KB

File metadata and controls

67 lines (48 loc) · 2.67 KB

lib/ — the helper library

Back to the index.

This is what install scripts call. Source tools.func; it sources the five parts below. Alpine is the exception: it loads alpine.func instead, chosen by lxc/install.func from OS_FAMILY.

Adding or renaming a function here means regenerating API.txt in the same PR — CI compares against it.

Packages and repositories: install_packages_with_retry, upgrade_packages_with_retry, prepare_repository_setup, setup_deb822_repo, cleanup_tool_keyrings, manage_tool_repository. Plus OS probes (is_debian, is_ubuntu, get_os_info, get_system_arch), service handling (stop_all_services, safe_service_restart, enable_and_start_service), downloads with retry (curl_with_retry, download_file), and temp-directory tracking that cleans up on exit.

Retries exist because APT and network failures during an install are usually transient; a single failure would otherwise abort a build that would have succeeded on the next attempt.

Releases, tags and branches from GitHub, GitLab and Codeberg behind one pair of entry points:

check_for_release        github   owner/repo
fetch_and_deploy_release gitlab   owner/repo  ...

The per-forge names (check_for_gh_release, fetch_and_deploy_gl_release, fetch_and_deploy_codeberg_release, and the tag and branch variants) still exist as one-line wrappers, so existing scripts keep working.

Deploy modes: prebuilt release asset, source tarball, .deb package, or a plain URL through fetch_and_deploy_from_url.

Language runtimes and the application-level installers: setup_nodejs, setup_uv, setup_php, setup_go, setup_ruby, setup_rust, setup_java, setup_dotnet, setup_composer, setup_ffmpeg, setup_imagemagick, setup_yq, and the version bookkeeping around them (cache_installed_version, should_update_tool, verify_tool_version).

setup_postgresql, setup_mysql, setup_mariadb, setup_mongodb, setup_clickhouse, setup_meilisearch, setup_adminer, and the setup_*_db helpers that create a database and user.

setup_hwaccel plus GPU detection and per-vendor setup for Intel (modern, legacy and Arc), AMD (including APU and ROCm) and NVIDIA, and the device permissions that go with them.

The Alpine equivalent, written for ash rather than bash, with fallbacks for the msg_* functions in case core.func was not loaded.