Compare commits

..

2 Commits

Author SHA1 Message Date
ScriptFanix
c6deac7e02 Merge branch '28-store-dest-filename-relative' into 'dev'
Resolve "Store dest filename relative"

See merge request atom/AtOM!38
2026-01-16 02:31:35 +01:00
ScriptFanix
b08fdd08b4 Resolve "Store dest filename relative" 2026-01-16 02:31:34 +01:00
2 changed files with 29 additions and 26 deletions

View File

@ -1,33 +1,36 @@
#!/bin/bash #!/bin/bash
copyFiles_matching() { copyFiles_matching() {
extension="${filename##*.}" local extension="${filename##*.}"
if \
cp -al \ cp -al \
"$sourcepath/$filename" \ "$sourcepath/$filename" \
"$destdir/$destfile.$extension" \ "${destinationpath[$destination]}/$destdir/$destfile.$extension" \
2>/dev/null \ 2>/dev/null \
|| cp -a \ || cp -a \
"$sourcepath/$filename" \ "$sourcepath/$filename" \
"$destdir/$destfile.$extension" "${destinationpath[$destination]}/$destdir/$destfile.$extension"
echo \ then
"UPDATE destination_files" \ echo \
"SET filename=" \ "UPDATE destination_files" \
"\"${destdir//\"/\"\"}/${destfile//\"/\"\"}.$extension\"," \ "SET filename=" \
" last_change=(" \ "\"${destdir//\"/\"\"}/${destfile//\"/\"\"}.$extension\"," \
" SELECT last_change" \ " last_change=(" \
" FROM source_files" \ " SELECT last_change" \
" WHERE id=$fileid" \ " FROM source_files" \
" )," \ " WHERE id=$fileid" \
" old_filename=(" \ " )," \
" SELECT filename" \ " old_filename=(" \
" FROM destination_files" \ " SELECT filename" \
" WHERE id=$destfileid" \ " FROM destination_files" \
" )," \ " WHERE id=$destfileid" \
" rename_pattern=" \ " )," \
"\"${destinationrenamepath[$destination]}/${destinationrename[$destination]}\","\ " rename_pattern=" \
" fat32compat=" \ "\"${destinationrenamepath[$destination]}/${destinationrename[$destination]}\","\
"${destinationfat32compat["$destination"]}," \ " fat32compat=" \
" ascii=${destinationascii["$destination"]}" \ "${destinationfat32compat["$destination"]}," \
"WHERE id=$destfileid;" \ " ascii=${destinationascii["$destination"]}"\
>&3 "WHERE id=$destfileid;" \
(( ++copies )) >&3
(( ++copies ))
fi
} }

View File

@ -98,7 +98,7 @@ getDestDir() {
part=${part#*/} part=${part#*/}
done done
fi fi
if ! [ -d "$destdir" ] if ! [ -d "${destinationpath[$destination]}/$destdir" ]
then then
mkdir -p "${destinationpath[$destination]}/$destdir" mkdir -p "${destinationpath[$destination]}/$destdir"
fi fi