toys fixes

checkmissing: add missing read -d \0
cleandestinations: use NULL separator in find, use SQL placedholmder
This commit is contained in:
Vincent Riquer 2026-02-15 03:31:41 +01:00
parent e0c3aea43c
commit 1fe4099350
2 changed files with 6 additions and 5 deletions

View File

@ -87,7 +87,7 @@ do
destination_names[id]=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::}
files[id]=${rest}
read -u4 line
read -u4 -r -d $'\0' line
done
echo 'BEGIN TRANSACTION;' >&3

View File

@ -72,18 +72,19 @@ checkwanted() {
for destination in "${!destinationpath[@]}"
do
echo -ne "\rScanning destination $destination... \033[K"
while read -r filename
while read -r -d $'\0' filename
do
sqlfile=${filename//$'\n'/::AtOM:NewLine:SQL:Inline::}
if ! Select destination_files id \
>/dev/null \
<<<"filename = ${filename#${destinationpath["$destination"]}/}"
<<<"filename = ${sqlfile#${destinationpath["$destination"]}/}"
then
echo -e $'\r'"$filename\033[K"
(( remove )) && rm -f "$filename"
(( remove )) && rm "$filename"
echo -n "Scanning destination $destination... "
fi
progressSpin
done < <(find "${destinationpath["$destination"]}" -type f)
done < <(find "${destinationpath["$destination"]}" -type f -print0)
done
echo -en "\r\033[K"