mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2025-11-30 04:45:59 +00:00
Make updatepkgs and updatepkgnames more precise for side tags
The way side tags work, every package in the distro is in the side tag repo, so updatepkgs and updatepkgnames end up huge. To fix this, we'll use a koji query for all packages that are actually in the side tag to generate updatepkgnames.txt, and then use that to filter the dnf command to generate updatepkgs.txt. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
1714c77620
commit
3fd367938b
43
lib/utils.pm
43
lib/utils.pm
@ -580,16 +580,37 @@ 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
|
||||||
# -q avoids most progress spew into the output. grep -v testtag
|
if ($copr) {
|
||||||
# avoids some more. grep . filters empty lines, which we get
|
# -q avoids most progress spew into the output. grep -v testtag
|
||||||
# with dnf < 5 since this queryformat template ends with \n for
|
# avoids some more. grep . filters empty lines, which we get
|
||||||
# dnf >= 5
|
# with dnf < 5 since this queryformat template ends with \n for
|
||||||
assert_script_run 'dnf -q --disablerepo=* --enablerepo=openqa-testtag repoquery --qf "%{SOURCERPM} %{NAME} %{EPOCH} %{VERSION} %{RELEASE}\n" --arch=' . $arch . ',noarch | sort -u | grep -v testtag | grep . > /mnt/updatepkgs.txt';
|
# dnf >= 5
|
||||||
# the | xargs here is a wacky trick that converts newlines to
|
assert_script_run 'dnf -q --disablerepo=* --enablerepo=openqa-testtag repoquery --qf "%{SOURCERPM} %{NAME} %{EPOCH} %{VERSION} %{RELEASE}\n" --arch=' . $arch . ',noarch | sort -u | grep -v testtag | grep . > /mnt/updatepkgs.txt';
|
||||||
# spaces - unlike rpm, dnf < 5 always puts every package on a new
|
# the | xargs here is a wacky trick that converts newlines to
|
||||||
# line, which we don't want here
|
# spaces - unlike rpm, dnf < 5 always puts every package on a new
|
||||||
# https://unix.stackexchange.com/a/110759
|
# line, which we don't want here
|
||||||
assert_script_run 'dnf -q --disablerepo=* --enablerepo=openqa-testtag repoquery --qf "%{NAME} " | xargs > /mnt/updatepkgnames.txt';
|
# https://unix.stackexchange.com/a/110759
|
||||||
|
assert_script_run 'dnf -q --disablerepo=* --enablerepo=openqa-testtag repoquery --qf "%{NAME} " | xargs > /mnt/updatepkgnames.txt';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# for side tags we use koji because the repo has *every* package
|
||||||
|
# on CANNED, we need to enter the toolbox
|
||||||
|
if (get_var("CANNED")) {
|
||||||
|
type_string "toolbox -y enter\n";
|
||||||
|
# this is simply to wait till we're in the toolbox
|
||||||
|
assert_script_run "true", 180;
|
||||||
|
}
|
||||||
|
assert_script_run 'dnf -y install koji', 300;
|
||||||
|
assert_script_run 'koji list-tagged ' . $tag . ' --latest | tail -n+3 | cut -d\' \' -f1 | rev | cut -d\'-\' -f3- | rev > /mnt/updatepkgnames.txt';
|
||||||
|
# exit the toolbox on CANNED
|
||||||
|
if (get_var("CANNED")) {
|
||||||
|
type_string "exit\n";
|
||||||
|
wait_serial "# ";
|
||||||
|
}
|
||||||
|
upload_logs '/mnt/updatepkgnames.txt';
|
||||||
|
# now *only* query those packages via dnf to generate updatepkgs
|
||||||
|
assert_script_run 'dnf -q --disablerepo=* --enablerepo=openqa-testtag repoquery `tr "\n" " " < /mnt/updatepkgnames.txt` --qf "%{SOURCERPM} %{NAME} %{EPOCH} %{VERSION} %{RELEASE}\n" --arch=' . $arch . ',noarch | sort -u | grep -v testtag | grep . > /mnt/updatepkgs.txt';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
my @was = get_workarounds($args{version});
|
my @was = get_workarounds($args{version});
|
||||||
# bail if there are no workarounds:
|
# bail if there are no workarounds:
|
||||||
@ -1268,7 +1289,7 @@ sub advisory_check_nonmatching_packages {
|
|||||||
$timeout *= 2 if ($pkgs > 4800);
|
$timeout *= 2 if ($pkgs > 4800);
|
||||||
my $wrapper = $args{wrapper};
|
my $wrapper = $args{wrapper};
|
||||||
$rpmcmd = "$wrapper rpm" if ($wrapper);
|
$rpmcmd = "$wrapper rpm" if ($wrapper);
|
||||||
$timeout *= 2 if ($wrapper);
|
$timeout *= 3 if ($wrapper);
|
||||||
# this creates /tmp/installedupdatepkgs.txt as a sorted list of installed
|
# this creates /tmp/installedupdatepkgs.txt as a sorted list of installed
|
||||||
# packages with the same name as packages from the update, in the same form
|
# packages with the same name as packages from the update, in the same form
|
||||||
# as /mnt/updatepkgs.txt. The '--last | head -1' tries to handle the
|
# as /mnt/updatepkgs.txt. The '--last | head -1' tries to handle the
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user