armbian-build/lib/functions/logging/capture.sh
Igor Pecovnik 4d60ce08f2 chore: update copyright years to 2026
Update all copyright notices in shell scripts from 2025 to 2026.

## Changes

- **Igor Pecovnik**: 2013-2025 → 2013-2026 (129 files)
- **Ricardo Pardini**: 2023-2025 → 2023-2026, 2020-2025 → 2020-2026 (5 files)

## Additional Improvements

Also updated the backtitle in `lib/functions/configuration/interactive.sh`:
- Changed title from "Armbian building script" to "Armbian Linux build framework"
- Removed docs link for cleaner display
- Uses dynamic year calculation with separate declaration (fixes shellcheck SC2155)
2025-12-25 12:03:34 +01:00

33 lines
1.2 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/
function do_capturing_defs() {
# make sure to local with a value, otherwise they will appear in the list...
declare pre_exec_vars="" post_exec_vars="" new_vars_list="" onevar="" all_vars_array=()
pre_exec_vars="$(compgen -A variable)"
# run parameters passed. if this fails, so will we, immediately, and not capture anything correctly.
# if you ever find stacks referring here, please look at the caller and $1
"$@"
post_exec_vars="$(compgen -A variable)"
new_vars_list="$(comm -13 <(echo "$pre_exec_vars" | grep -E '[[:upper:]]+' | grep -v -e "^BASH_" | sort) <(echo "${post_exec_vars}" | grep -E '[[:upper:]]+' | grep -v -e "^BASH_" | sort))"
for onevar in ${new_vars_list}; do
all_vars_array+=("$(declare -p "${onevar}")")
done
declare -g CAPTURED_VARS_NAMES="${new_vars_list}"
declare -ga CAPTURED_VARS_ARRAY=("${all_vars_array[@]}")
unset all_vars_array post_exec_vars new_vars_list pre_exec_vars onevar
return 0 # return success explicitly , preemptively preventing short-circuit problems.
}