quickfix: fix old files deletion
advise users to run cleandestinations
This commit is contained in:
parent
72f0c1aed8
commit
bfad061264
6
atom
6
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 ))
|
||||
|
||||
@ -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
|
||||
|
||||
9
lib/database/upgradedatabase_7_8
Normal file
9
lib/database/upgradedatabase_7_8
Normal file
@ -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"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user