hook-functions: Print error message on copy_file failure

Print an error message when copy_file cannot find the source file. This
will ease debugging in cases of failures like LP #1641230.
This commit is contained in:
Benjamin Drung 2024-09-03 23:38:32 +02:00
parent c7fc4a424f
commit ea2977533e

View File

@ -183,7 +183,10 @@ copy_file() {
src="${2}"
target="${3:-$2}"
[ -f "${src}" ] || return 2
if [ ! -f "${src}" ]; then
echo "mkinitramfs: copy_file: $type '$src' not found" >&2
return 2
fi
if [ -d "${DESTDIR}/${target}" ] || [ "${target%/}" != "$target" ]; then
target="${target}/${src##*/}"