advanced changed_file_names

This commit is contained in:
Gerhard Hoffmann 2022-06-04 21:28:28 +02:00
parent bc4977bf7f
commit 094580e294

View File

@ -87,7 +87,7 @@ clone_customer_repository () {
log_fatal "$func:${LINENO} "\
"wrong repository: $(ls -d './${workspace_dir}/*')"
else
local __m= "./${workspace_dir}/$customer_id exists"
local __m="./${workspace_dir}/$customer_id exists"
log_debug "$func:${LINENO} $__m"
return 0
fi
@ -238,13 +238,20 @@ changed_file_names () {
git_res=${git_res//[$'\r\n\t']/ }
log_debug "$func:${LINENO}: git_res=$git_res"
local file_names=""
for f in 'update.conf' 'opkg_commands' ; do
if grep -qE ".*${f}.*?" <<< $git_res; then
file_names="$f $file_names"
local known_files=(update.conf current.conf emp.conf)
known_files=(${known_files[@]} device.conf printer.conf opkg_commands)
for f in ${known_files[@]} ; do
if grep -qE ".*/${f}\s+.*" <<< $git_res; then
if ! [ -z $file_names ]; then
file_names="$f $file_names"
else
file_names="$f"
fi
fi
done
cd_home ; printf "$file_names"
cd_home; log_debug "$func:${LINENO}: file_names=$file_names" ;
printf '%s' "$file_names"
else
log_crit "$func:${LINENO}: cannot cd to $customer_repository "\
"while in $PWD"