Skip to content

Commit

Permalink
Update container build to also work on fedora >= 41
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura authored and jan-kolarik committed Oct 31, 2024
1 parent 28da8e4 commit 8532ca8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,19 @@ RUN set -x && \
# copy test suite
COPY ./dnf-behave-tests/ /opt/ci/dnf-behave-tests

# remove dnf5 and exclude it to ensure we test old dnf
RUN set -x && \
dnf -y remove dnf5 --setopt=protected_packages=,; \
echo "excludepkgs=dnf5*" >> /etc/dnf/dnf.conf

# On Fedora > 40 the symlinks to dnf-3 and yum are missing (because dnf5 provides dnf), add them manually
RUN set -x && \
ln -sf /usr/bin/dnf-3 /usr/bin/dnf; \
ln -sf /usr/bin/dnf-3 /usr/bin/yum

# install test suite dependencies
RUN set -x && \
dnf -y builddep /opt/ci/dnf-behave-tests/requirements.spec --exclude=dnf5 && \
dnf -y builddep /opt/ci/dnf-behave-tests/requirements.spec && \
pip3 install -r /opt/ci/dnf-behave-tests/requirements.txt

# install local RPMs if available
Expand Down
7 changes: 7 additions & 0 deletions dnf-behave-tests/requirements.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ BuildRequires: zchunk
# tested packages
BuildRequires: createrepo_c

# For newer fedoras we don't build dnf-automatic and dnf/yum packages because of dnf5
# https://github.com/rpm-software-management/dnf/commit/f519e602a70ce6d3494a9d9d70464187eb9c263e
# https://github.com/rpm-software-management/dnf/commit/d50a6b2a63976bd3e4a0cf99b53aa9cfc189f68a
%if 0%{?fedora} < 41
BuildRequires: dnf
BuildRequires: dnf-automatic
BuildRequires: yum
%else
BuildRequires: python3-dnf
%endif

BuildRequires: dnf-plugins-core
BuildRequires: dnf-utils
Expand Down

0 comments on commit 8532ca8

Please sign in to comment.