Removed obsolete function.

Added debug logging to check installed patches.
This commit is contained in:
László Valkó 2021-04-25 19:46:41 +02:00
parent 532b679a4d
commit 444efeabeb

View file

@ -734,6 +734,7 @@ sub read_os_patches ($$$)
$$p{Flags} |= $state; $$p{Flags} |= $state;
$$p{Current} = 1 if $state & 0x20; $$p{Current} = 1 if $state & 0x20;
} }
print_log('global', DEBUG3, 'Found OS patch information for %s: kbnum=%s current=%s', $kb, $number, $$p{Current});
} }
if ($name =~ /^([^~]*)~([^~]*)~([^~]*)~([^~]*)~([^~]*)$/o) { if ($name =~ /^([^~]*)~([^~]*)~([^~]*)~([^~]*)~([^~]*)$/o) {
my $pkg = $$pkgs{$name}; my $pkg = $$pkgs{$name};
@ -764,44 +765,6 @@ sub read_os_patches ($$$)
} }
} }
sub xread_pkg_patches ($$$)
{
my ($patches, $pkgs, $registry) = @_;
foreach my $pkgname ($registry->SubKeyNames) {
my $pkg = $registry->{$pkgname};
next unless defined $pkg;
foreach my $kbname ($pkg->SubKeyNames) {
next unless defined $kbname && $kbname =~ /KB(\d[0-9a-zA-Z]+)/o;
my $kb =$1;
my $sub = $pkg->{$kbname};
next unless defined $sub;
my $installername = get_registry_value($sub->{'InstallerName'});
my $state = get_registry_value($sub->{'ThisVersionInstalled'});
my $update = defined $installername && $installername eq 'Windows Installer';
my $number = $kb =~ /^(\d+)/o ? $1 : $kb;
my $p = $$patches{$kb};
if (! defined $p) {
$p = $$patches{$kb} = {
Type => 'Package',
Packages => {},
InstallClient => $installername,
Original => ! $update,
Update => $update,
KB => $kb,
Number => $number,
Flags => 0
};
}
${$$p{Packages}}{$pkgname} = 1;
if (defined $state && $state eq 'Y') {
$$p{Flags} |= 0x20;
$$p{Current} = 1;
}
}
}
}
sub read_pkg_patches ($$$) sub read_pkg_patches ($$$)
{ {
my ($patches, $pkgs, $registry) = @_; my ($patches, $pkgs, $registry) = @_;
@ -850,6 +813,7 @@ sub read_pkg_patches ($$$)
$$p{Flags} |= 0x20; $$p{Flags} |= 0x20;
$$p{Current} = 1; $$p{Current} = 1;
} }
print_log('global', DEBUG3, 'Found package patch information for %s/%s: kbnum=%s current=%s', $kb, $pkgname, $number, $$p{Current});
} }
} }
} }
@ -946,7 +910,6 @@ sub read_installed_patches ($)
$$db{Patches} = $patches; $$db{Patches} = $patches;
$$db{Pkgs} = $pkgs; $$db{Pkgs} = $pkgs;
return $db; return $db;
} }
sub refresh_installed_patches ($) sub refresh_installed_patches ($)