fix: make RPM runtime portable on Tumbleweed
This commit is contained in:
@@ -9,7 +9,8 @@ set -eu
|
||||
STORE_DIR="/var/lib/fenris"
|
||||
STORE_DB="${STORE_DIR}/observations.db"
|
||||
STORE_BAK="${STORE_DIR}/observations.db.bak"
|
||||
VENV_PYTHON="/opt/fenris/bin/python3"
|
||||
RUNTIME_PYTHON="/usr/bin/python3"
|
||||
VENDOR_DIR="/opt/fenris/vendor"
|
||||
|
||||
case "${1:-}" in
|
||||
configure)
|
||||
@@ -18,8 +19,8 @@ case "${1:-}" in
|
||||
if [ -f "${STORE_DB}" ]; then
|
||||
cp "${STORE_DB}" "${STORE_BAK}" 2>/dev/null || true
|
||||
fi
|
||||
if [ -x "${VENV_PYTHON}" ] && [ -f "${STORE_DB}" ]; then
|
||||
"${VENV_PYTHON}" -c "
|
||||
if [ -d "${VENDOR_DIR}" ] && [ -f "${STORE_DB}" ]; then
|
||||
PYTHONPATH="${VENDOR_DIR}" "${RUNTIME_PYTHON}" -c "
|
||||
from fenris.store import migrate_to_latest
|
||||
from pathlib import Path
|
||||
n = migrate_to_latest(Path('${STORE_DB}'))
|
||||
|
||||
Reference in New Issue
Block a user