contrib/scripts: add Fedora version to podmain container name for "nm-code-format-container.sh"

Older branches, like "nm-1-32" will always be formatted with a
different, older clang-format version. Luckily we also have on "nm-1-32"
branch the "nm-code-format-container.sh" script, so we can still
reformat the sources using the container.

However, as the name of the container was always "nm-code-format",
we would have to re-generate the container when we switch between
branches. As the container really only depends on the Fedora version
(as the clang-format version is tied to the corresponding Fedora
version), let's include the Fedora version in the name of the container.
This commit is contained in:
Thomas Haller 2022-01-04 21:12:02 +01:00
parent edc37b3adf
commit a6ff5ee448
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -10,7 +10,9 @@ die() {
DIR="$(realpath "$(dirname "$0")/../../")"
cd "$DIR"
PODNAME=nm-code-format
FEDORA_VERSION=35
PODNAME="nm-code-format-f$FEDORA_VERSION"
RENEW=0
for a; do
@ -37,7 +39,7 @@ if ! podman container exists "$PODNAME" ; then
--name="$PODNAME" \
-v "$DIR:/tmp/NetworkManager:Z" \
-w /tmp/NetworkManager \
fedora:35 \
"fedora:$FEDORA_VERSION" \
/bin/bash -c 'dnf upgrade -y && dnf install -y git /usr/bin/clang-format && ./contrib/scripts/nm-code-format.sh -i'
exit 0
fi