armbian-build/lib/functions/bsp/utils-bsp.sh
Igor Velkov 234f39b6ca (#9400 P1a) lib/functions/bsp/utils-bsp.sh: convert [ ] to [[ ]]
Replace POSIX `[ ]` with bash `[[ ]]` on one directory existence check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 13:36:20 +01:00

36 lines
1.3 KiB
Bash

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2026 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
# copy_all_packages_files_for <folder> to package
copy_all_packages_files_for() {
: "${destination:?destination is not set}"
local package_name="${1}"
# @TODO: rpardini: this was recovered after being assassinated by some insane person who rewrote aggregation in Python
declare PACKAGES_SEARCH_ROOT_ABSOLUTE_DIRS="
${SRC}/packages
${SRC}/config/optional/_any_board/_packages
${SRC}/config/optional/architectures/${ARCH}/_packages
${SRC}/config/optional/families/${LINUXFAMILY}/_packages
${SRC}/config/optional/boards/${BOARD}/_packages
"
for package_src_dir in ${PACKAGES_SEARCH_ROOT_ABSOLUTE_DIRS}; do
local package_dirpath="${package_src_dir}/${package_name}"
if [[ -d "${package_dirpath}" ]]; then
display_alert "Adding found files" "${package_dirpath} for '${package_name}'" "info"
run_host_command_logged cp -rv "${package_dirpath}/"* "${destination}/"
else
display_alert "No files found in" "${package_dirpath} for '${package_name}'" "debug"
fi
wait_for_disk_sync "after copying ${package_src_dir} files for ${package_name} package"
done
}