mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 07:00:05 +01:00
contrib: avoid using "sudo" in REQUIRED_PACKAGES scripts
It's often not installed, and usually we are already root. Avoid using sudo.
This commit is contained in:
parent
ea3e61047f
commit
f6805debee
3 changed files with 12 additions and 6 deletions
|
|
@ -53,10 +53,10 @@ variables:
|
||||||
#
|
#
|
||||||
# This is done by running `ci-fairy generate-template` and possibly bumping
|
# This is done by running `ci-fairy generate-template` and possibly bumping
|
||||||
# ".default_tag".
|
# ".default_tag".
|
||||||
FEDORA_TAG: '2023-01-18.0-296fbfd97862'
|
FEDORA_TAG: '2023-01-18.0-82ad875db2dc'
|
||||||
UBUNTU_TAG: '2023-01-18.0-08fb4e6eb861'
|
UBUNTU_TAG: '2023-01-18.0-1218be1cbc9d'
|
||||||
DEBIAN_TAG: '2023-01-18.0-08fb4e6eb861'
|
DEBIAN_TAG: '2023-01-18.0-1218be1cbc9d'
|
||||||
CENTOS_TAG: '2023-01-18.0-296fbfd97862'
|
CENTOS_TAG: '2023-01-18.0-82ad875db2dc'
|
||||||
ALPINE_TAG: '2023-01-18.0-14c807942fa4'
|
ALPINE_TAG: '2023-01-18.0-14c807942fa4'
|
||||||
|
|
||||||
FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh'
|
FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh'
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,14 @@ set -xe
|
||||||
# Not all of these packages are strictly speaking necessary.
|
# Not all of these packages are strictly speaking necessary.
|
||||||
# This is a generous list of related packages.
|
# This is a generous list of related packages.
|
||||||
|
|
||||||
|
SUDO=
|
||||||
|
[ "$EUID" -eq 0 ] || SUDO=sudo
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
if [ "$NM_INSTALL" != "" ]; then
|
if [ "$NM_INSTALL" != "" ]; then
|
||||||
$NM_INSTALL "$@"
|
$NM_INSTALL "$@"
|
||||||
else
|
else
|
||||||
sudo apt-get install -y "$@"
|
$SUDO apt-get install -y "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,14 @@ set -xe
|
||||||
|
|
||||||
DNF="$(command -v dnf &>/dev/null && echo dnf || echo yum)"
|
DNF="$(command -v dnf &>/dev/null && echo dnf || echo yum)"
|
||||||
|
|
||||||
|
SUDO=
|
||||||
|
[ "$EUID" -eq 0 ] || SUDO=sudo
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
if [ "$NM_INSTALL" != "" ]; then
|
if [ "$NM_INSTALL" != "" ]; then
|
||||||
$NM_INSTALL "$@"
|
$NM_INSTALL "$@"
|
||||||
else
|
else
|
||||||
sudo "$DNF" install -y "$@"
|
$SUDO "$DNF" install -y "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue