mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 21:50:27 +01:00
contrib: default to run same fedora version in nm-in-container.sh as host
If the out host runs Fedora, it's most useful that the container is the same Fedora version. Detect it.
This commit is contained in:
parent
81527052d7
commit
897a96da7b
1 changed files with 8 additions and 1 deletions
|
|
@ -34,7 +34,14 @@ set -e
|
|||
# running a CI test.
|
||||
###############################################################################
|
||||
|
||||
BASE_IMAGE="${BASE_IMAGE:-fedora:latest}"
|
||||
if [ -z "$BASE_IMAGE" ]; then
|
||||
if grep -q "^ID=fedora$" /etc/os-release 2>/dev/null ; then
|
||||
BASE_IMAGE="$(sed -n 's/^VERSION_ID=\([0-9]\+\)$/fedora:\1/p' /etc/os-release)"
|
||||
fi
|
||||
fi
|
||||
if [ -z "$BASE_IMAGE" ]; then
|
||||
BASE_IMAGE=fedora:latest
|
||||
fi
|
||||
|
||||
BASEDIR_NM="$(readlink -f "$(dirname "$(readlink -f "$0")")/../..")"
|
||||
BASEDIR="$BASEDIR_NM/contrib/scripts/nm-in-container.d"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue