1
0
Fork 0
mirror of https://github.com/Luzifer/archrepo.git synced 2024-12-20 13:11:17 +00:00

Switch to .tar.zst database

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-10-20 23:48:38 +02:00
parent 3961b7dd1c
commit 7c324daac0
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
export REPO_DIR:=$(CURDIR)/repo
export REPOKEY:=D0391BF9
export RETAIN:=1
export DATABASE:=$(shell find $(REPO_DIR) -maxdepth 1 -mindepth 1 -name '*.db.tar.xz' -or -name '*.db.tar.zst')
export DATABASE:=$(REPO_DIR)/luzifer.db.tar.zst
maintanance: do_updates do_cleanup list_packages upload
@ -12,6 +12,7 @@ do_updates: repo_update
do_cleanup: cleanup_repo
do_cleanup: cleanup_orphan_signatures
do_cleanup: sign_database
do_cleanup: cleanup_files
download:
vault2env --key=secret/aws/private -- aws s3 sync \
@ -59,6 +60,9 @@ cleanup_orphan_signatures:
cleanup_repo: check_tools
bash ./scripts/do_cleanup.sh
clear_database:
rm -f $(REPO_DIR)/*.db* $(REPO_DIR)/*.files*
list_packages:
tar -tf $(DATABASE) | grep -v '/desc' | sed -E 's/(.*)-([^-]+-[0-9]+)\//\1\t\2/' | sort | column -t >$(REPO_DIR)/packages.txt

View file

@ -10,10 +10,6 @@ syncdir="${REPO_DIR:-$(pwd)}"
log "Cleaning up old package versions..."
BASE_PATH="${syncdir}" python scripts/remove_old_versions.py
# Ensure removal of previous repo files
log "Cleaning up old database files..."
find "${syncdir}" -regextype egrep -regex '^.*\.(db|files)(|\.tar|\.tar\.xz|\.tar\.zst)$' -delete
log "Adding remaining packages to database..."
packages=($(find "${syncdir}" -regextype egrep -regex '^.*\.pkg\.tar(\.xz|\.zst)$' | sort))
@ -23,7 +19,7 @@ if [ "${#packages[@]}" -eq 0 ]; then
fi
log "Adding packages..."
repo-add --new --prevent-downgrade "${syncdir}/luzifer.db.tar.xz" "${packages[@]}"
repo-add --new --prevent-downgrade "${DATABASE}" "${packages[@]}"
log "All packages added, removing *.old copies..."
find "${syncdir}" -name '*.old' -delete