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