summaryrefslogtreecommitdiff
path: root/src/backend/rescue.py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-06-06 16:22:04 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-06-06 16:22:04 +0100
commitac0efd1bd6c703147bd8d3caedf489fab87d6131 (patch)
treee6af981b6e90be35447dbb88dd276a4d8ff2d47e /src/backend/rescue.py
parent49e6ab19aa461151132dfb4f1cf962d4ef403c66 (diff)
big rewrite : split the backend in smaller pieces, rework the cli frontend to work with the new backend ... gui frontend wip
Diffstat (limited to 'src/backend/rescue.py')
-rw-r--r--src/backend/rescue.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/backend/rescue.py b/src/backend/rescue.py
new file mode 100644
index 0000000..18523d4
--- /dev/null
+++ b/src/backend/rescue.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+
+import animation
+import os
+import sisyphus.database
+
+remotePkgsDB = '/var/lib/sisyphus/csv/remotePackagesPre.csv'
+remoteDscsDB = '/var/lib/sisyphus/csv/remoteDescriptionsPre.csv'
+localPkgsDB = '/var/lib/sisyphus/csv/localPackagesPre.csv'
+sisyphusDB = '/var/lib/sisyphus/db/sisyphus.db'
+
+@animation.wait('recovering databases')
+def start():
+ if os.path.exists(remotePkgsDB):
+ os.remove(remotePkgsDB)
+ if os.path.exists(remoteDscsDB):
+ os.remove(remoteDscsDB)
+ if os.path.exists(localPkgsDB):
+ os.remove(localPkgsDB)
+ if os.path.exists(sisyphusDB):
+ os.remove(sisyphusDB)
+
+ sisyphus.database.syncRemote()
+ sisyphus.database.syncLocal()