-
Notifications
You must be signed in to change notification settings - Fork 0
/
ostree_remotes
executable file
·61 lines (53 loc) · 1.22 KB
/
ostree_remotes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
set -euo pipefail
# set -x
main() {
local sub
if [[ "${#}" -eq 1 ]]; then
sub="/${1}"
else
sub=""
fi
versions=(
"38"
"39"
"40"
"rawhide"
)
variants=(
"silverblue"
"kinoite"
"sericea"
"onyx"
)
arches=(
"x86_64"
"aarch64"
"ppc64le"
)
local -r summary="$(ostree remote summary fedora)"
for v in "${variants[@]}"; do
(
printf "%-10s" "${v}"
for r in "${versions[@]}"; do
echo -n "|$r"
done
echo ""
for a in "${arches[@]}"; do
if [[ "${v}" == "sericea" && "${a}" == "ppc64le" ]]; then
continue
fi
buf=""
for r in "${versions[@]}"; do
version="$(echo "$summary" | grep -E "$r/$a$sub/$v$" -A3 --no-group-separator | grep "Version" | awk 'NF>1{print $NF}')" || version=""
buf+="$(printf "|%-15s" "${version}")"
done
if [[ "$(echo "${buf}" | tr -d ' ')" != "||||" ]]; then
echo "${a}${buf}"
fi
done
) | column -t -s "|"
echo ""
done
}
main "${@}"