Skip to content

Commit 2d8cf0a

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
container: default to dnf in build script
Signed-off-by: John Mulligan <[email protected]>
1 parent 6ec2158 commit 2d8cf0a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/container/build.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ distname="${SAMBACC_DISTNAME}"
99
# use SAMBACC_BUILD_TASKS to limit build tasks if needed
1010
tasks="${SAMBACC_BUILD_TASKS:-task_test_tox task_py_build task_rpm_build task_gen_sums}"
1111
dist_prefix="${SAMBACC_DIST_PREFIX:-/srv/dist}"
12+
dnf_cmd=dnf
1213

1314
info() {
1415
echo "[[sambacc/build]] $*"
@@ -129,12 +130,12 @@ task_sys_deps() {
129130
)
130131

131132
if [ "$use_centos" ]; then
132-
yum install -y epel-release
133+
"${dnf_cmd}" install -y epel-release
133134
yum_args=(--enablerepo=crb)
134135
pkgs+=(pyproject-rpm-macros)
135136
fi
136-
yum "${yum_args[@]}" install -y "${pkgs[@]}"
137-
yum clean all
137+
"${dnf_cmd}" "${yum_args[@]}" install -y "${pkgs[@]}"
138+
"${dnf_cmd}" clean all
138139
}
139140

140141
task_test_tox() {
@@ -216,6 +217,10 @@ cleanup() {
216217
fi
217218
}
218219

220+
if ! command -v "${dnf_cmd}" >/dev/null ; then
221+
dnf_cmd=yum
222+
fi
223+
219224
# Allow the tests to use customized passwd file contents in order
220225
# to test samba passdb support. It's a bit strange, but should work.
221226
# The test suite tries to restore the passwd file after changing it,

0 commit comments

Comments
 (0)