| 1 |
#!/usr/bin/env bash |
| 2 |
|
| 3 |
set -e -x |
| 4 |
|
| 5 |
# The check_autoconf_regen job of .github/workflows/build.yml must kept in |
| 6 |
# sync with this script. Use the same container image than the job so the job |
| 7 |
# doesn't need to run autoreconf in a container. |
| 8 |
IMAGE="ghcr.io/python/autoconf:2025.01.02.12581854023" |
| 9 |
AUTORECONF="autoreconf -ivf -Werror" |
| 10 |
|
| 11 |
WORK_DIR="/src" |
| 12 |
|
| 13 |
abs_srcdir=$(cd $(dirname $0)/../..; pwd) |
| 14 |
|
| 15 |
if podman --version &>/dev/null; then |
| 16 |
RUNTIME="podman" |
| 17 |
elif docker --version &>/dev/null; then |
| 18 |
RUNTIME="docker" |
| 19 |
else |
| 20 |
echo "$@ needs either Podman or Docker container runtime." >&2 |
| 21 |
exit 1 |
| 22 |
fi |
| 23 |
|
| 24 |
PATH_OPT="" |
| 25 |
if command -v selinuxenabled >/dev/null && selinuxenabled; then |
| 26 |
PATH_OPT=":Z" |
| 27 |
fi |
| 28 |
|
| 29 |
"$RUNTIME" run --rm -v "$abs_srcdir:$WORK_DIR$PATH_OPT" "$IMAGE" |