mirror of
https://github.com/openwrt/packages.git
synced 2026-10-12 16:47:15 +04:00
The override lists every python3 package by name, so it has to change whenever the package set does, and it cannot be used as is on branches that build a different set, like libpython3-3.13 and python3-email on openwrt-25.12. Check the interpreter, python3-dev and libpython3-X.Y against the version, and accept the standard library modules and -src packages by pattern, since they ship no executables. python3-dev now gets a real check through python3-config and patchlevel.h, because python3-config prints no version. Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
40 lines
915 B
Bash
Executable File
40 lines
915 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# shellcheck shell=busybox
|
|
|
|
# PYTHON3_VERSION from python3-version.mk, for example 3.13
|
|
PYTHON3_VERSION="${PKG_VERSION%.*}"
|
|
|
|
case "$PKG_NAME" in
|
|
python3|\
|
|
python3-base|\
|
|
python3-light)
|
|
"python$PYTHON3_VERSION" --version | grep -Fx "Python $PKG_VERSION" &&
|
|
python3 --version | grep -Fx "Python $PKG_VERSION"
|
|
;;
|
|
|
|
python3-dev)
|
|
# python3-config prints no version, so check that it points to the
|
|
# headers of this version
|
|
"python$PYTHON3_VERSION-config" --includes |
|
|
grep -F -e "-I/usr/include/python$PYTHON3_VERSION" &&
|
|
grep '^#define PY_VERSION ' "/usr/include/python$PYTHON3_VERSION/patchlevel.h" |
|
|
grep -F "\"$PKG_VERSION\""
|
|
;;
|
|
|
|
libpython3-*)
|
|
# The package name carries the ABI version
|
|
[ "$PKG_NAME" = "libpython3-$PYTHON3_VERSION" ]
|
|
;;
|
|
|
|
python3-*)
|
|
# Standard library modules and -src packages ship no executables
|
|
exit 0
|
|
;;
|
|
|
|
*)
|
|
echo "Untested package: $PKG_NAME" >&2
|
|
exit 1
|
|
;;
|
|
esac
|