From bfad061264783c943ddfce6bf4beaf99c35eeb3a Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Sun, 15 Feb 2026 05:20:25 +0100 Subject: [PATCH] quickfix: fix old files deletion advise users to run cleandestinations --- atom | 6 +++--- lib/database/checkVersion | 8 ++++---- lib/database/upgradedatabase_7_8 | 9 +++++++++ 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 lib/database/upgradedatabase_7_8 diff --git a/atom b/atom index bb5e63a..bacf858 100755 --- a/atom +++ b/atom @@ -224,8 +224,8 @@ do do removeFileId=${line%%::AtOM:SQL:Sep::*} rest=${line#*::AtOM:SQL:Sep::} - removeFileDestName=${line%%::AtOM:SQL:Sep::*} - rest=${line#*::AtOM:SQL:Sep::} + removeFileDestName=${rest%%::AtOM:SQL:Sep::*} + rest=${rest#*::AtOM:SQL:Sep::} removefile[$removeFileId]="${destinationpath["$removeFileDestName"]}/${rest%%::AtOM:SQL:Sep::*}" read -u4 -r -d $'\0' line done @@ -239,7 +239,7 @@ do filename=${removefile[id]} if [ -n "$filename" ] then - if rm -f "$filename" + if rm "$filename" then Delete destination_files <<<"id = $id" (( ++deleted )) diff --git a/lib/database/checkVersion b/lib/database/checkVersion index 71f850e..17d12d6 100644 --- a/lib/database/checkVersion +++ b/lib/database/checkVersion @@ -1,5 +1,5 @@ #!/usr/bin/env bash -currentdbversion=7 +currentdbversion=8 checkDatabaseVersion() { local dbversion if dbversion=$(Select atom version <<<"\"1\" = 1") @@ -15,9 +15,9 @@ checkDatabaseVersion() { dbversion=$(Select atom version <<<"\"1\" = 1") done else - echo "Database schema version $dbversion is higher than - that of this version of AtOM - ($currentdbversion). Bailing out." >&2 + echo "Database schema version $dbversion is" \ + "higher thanthat of this version of" \ + "AtOM ($currentdbversion). Bailing out." >&2 exit $EDBVERSION fi else diff --git a/lib/database/upgradedatabase_7_8 b/lib/database/upgradedatabase_7_8 new file mode 100644 index 0000000..e58ac69 --- /dev/null +++ b/lib/database/upgradedatabase_7_8 @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +upgradedatabase_6_7() { + echo "Upgrading database to version 8... (backup is $database.bak_v7)" + cp "$database" "$database.bak_v7" + echo 'Deletion of old files was failing. Users of previous versions (YOU!) are strongly advised to run cleandestinations with the "-r" flag.' + read -p "Press Enter to continue..." + Update atom version 8 <<<"1 = 1" +} \ No newline at end of file