1
0
Fork 0
mirror of https://github.com/Luzifer/archrepo.git synced 2024-11-08 17:40:01 +00:00
archrepo/scripts/listing.sh
Knut Ahlers 8c568d9d27
Remove *-debug packages from listing
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-08-21 15:48:49 +02:00

14 lines
524 B
Bash

#!/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
} | grep -v -- '-debug' | sort | column -t -s "$(printf "\t")" -N 'Package,Version,Build-Time'