From a6ff5ee448a995966bf5699f3c077fc4b6ac9e44 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 4 Jan 2022 21:12:02 +0100 Subject: [PATCH] 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. --- contrib/scripts/nm-code-format-container.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/scripts/nm-code-format-container.sh b/contrib/scripts/nm-code-format-container.sh index a79bc4feb4..ce09f0eeca 100755 --- a/contrib/scripts/nm-code-format-container.sh +++ b/contrib/scripts/nm-code-format-container.sh @@ -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