mirror of
https://github.com/Luzifer/archrepo.git
synced 2024-12-30 01:41:23 +00:00
Prepare migration to zstd archives
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
7a17164bf7
commit
3dfe38a9e5
5 changed files with 28 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,3 +4,5 @@
|
|||
*.files.sig
|
||||
*.tar.xz
|
||||
*.tar.xz.sig
|
||||
*.tar.zstd
|
||||
*.tar.zstd.sig
|
||||
|
|
9
Makefile
9
Makefile
|
@ -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
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@ download:
|
|||
--acl=public-read \
|
||||
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 \
|
||||
--delete \
|
||||
--exclude '*.old*' \
|
||||
|
@ -65,3 +65,8 @@ scripts/repoctl.toml:
|
|||
|
||||
sign_database:
|
||||
repo-add -s --key $(REPOKEY) $(DATABASE)
|
||||
|
||||
# Helpers
|
||||
|
||||
check_archive_mix:
|
||||
bash ./scripts/has_archive_mix.sh
|
||||
|
|
|
@ -14,12 +14,12 @@ join_by() {
|
|||
declare -A local_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")
|
||||
|
||||
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'
|
||||
|
||||
|
|
16
scripts/has_archive_mix.sh
Normal file
16
scripts/has_archive_mix.sh
Normal 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
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
set -euo pipefail
|
||||
|
||||
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
|
||||
interactive = false
|
||||
columnate = false
|
||||
|
|
Loading…
Reference in a new issue