1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-21 13:33:08 +00:00

Defend even harder against progress spew in updatepkgs.txt

Seems current dnf5 has a bug which causes repository refresh
progress to be sent to stdout even with -q.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2024-06-11 09:13:01 -07:00
parent 670d1072de
commit 304699bc6f

View File

@ -576,7 +576,11 @@ sub setup_repos {
# according to the 'configs' arg # according to the 'configs' arg
assert_script_run 'printf "[openqa-testtag]\nname=openqa-testtag\nbaseurl=' . get_var("UPDATE_OR_TAG_REPO") . '/\ncost=2000\nenabled=' . $args{configs} . '\ngpgcheck=0\npriority=1\n" > /etc/yum.repos.d/openqa-testtag.repo'; assert_script_run 'printf "[openqa-testtag]\nname=openqa-testtag\nbaseurl=' . get_var("UPDATE_OR_TAG_REPO") . '/\ncost=2000\nenabled=' . $args{configs} . '\ngpgcheck=0\npriority=1\n" > /etc/yum.repos.d/openqa-testtag.repo';
# write out the info files # write out the info files
assert_script_run 'dnf -q --disablerepo=* --enablerepo=openqa-testtag repoquery --qf "%{SOURCERPM} %{NAME} %{EPOCH} %{VERSION} %{RELEASE}\n" | sort -u | grep . > /mnt/updatepkgs.txt'; # -q avoids most progress spew into the output. grep -v testtag
# avoids some more. grep . filters empty lines, which we get
# with dnf < 5 since this queryformat template ends with \n for
# dnf >= 5
assert_script_run 'dnf -q --disablerepo=* --enablerepo=openqa-testtag repoquery --qf "%{SOURCERPM} %{NAME} %{EPOCH} %{VERSION} %{RELEASE}\n" | sort -u | grep -v testtag | grep . > /mnt/updatepkgs.txt';
# the | xargs here is a wacky trick that converts newlines to # the | xargs here is a wacky trick that converts newlines to
# spaces - unlike rpm, dnf < 5 always puts every package on a new # spaces - unlike rpm, dnf < 5 always puts every package on a new
# line, which we don't want here # line, which we don't want here