aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorErik Skultety <eskultet@redhat.com>2023-05-10 16:16:13 +0200
committerErik Skultety <eskultet@redhat.com>2023-05-16 08:06:29 +0000
commit553e8c1b92d8f361ac6dcc1aa1a2ca04fd273a19 (patch)
treee2b5581422033b1a289ee0e77fbc16259fd5681f /ci
parentf872062f335d15d99757a8eeee85181c22361a37 (diff)
downloadlibvirt-ci-553e8c1b92d8f361ac6dcc1aa1a2ca04fd273a19.zip
libvirt-ci-553e8c1b92d8f361ac6dcc1aa1a2ca04fd273a19.tar.gz
libvirt-ci-553e8c1b92d8f361ac6dcc1aa1a2ca04fd273a19.tar.bz2
ci: gitlab: Add a dumb DNF dry-run install wrapper
So DNF actually ends with and error code 1 when doing a dry-run install which translates to usage of the '--assumeno' option. This means that for us it's actually indistinguishable between a package name not being recognized or simply being the result of the operation having been aborted. We can't use the 'list' command sadly because list doesn't map tools/keywords/old names to the correct package, e.g. 'dnf list ebtables' gives an error while 'dnf install ebtables' maps it correctly to 'iptables-ebtables' on AlmaLinux 8 and CentOS Stream 8. What this all means is that in order to get all the features of the 'install' command and yet be able to do a dry-run, we need to wrap its use and provide some dumb parsing over the output and hope for the best that the output doesn't change in the future. Signed-off-by: Erik Skultety <eskultet@redhat.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/gitlab/all_mappings_prep_env/dnf_install_wrapper8
1 files changed, 8 insertions, 0 deletions
diff --git a/ci/gitlab/all_mappings_prep_env/dnf_install_wrapper b/ci/gitlab/all_mappings_prep_env/dnf_install_wrapper
new file mode 100755
index 0000000..b5d089c
--- /dev/null
+++ b/ci/gitlab/all_mappings_prep_env/dnf_install_wrapper
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+out="$(dnf $@)"
+echo "$out"
+
+if ( echo "$out" | grep -q "No match for argument:" ); then
+ exit 1
+fi