]> git.proxmox.com Git - pve-installer.git/commitdiff
run command: use explicit return undef in closures on call sites
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 26 Feb 2024 13:38:11 +0000 (14:38 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 26 Feb 2024 13:39:03 +0000 (14:39 +0100)
To avoid a misinterpretation of the auto-return value:

> In the absence of an explicit return, a subroutine, eval, or do FILE
> automatically returns the value of the last expression evaluated.
-- https://perldoc.perl.org/functions/return

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Proxmox/Install.pm
Proxmox/Install/RunEnv.pm

index a0e1f5dfe9627e11e3d84ac682c401b38bee042d..67093a10d6f0542886d45fdcd64edbc9fad8bbcf 100644 (file)
@@ -121,6 +121,7 @@ sub create_filesystem {
        } elsif ($line =~ m/Writing superblocks and filesystem.*done/) {
            update_progress(1, $rs, $re);
        }
+       return;
     });
 }
 
@@ -358,6 +359,7 @@ sub get_pv_list_from_vgname {
        } else {
            $res->{$vg_uuid}->{pvs} .= ", $pv";
        }
+       return;
     };
     run_command("pvs --noheadings -o pv_name,vg_uuid -S vg_name='$vgname'", $parser, undef, 1);
 
@@ -903,6 +905,7 @@ sub extract_data {
                my $frac = $per > 100 ? 1 : $per/100;
                update_progress($frac, $maxper, 0.5);
            }
+           return;
        });
 
        syscmd("mount -n -t tmpfs tmpfs $targetdir/tmp") == 0 || die "unable to mount tmpfs on $targetdir/tmp\n";
@@ -1004,6 +1007,7 @@ sub extract_data {
                if ($line =~ m/^UUID=([A-Fa-f0-9\-]+)$/) {
                    $fsuuid = $1;
                }
+               return;
            });
 
            die "unable to detect FS UUID" if !defined($fsuuid);
@@ -1114,6 +1118,7 @@ _EOD
            if ($line =~ m/Setting up\s+(\S+)/) {
                update_progress((++$count)/$pkg_count, 0.75, 0.95, "configuring $1");
            }
+           return;
        });
 
        unlink "$targetdir/etc/mailname";
index d7ccea6510c2a8cb2d66d708148d6ef417465404..25b6bb3db25a648328ac69f321e84c93ca895fd8 100644 (file)
@@ -212,6 +212,7 @@ my sub detect_country_tracing_to : prototype($$) {
                    log_info("DC FOUND: $country\n");
                    return CMD_FINISHED;
                }
+               return;
            }
        }, undef, undef, 1);