From afe362f4845d1c5ee124f06a42848c62fd9ccb3f Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Sat, 29 Mar 2025 12:21:20 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`main`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @leggewie. * https://github.com/armbian/build/pull/8027#issuecomment-2763300084 The following files were modified: * `lib/functions/host/prepare-host.sh` --- lib/functions/host/prepare-host.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/functions/host/prepare-host.sh b/lib/functions/host/prepare-host.sh index 2dd60e40b..838acc28e 100644 --- a/lib/functions/host/prepare-host.sh +++ b/lib/functions/host/prepare-host.sh @@ -160,7 +160,29 @@ function late_prepare_host_dependencies() { early_prepare_host_dependencies } -# Adaptive: used by both early & late. +# Prepares and sets the list of host dependencies for the current build. +# +# This function populates a global array (host_dependencies) with a comprehensive list of required +# packages based on the detected host release, target architecture, and other environment settings. +# It conditionally includes packages for Python support, cross-compilers for various architectures, +# and optional tools such as apt-cacher-ng or LLVM tools if specified. Extension hooks are invoked +# to allow further customization of the dependency list. +# +# Globals: +# host_release - Indicates the host OS release; used to determine applicable packages. +# target_arch - Specifies the target architecture; defaults to "all" if not provided. +# host_dependencies - Global array that is populated with the required packages. +# MANAGE_ACNG - If set to "yes", adds the apt-cacher-ng package. +# KERNEL_COMPILER - If set to "clang", adds clang, llvm, and lld packages. +# EXTRA_BUILD_DEPS - Global variable for extra dependencies added via an extension hook. +# FINAL_HOST_DEPS - Global variable set to the finalized, space-separated list of host dependencies. +# +# Outputs: +# Displays debug messages using display_alert to indicate the detection and usage of host_release and target_arch. +# +# Example: +# To prepare host dependencies adaptively: +# adaptative_prepare_host_dependencies function adaptative_prepare_host_dependencies() { if [[ "x${host_release:-"unknown"}x" == "xx" ]]; then display_alert "No specified host_release" "preparing for all-hosts, all-targets deps" "debug" @@ -197,6 +219,7 @@ function adaptative_prepare_host_dependencies() { patchutils pkg-config pv "qemu-user-static" "arch-test" rsync + squid-deb-proxy-client swig # swig is needed for some u-boot's. example: "bananapi.conf" u-boot-tools udev # causes initramfs rebuild, but is usually pre-installed.