aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-04-22 00:55:04 +0200
committerMax Magorsch <arzano@gentoo.org>2020-04-22 01:34:33 +0200
commit2ff2adc33b5c5b726bf2fcebf8e3fe07538a00cd (patch)
tree28fc2d63591103c23d07fc387b6252f5ba48db46 /bin
parentImprove the error handling for package.mask entries (diff)
downloadsoko-2ff2adc33b5c5b726bf2fcebf8e3fe07538a00cd.tar.gz
soko-2ff2adc33b5c5b726bf2fcebf8e3fe07538a00cd.tar.bz2
soko-2ff2adc33b5c5b726bf2fcebf8e3fe07538a00cd.zip
Add a cleanup option
The cleanup option can be used to find versions that are present in the database but not in the main tree. All those versions will be a) logged, and b) deleted from the database This way, outdated data can be found, logged and cleaned up. This option will currently be used to find outdated data, that is bugs in the updater logic. Once these bugs are found and fix this option becomes obsolete. Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cleanup.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/cleanup.sh b/bin/cleanup.sh
new file mode 100755
index 0000000..b8d01f1
--- /dev/null
+++ b/bin/cleanup.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+update_repository(){
+ # This is the copy of the tree used to run gpackages against.
+ if [[ ! -d /mnt/packages-tree/gentoo/ ]]; then
+ cd /mnt/packages-tree || exit 1
+ git clone https://anongit.gentoo.org/git/repo/gentoo.git
+ else
+ cd /mnt/packages-tree/gentoo/ || exit 1
+ git pull --rebase &>/dev/null
+ fi
+}
+
+cleanup_database(){
+ cd /mnt/packages-tree/gentoo/ || exit 1
+ /go/src/soko/bin/soko cleanup
+}
+
+
+update_repository
+cleanup_database