Make it all work

This commit is contained in:
Vincent Riquer 2025-11-11 04:56:34 +01:00
parent eb45983613
commit 705506b1a6
16 changed files with 49 additions and 45 deletions

View File

@ -7,6 +7,7 @@
* Don't print useless information (stuff that handled 0 files and such) * Don't print useless information (stuff that handled 0 files and such)
* Store transcoded file paths relative to their destination's root * Store transcoded file paths relative to their destination's root
* Add missing error codes (used but not declared) * Add missing error codes (used but not declared)
* Support for newline character in filenames
# 1.0.4 # 1.0.4
## `BREAKING CHANGES` ## `BREAKING CHANGES`

View File

@ -26,7 +26,7 @@ Select() {
"WHERE ${where_statement[@]})" \ "WHERE ${where_statement[@]})" \
",'SQL::Select:not found'" \ ",'SQL::Select:not found'" \
");" >&3 ");" >&3
read -u 4 -d$'\0' results read -u 4 -r -d $'\0' results
if ! [[ $results == "SQL::Select:not found" ]] if ! [[ $results == "SQL::Select:not found" ]]
then then
echo "$results" echo "$results"

View File

@ -3,9 +3,12 @@ openDatabase() {
[[ -f "$database" ]] || populate_db=1 [[ -f "$database" ]] || populate_db=1
rm -f "$tempdir"/sqlite.{in,out} rm -f "$tempdir"/sqlite.{in,out}
mkfifo "$tempdir"/sqlite.{in,out} mkfifo "$tempdir"/sqlite.{in,out}
sqlite3 -bail -newline $'\0' \ stdbuf -o0 sqlite3 -bail \
-newline $'::AtOM:SQL:EOL::\n' \
"$database" \ "$database" \
< "$tempdir/sqlite.in" \ < "$tempdir/sqlite.in" \
| stdbuf -o0 \
sed 's/::AtOM:SQL:EOL::/\x0/g;s/\x0\xA//g' \
> "$tempdir/sqlite.out" & > "$tempdir/sqlite.out" &
exec 3> "$tempdir"/sqlite.in exec 3> "$tempdir"/sqlite.in
exec 4< "$tempdir"/sqlite.out exec 4< "$tempdir"/sqlite.out
@ -21,7 +24,7 @@ openDatabase() {
echo 'PRAGMA recursive_triggers = ON;' >&3 echo 'PRAGMA recursive_triggers = ON;' >&3
echo 'PRAGMA temp_store = 2;' >&3 echo 'PRAGMA temp_store = 2;' >&3
echo 'PRAGMA locking_mode = EXCLUSIVE;' >&3 echo 'PRAGMA locking_mode = EXCLUSIVE;' >&3
read -u4 -d $'\0' read -u4 -r -d $'\0'
unset REPLY unset REPLY
checkDatabaseVersion checkDatabaseVersion
} }