From 34bb501be08aa2b313d88e67d6e0a7e0a3f9cfa6 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sun, 5 May 2024 00:07:30 +0200 Subject: New upstream version 1.47.90 --- contrib/scripts/nm-code-format-container.sh | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 contrib/scripts/nm-code-format-container.sh (limited to 'contrib/scripts/nm-code-format-container.sh') diff --git a/contrib/scripts/nm-code-format-container.sh b/contrib/scripts/nm-code-format-container.sh new file mode 100755 index 00000000..7a5ce0d4 --- /dev/null +++ b/contrib/scripts/nm-code-format-container.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e + +die() { + echo "$@" >&2 + exit 1 +} + +DIR="$(realpath "$(dirname "$0")/../../")" +cd "$DIR" + +# The correct clang-format version is the one from the Fedora version used in our +# gitlab-ci pipeline. Parse it from ".gitlab-ci/config.yml". +FEDORA_VERSION="$(sed '/^ tier: 1/,/^ - name/!d' .gitlab-ci/config.yml | sed -n "s/^ - '\([0-9]\+\)'$/\1/p" | sed -n 1p)" + +test -n "$FEDORA_VERSION" || die "Could not detect the Fedora version in .gitlab-ci/config.yml" + +IMAGENAME="nm-code-format:f$FEDORA_VERSION" + +ARGS=( "$@" ) + +if ! podman image exists "$IMAGENAME" ; then + echo "Building image \"$IMAGENAME\"..." + podman build \ + --squash-all \ + --tag "$IMAGENAME" \ + -f <(cat <