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

Add build-time to listing

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-12-11 23:31:48 +01:00
parent c3b3e42f0c
commit a5229faa9b
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5
2 changed files with 16 additions and 3 deletions

View file

@ -48,11 +48,10 @@ clear_database:
rm -f $(REPO_DIR)/*.db* $(REPO_DIR)/*.files* rm -f $(REPO_DIR)/*.db* $(REPO_DIR)/*.files*
list_packages: list_packages:
cp ./scripts/packages.hdr.txt $(REPO_DIR)/packages.txt bash ./scripts/listing.sh >$(REPO_DIR)/packages.txt
tar -tf $(DATABASE) | grep -v '/desc' | sed -E 's/(.*)-([^-]+-[0-9]+)\//\1\t\2/' | sort | column -t >>$(REPO_DIR)/packages.txt
repo_update: check_tools load_ssh_key repo_update: check_tools load_ssh_key
bash -euo pipefail -c 'for repo in $$(grep -v "^#" repo-urls); do script_level=1 ./scripts/update-repo.sh $${repo}; done' bash -euo pipefail -c 'for repo in $$(grep -v "^#" repo-urls | cut -d "#" -f 1); do script_level=1 ./scripts/update-repo.sh $${repo}; done'
sign_database: sign_database:
repo-add -s --key $(REPOKEY) $(DATABASE) repo-add -s --key $(REPOKEY) $(DATABASE)

14
scripts/listing.sh Normal file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
source ./scripts/script_framework.sh
[[ -n ${DATABASE:-} ]] || fatal "Missing DATABASE envvar"
cat scripts/packages.hdr.txt
{
for pkg in $(tar -tf ${DATABASE} | grep -v '/desc'); do
buildtime=$(date -u -d @$(tar -xf ${DATABASE} --to-stdout "${pkg}desc" | grep -A1 '%BUILDDATE%' | tail -n1))
echo -e "$(sed -E 's/(.*)-([^-]+-[0-9]+)\//\1\t\2/' <<<"${pkg}")\t${buildtime}"
done
} | sort | column -t -s "$(printf "\t")" -N 'Package,Version,Build-Time'