From 444efeabeb118ed9baa4108711fbff3e2c5bcc41 Mon Sep 17 00:00:00 2001 From: Valko Laszlo Date: Sun, 25 Apr 2021 19:46:41 +0200 Subject: [PATCH] Removed obsolete function. Added debug logging to check installed patches. --- pkgtool.pm | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/pkgtool.pm b/pkgtool.pm index 6062b6e..c9b5e25 100644 --- a/pkgtool.pm +++ b/pkgtool.pm @@ -734,6 +734,7 @@ sub read_os_patches ($$$) $$p{Flags} |= $state; $$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) { 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 ($$$) { my ($patches, $pkgs, $registry) = @_; @@ -849,7 +812,8 @@ sub read_pkg_patches ($$$) if (defined $state && $state =~ /^1$/o) { $$p{Flags} |= 0x20; $$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{Pkgs} = $pkgs; return $db; - } sub refresh_installed_patches ($)