mirror of
https://github.com/Luzifer/archrepo.git
synced 2024-12-20 13:11:17 +00:00
Add build-time to listing
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c3b3e42f0c
commit
a5229faa9b
2 changed files with 16 additions and 3 deletions
5
Makefile
5
Makefile
|
@ -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
14
scripts/listing.sh
Normal 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'
|
Loading…
Reference in a new issue