From 0e534a31504a3706e25ba61b9a14a2e4d128bed1 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 5 Jan 2021 09:38:29 -0800 Subject: [PATCH] Allow tasks as well as advisories as workarounds This will make my life a bit easier in the next hour or two. Signed-off-by: Adam Williamson --- lib/utils.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index b6b8b6cb..85df82b6 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -448,12 +448,17 @@ sub setup_workaround_repo { "33" => [] ); # then we'll download each update for our release: - my $advisories = $workarounds{$version}; - foreach my $advisory (@$advisories) { + my $advortasks = $workarounds{$version}; + foreach my $advortask (@$advortasks) { + my $cmd = "bodhi updates download --updateid=$advortask"; + if ($advortask =~ /^\d+$/) { + my $arch = get_var("ARCH"); + $cmd = "koji download-task --arch=$arch --arch=noarch $advortask"; + } my $count = 3; my $success = 0; while ($count) { - if (script_run "bodhi updates download --updateid=$advisory", 180) { + if (script_run $cmd, 180) { $count -= 1; } else {