From 0aa66649efa11e9c3c4d341f8a42f2eef8e942de Mon Sep 17 00:00:00 2001 From: rusty-snake <41237666+rusty-snake@users.noreply.github.com> Date: Tue, 26 Oct 2021 15:24:21 +0200 Subject: Add Profile Checks --- ci/check/profiles/private-etc-always-required.sh | 15 +++++++++++++++ ci/check/profiles/sort-disable-programs.sh | 2 ++ ci/check/profiles/sort-firecfg.config.sh | 2 ++ ci/check/profiles/sort.py | 1 + 4 files changed, 20 insertions(+) create mode 100755 ci/check/profiles/private-etc-always-required.sh create mode 100755 ci/check/profiles/sort-disable-programs.sh create mode 100755 ci/check/profiles/sort-firecfg.config.sh create mode 120000 ci/check/profiles/sort.py (limited to 'ci/check/profiles') diff --git a/ci/check/profiles/private-etc-always-required.sh b/ci/check/profiles/private-etc-always-required.sh new file mode 100755 index 000000000..892b15aa4 --- /dev/null +++ b/ci/check/profiles/private-etc-always-required.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +ALWAYS_REQUIRED=(alternatives ld.so.cache ld.so.preload) + +error=0 +while IFS=: read -r profile private_etc; do + for required in "${ALWAYS_REQUIRED[@]}"; do + if grep -q -v -E "( |,)$required(,|$)" <<<"$private_etc"; then + printf '%s misses %s\n' "$profile" "$required" >&2 + error=1 + fi + done +done < <(grep "^private-etc " "$@") + +exit "$error" diff --git a/ci/check/profiles/sort-disable-programs.sh b/ci/check/profiles/sort-disable-programs.sh new file mode 100755 index 000000000..d81ee75d7 --- /dev/null +++ b/ci/check/profiles/sort-disable-programs.sh @@ -0,0 +1,2 @@ +#!/bin/sh +tail -n +5 "$1" | LC_ALL=C sort -c -u diff --git a/ci/check/profiles/sort-firecfg.config.sh b/ci/check/profiles/sort-firecfg.config.sh new file mode 100755 index 000000000..17a595350 --- /dev/null +++ b/ci/check/profiles/sort-firecfg.config.sh @@ -0,0 +1,2 @@ +#!/bin/sh +tail -n +4 "$1" | sed 's/^# /#/' | LC_ALL=C sort -c -d diff --git a/ci/check/profiles/sort.py b/ci/check/profiles/sort.py new file mode 120000 index 000000000..e1f3f5f16 --- /dev/null +++ b/ci/check/profiles/sort.py @@ -0,0 +1 @@ +../../../contrib/sort.py \ No newline at end of file -- cgit v1.2.3-54-g00ecf