aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-10-08 12:41:05 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-10-09 10:40:41 +0200
commit1620dca5e38e24771fae9c45b5d5caeee3ac16fd (patch)
treecde551d139f0004e7a996923f6c83044c54edd3b
parent679d5d068060f2394a358ec23da47f9799ae202a (diff)
downloadlibvirt-ci-1620dca5e38e24771fae9c45b5d5caeee3ac16fd.zip
libvirt-ci-1620dca5e38e24771fae9c45b5d5caeee3ac16fd.tar.gz
libvirt-ci-1620dca5e38e24771fae9c45b5d5caeee3ac16fd.tar.bz2
add backports repo to SLE15 dockerfiles
The backports repo provides some rust subpackages that are not available in the main SLE/LEAP repository. Allow adding arbitrary repos in the facts YAML for the target, even though including them in the build environment is supported for now only for zypper (and therefore only for OpenSUSE targets). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--lcitool/facts/targets/opensuse-leap-15.yml2
-rw-r--r--lcitool/formatters.py8
-rw-r--r--tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.Dockerfile1
-rw-r--r--tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.sh1
4 files changed, 12 insertions, 0 deletions
diff --git a/lcitool/facts/targets/opensuse-leap-15.yml b/lcitool/facts/targets/opensuse-leap-15.yml
index c993767..8747d70 100644
--- a/lcitool/facts/targets/opensuse-leap-15.yml
+++ b/lcitool/facts/targets/opensuse-leap-15.yml
@@ -7,6 +7,8 @@ os:
packaging:
format: 'rpm'
command: 'zypper'
+ repos:
+ - https://download.opensuse.org/update/leap/15.6/backports/openSUSE:Backports:SLE-15-SP6:Update.repo
paths:
bash: /bin/bash
diff --git a/lcitool/formatters.py b/lcitool/formatters.py
index 28f8f38..d1893f2 100644
--- a/lcitool/formatters.py
+++ b/lcitool/formatters.py
@@ -306,6 +306,14 @@ class BuildEnvFormatter(Formatter):
"{nosync}{packaging_command} install -y epel-next-release",
])
+ repos = facts["packaging"].get("repos", [])
+ if repos:
+ if osname == "OpenSUSE":
+ commands.extend(("{nosync}{packaging_command} addrepo -fc " + shlex.quote(x)
+ for x in repos))
+ else:
+ raise FormatterError(f"packaging.repos not supported for {osname}")
+
commands.extend(["{nosync}{packaging_command} install -y {pkgs}"])
if self._pkgcleanup:
diff --git a/tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.Dockerfile b/tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.Dockerfile
index 16f76ec..be3a59b 100644
--- a/tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.Dockerfile
+++ b/tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.Dockerfile
@@ -1,6 +1,7 @@
FROM registry.opensuse.org/opensuse/leap:15.6
RUN zypper update -y && \
+ zypper addrepo -fc https://download.opensuse.org/update/leap/15.6/backports/openSUSE:Backports:SLE-15-SP6:Update.repo && \
zypper install -y \
ca-certificates \
git \
diff --git a/tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.sh b/tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.sh
index 907973a..a7777c9 100644
--- a/tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.sh
+++ b/tests/data/formatters/out/libvirt-go-xml-module-opensuse-leap-15.sh
@@ -1,5 +1,6 @@
function install_buildenv() {
zypper update -y
+ zypper addrepo -fc https://download.opensuse.org/update/leap/15.6/backports/openSUSE:Backports:SLE-15-SP6:Update.repo
zypper install -y \
ca-certificates \
git \