1
0
Fork 0
mirror of https://github.com/Luzifer/archrepo.git synced 2024-11-08 17:40:01 +00:00

Prepare migration to zstd archives

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-01-05 23:26:10 +01:00
parent 7a17164bf7
commit 3dfe38a9e5
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
5 changed files with 28 additions and 5 deletions

2
.gitignore vendored
View file

@ -4,3 +4,5 @@
*.files.sig *.files.sig
*.tar.xz *.tar.xz
*.tar.xz.sig *.tar.xz.sig
*.tar.zstd
*.tar.zstd.sig

View file

@ -1,4 +1,4 @@
export DATABASE:=$(shell find . -maxdepth 1 -mindepth 1 -name '*.db.tar.xz') export DATABASE:=$(shell find . -maxdepth 1 -mindepth 1 -name '*.db.tar.xz' -or -name '*.db.tar.zstd')
export REPOKEY:=D0391BF9 export REPOKEY:=D0391BF9
@ -19,7 +19,7 @@ download:
--acl=public-read \ --acl=public-read \
s3://arch-luzifer-io/repo/x86_64/ $(CURDIR)/ s3://arch-luzifer-io/repo/x86_64/ $(CURDIR)/
upload: cleanup_files upload: cleanup_files check_archive_mix
vault2env --key=secret/aws/private -- aws s3 sync \ vault2env --key=secret/aws/private -- aws s3 sync \
--delete \ --delete \
--exclude '*.old*' \ --exclude '*.old*' \
@ -65,3 +65,8 @@ scripts/repoctl.toml:
sign_database: sign_database:
repo-add -s --key $(REPOKEY) $(DATABASE) repo-add -s --key $(REPOKEY) $(DATABASE)
# Helpers
check_archive_mix:
bash ./scripts/has_archive_mix.sh

View file

@ -14,12 +14,12 @@ join_by() {
declare -A local_versions declare -A local_versions
declare -A aur_versions declare -A aur_versions
database=$(find . -maxdepth 1 -mindepth 1 -name '*.db.tar.xz') database=$(find . -maxdepth 1 -mindepth 1 -name '*.db.tar.xz' -or '*.db.tar.zstd')
aur_query=("https://aur.archlinux.org/rpc/?v=5&type=info") aur_query=("https://aur.archlinux.org/rpc/?v=5&type=info")
step "Collecting local package versions..." step "Collecting local package versions..."
known_packages=$(tar -tf luzifer.db.tar.xz | grep -v /desc | sed -E 's@^(.*)-([^-]+-[0-9]+)/$@\1 \2@') known_packages=$(tar -tf ${database} | grep -v /desc | sed -E 's@^(.*)-([^-]+-[0-9]+)/$@\1 \2@')
IFS=$'\n' IFS=$'\n'

View file

@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
[[ $(find . -name '*.tar.zstd' | wc -l) -gt 0 ]] || {
echo "No ZStd archives found, nothing to worry"
exit 0
}
[[ $(find . -name '*.tar.xz' | wc -l) -gt 0 ]] && {
echo "Both XZ and ZStd archives found, pay attention!"
}
[[ $(find . -name '*.db.tar.xz' | wc -l) -gt 0 ]] && [[ $(find . -name '*.db.tar.zstd' | wc -l) -gt 0 ]] && {
echo "Found XZ and ZStd databases! Check this!"
exit 1
}

View file

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
cat -s <<EOF >scripts/repoctl.toml cat -s <<EOF >scripts/repoctl.toml
repo = "$(find $(pwd) -mindepth 1 -maxdepth 1 -name '*.db.tar.xz')" repo = "$(find $(pwd) -mindepth 1 -maxdepth 1 -name '*.db.tar.xz' -or '*.db.tar.xstd')"
backup = false backup = false
interactive = false interactive = false
columnate = false columnate = false