-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcheck-mismatched-packages
executable file
·51 lines (46 loc) · 1.39 KB
/
check-mismatched-packages
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
#!/usr/bin/env bash
# check whether packages that should be kept in sync are up-to-date
# (c) 2023-2024 Michał Górny <mgorny@gentoo.org>
# SPDX-License-Identifier: GPL-2.0-or-later
REPO=$(git rev-parse --show-toplevel)
PKGS=(
dev-python/ensurepip-pip:0=dev-python/pip:0
dev-python/ensurepip-setuptools:0=dev-python/setuptools:0
dev-python/ensurepip-wheel:0=dev-python/wheel:0
app-doc/python-docs:2.7=dev-lang/python:2.7
app-doc/python-docs:3.8=dev-lang/python:3.8
app-doc/python-docs:3.9=dev-lang/python:3.9
app-doc/python-docs:3.10=dev-lang/python:3.10
app-doc/python-docs:3.11=dev-lang/python:3.11
app-doc/python-docs:3.12=dev-lang/python:3.12
dev-python/python-tests:3.10=dev-lang/python:3.10
dev-python/python-tests:3.11=dev-lang/python:3.11
dev-python/python-tests:3.12=dev-lang/python:3.12
dev-python/python-tests:3.13=dev-lang/python:3.13
)
declare -A VERSIONS
while read -r PKG; do
SLOT=${PKG#*:}
PKG=${PKG%:*}
PKG=${PKG%-r[0-9]*}
NAME=${PKG%-*}
VERSION=${PKG##*-}
VERSION=${VERSION%_p*}
VERSIONS[${NAME}:${SLOT}]=${VERSION}
done < <(
pquery --raw --quiet --repo "${REPO}" --slot "${PKGS[@]%=*}" "${PKGS[@]#*=}"
)
RET=0
for PKG in "${PKGS[@]}"; do
A=${PKG%=*}
B=${PKG#*=}
AV="${VERSIONS[${A}]}"
BV="${VERSIONS[${B}]}"
if [[ ${AV} != ${BV} ]]; then
echo "Package version mismatch found!" >&2
echo " ${A}: ${AV}" >&2
echo " ${B}: ${BV}" >&2
RET=1
fi
done
exit "${RET}"