api apt: recduce indentation in package status update sub

best viewed with `-w` flag

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-02-01 12:21:39 +01:00
parent a8cac426df
commit 913d893364

View File

@ -131,8 +131,7 @@ my $assemble_pkginfo = sub {
if (my $pkgfile = &$get_pkgfile($candidate_ver)) {
$data->{Origin} = $pkgfile->{Origin};
my $changelog_url = $get_changelog_url->(
$pkgname, $info, $candidate_ver->{VerStr}, $pkgfile);
my $changelog_url = $get_changelog_url->($pkgname, $info, $candidate_ver->{VerStr}, $pkgfile);
$data->{ChangeLogUrl} = $changelog_url if $changelog_url;
}
@ -178,8 +177,8 @@ my $update_pve_pkgstatus = sub {
next if !$p->{SelectedState} || ($p->{SelectedState} ne 'Install');
my $current_ver = $p->{CurrentVer} || next;
my $candidate_ver = $policy->candidate($p) || next;
next if $current_ver->{VerStr} eq $candidate_ver->{VerStr};
if ($current_ver->{VerStr} ne $candidate_ver->{VerStr}) {
my $info = $pkgrecords->lookup($pkgname);
my $res = &$assemble_pkginfo($pkgname, $info, $current_ver, $candidate_ver);
push @$pkglist, $res;
@ -187,9 +186,9 @@ my $update_pve_pkgstatus = sub {
# also check if we need any new package
# Note: this is just a quick hack (not recursive as it should be), because
# I found no way to get that info from AptPkg
if (my $deps = $candidate_ver->{DependsList}) {
my $found;
my $req;
my $deps = $candidate_ver->{DependsList} || next;
my ($found, $req);
for my $d (@$deps) {
if ($d->{DepType} eq 'Depends') {
$found = $d->{TargetPkg}->{SelectedState} eq 'Install' if !$found;
@ -218,8 +217,6 @@ my $update_pve_pkgstatus = sub {
}
}
}
}
}
# keep notification status (avoid sending mails abou new packages more than once)
foreach my $pi (@$pkglist) {