Fix to check for referenced package only when allowed

This commit is contained in:
Ilia Ross
2025-02-04 22:09:36 +02:00
parent 783ee2d4d6
commit 3d5e3166ac
2 changed files with 3 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ foreach my $m (@mods) {
if (!$pkg) {
# Package is referenced by another name
foreach (@poss) {
my @pinfo = &software::package_info($_);
my @pinfo = &software::package_info($_, undef, 1);
$pkg = { 'name' => $pinfo[0],
'version' => $pinfo[4] } if @pinfo;
}

View File

@@ -40,7 +40,7 @@ return 0 if ($?); # couldn't find the package
return $i;
}
# package_info(package, [version])
# package_info(package, [version], [check-referenced])
# Returns an array of package information in the order
# name, class, description, arch, version, vendor, installtime
sub package_info
@@ -53,6 +53,7 @@ chop(@tmp);
local $ex = close(RPM);
local $whatprovides = "";
if (!@tmp || $tmp[0] =~ /not\s+installed/) {
return () if (!$_[2]);
&open_execute_command(RPM, "rpm -q --whatprovides $n --queryformat \"%{NAME}\\n%{GROUP}\\n%{ARCH}\\n%{VERSION}-%{RELEASE}\\n%{VENDOR}\\n%{INSTALLTIME}\\n\" 2>/dev/null", 1, 1);
@tmp = <RPM>;
chop(@tmp);