#!/usr/bin/env bash
function cli_requirements_pre_run() {
declare -g ARMBIAN_COMMAND_REQUIRE_BASIC_DEPS="yes"
if [[ "$(uname)" != "Linux" ]]; then
display_alert "Not running on Linux" "refusing to run 'requirements'" "err"
exit 1
fi
if [[ "${EUID}" == "0" ]]; then
display_alert "Already running as root" "great" "debug"
else
exit_with_error "This command requires root privileges - refusing to run"
fi
}
function cli_requirements_run() {
initialize_extension_manager
declare -a -g host_dependencies=()
obtain_and_check_host_release_and_arch
host_release="${HOSTRELEASE}" host_arch="${HOSTARCH}" early_prepare_host_dependencies
LOG_SECTION="install_host_dependencies" do_with_logging install_host_dependencies "for requirements command"
declare -i -g -r prepare_host_has_already_run=1
if [[ "${ARMBIAN_INSIDE_DOCKERFILE_BUILD}" == "yes" ]]; then
deploy_to_non_cache_dir="yes" prepare_python_and_pip
deploy_to_non_cache_dir="yes" run_tool_oras
deploy_to_non_cache_dir="yes" run_tool_shellcheck
deploy_to_non_cache_dir="yes" run_tool_batcat
fi
display_alert "Done with" "@host dependencies" "cachehit"
}