From ba88dac3255a0ec6bfe8806b3827a3a6cd9cf3f7 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 1 Dec 2022 14:44:36 -0800 Subject: [PATCH] Handle chunked ADVISORY_NVRS_N settings Signed-off-by: Adam Williamson --- lib/utils.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 2d9f5a88..1e51c5cd 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -601,9 +601,24 @@ sub _repo_setup_updates { script_run "dnf -y install bodhi-client createrepo koji", 300; # download the packages - if (get_var("ADVISORY_NVRS")) { + if (get_var("ADVISORY_NVRS") || get_var("ADVISORY_NVRS_1")) { # regular update case - foreach my $nvr (split(/ /, get_var("ADVISORY_NVRS"))) { + # old style single ADVISORY_NVRS var + my @nvrs = split(/ /, get_var("ADVISORY_NVRS")); + unless (@nvrs) { + # new style chunked ADVISORY_NVRS_N vars + my $count = 1; + while ($count) { + if (get_var("ADVISORY_NVRS_$count")) { + push @nvrs, split(/ /, get_var("ADVISORY_NVRS_$count")); + $count++; + } + else { + $count = 0; + } + } + } + foreach my $nvr (@nvrs) { my $kojitime = 600; # texlive has a ridiculous number of subpackages $kojitime = 1500 if ((rindex $nvr, "texlive", 0) == 0);